Skip to content

Commit

Permalink
keep axis same
Browse files Browse the repository at this point in the history
  • Loading branch information
ioangatop committed Apr 22, 2024
1 parent c5ce41e commit 5f8ba05
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def load_masks(self, index: int) -> tv_tensors.Mask:
slice_index = self._get_sample_slice_index(index)
mask_paths = (os.path.join(masks_dir, label + ".nii.gz") for label in self.classes)
list_of_mask_arrays = [io.read_nifti_slice(path, slice_index) for path in mask_paths]
masks = np.concatenate(list_of_mask_arrays, axis=-1)
masks = np.concatenate(list_of_mask_arrays, axis=2)
return tv_tensors.Mask(masks.transpose(2, 0, 1))

def _get_masks_dir(self, index: int) -> str:
Expand Down

0 comments on commit 5f8ba05

Please sign in to comment.