Skip to content

Commit 1afcc15

Browse files
committed
BUG: off by one dimension.
1 parent 43c7174 commit 1afcc15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ants/deeplearn/one_hot_segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def segmentation_to_one_hot(segmentations_array,
4242
if number_of_labels < 2:
4343
raise ValueError("At least two segmentation labels need to be specified.")
4444

45-
image_dimension = len(segmentations_array.shape)
45+
image_dimension = len(segmentations_array.shape) - 1
4646

4747
one_hot_array = np.zeros((*segmentations_array.shape, number_of_labels))
4848
for i in range(number_of_labels):

0 commit comments

Comments
 (0)