Skip to content

Commit

Permalink
BUG: Index off by 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ntustison committed Dec 30, 2024
1 parent 1419bb1 commit a228fc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions antspynet/utilities/harvard_oxford_atlas_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def reshape_image(image, crop_size, interp_type = "linear"):
label_index = labels.index(label)
probability_array = np.squeeze(predicted_data[0][b, :, :, :, label_index])
if label == 0:
probability_array += np.squeeze(np.sum(predicted_data[0][b, :, :, :, 21:], axis=3))
probability_array += np.squeeze(np.sum(predicted_data[0][b, :, :, :, 20:], axis=3))
if b == 1:
probability_array = np.flip(probability_array, axis=0)
probability_image = ants.from_numpy_like(probability_array, t1_preprocessed)
Expand Down Expand Up @@ -224,7 +224,7 @@ def reshape_image(image, crop_size, interp_type = "linear"):
probability_images[label_index] *= (foreground_probability_image * -1 + 1)
else:
probability_images[label_index] *= foreground_probability_image

labels = sorted((*hoa_lateral_labels, *hoa_lateral_left_labels))

bext = brain_extraction(t1, modality="t1hemi", verbose=verbose)
Expand Down

0 comments on commit a228fc7

Please sign in to comment.