Skip to content

Commit

Permalink
Update ivadomed/loader/segmentation_pair.py
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Newton <joshuacwnewton@gmail.com>
  • Loading branch information
mathieuboudreau and joshuacwnewton committed Jan 30, 2024
1 parent 0cf1593 commit 908dd1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ivadomed/loader/segmentation_pair.py
Expand Up @@ -356,7 +356,7 @@ def convert_file_to_nifti(self, filename: str, extension: str, is_gt: bool = Fal
colorspace_idx = 2
if _img.ndim <= colorspace_idx: # binary or gray
pass # nothing to do
elif _img.shape[colorspace_idx]==2: #gray with alpha channel
elif _img.shape[colorspace_idx] == 2: # gray with alpha channel
_img = _img[:, :, 0]
elif _img.shape[colorspace_idx] == 3: # RGB
_img = np.sum(_img * (.299, .587, .114), axis=-1)
Expand Down

0 comments on commit 908dd1b

Please sign in to comment.