Skip to content

Commit

Permalink
merge cases list into constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
hollandjg committed Oct 28, 2024
1 parent 8dc5597 commit aaef1e0
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions test/test-regionprops-labeled.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@
]

@info "testing props with label"
props_with_label = DataFrame(label=Int[], min_row=Int[], min_col=Int[], max_row=Int[], max_col=Int[])
push!(props_with_label,
(1, 1, 1, 4, 4),
(2, 1, 4, 5, 8),
(3, 1, 8, 6, 13),
(4, 5, 1, 10, 7),
(5, 5, 1, 10, 7)
)
props_with_label = DataFrame([
1 1 1 4 4
2 1 4 5 8
3 1 8 6 13
4 5 1 10 7
5 5 1 10 7
], [:label, :min_row, :min_col, :max_row, :max_col])


@test cropfloe(img1, props_with_label, 1) == [
Expand Down Expand Up @@ -79,14 +78,13 @@
]

@info "testing props without label"
props_without_label = DataFrame(min_row=Int[], min_col=Int[], max_row=Int[], max_col=Int[])
push!(props_without_label,
(1, 1, 4, 4),
(1, 4, 5, 8),
(1, 8, 6, 13),
(5, 1, 10, 7),
(5, 1, 10, 7)
)
props_without_label = DataFrame([
1 1 4 4
1 4 5 8
1 8 6 13
5 1 10 7
5 1 10 7
], [:min_row, :min_col, :max_row, :max_col])

@test cropfloe(img1, props_without_label, 1) == [
0 0 0 0
Expand Down

0 comments on commit aaef1e0

Please sign in to comment.