Skip to content

Commit

Permalink
Fixed error message bug
Browse files Browse the repository at this point in the history
  • Loading branch information
VPetukhov committed Sep 13, 2024
1 parent ff7a78e commit 4257d73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data_loading/prior_segmentation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ function load_segmentation_mask(path::String)::SparseMatrixCSC
end
end

length(size(labels) == 2) || error("Segmentation mask must be a 2D image, but it has $(length(size(labels))) dimensions.")
(length(size(labels)) == 2) || error("Segmentation mask must be a 2D image, but it has $(length(size(labels))) dimensions.")
return SparseMatrixCSC{Int, Int}(labels)
end

labels = load(path) |> ImageCore.channelview |> ImageCore.rawview;
length(size(labels) == 2) || error("Segmentation mask must be a 2D image, but it has $(length(size(labels))) dimensions.")
(length(size(labels)) == 2) || error("Segmentation mask must be a 2D image, but it has $(length(size(labels))) dimensions.")

labels = labels |> sparse |> dropzeros!
if length(unique(nonzeros(labels))) == 1
Expand Down

0 comments on commit 4257d73

Please sign in to comment.