Skip to content

Commit

Permalink
Fix for DWI None mask export
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdaniel654 committed Nov 28, 2023
1 parent a0c3666 commit 3d06a8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ukat/mapping/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,10 @@ def to_nifti(self, output_directory=os.getcwd(), base_file_name='Output',
nib.save(color_fa_nifti, base_path +
'_color_fa_map.nii.gz')
elif result == 'mask':
mask_nifti = nib.Nifti1Image(self.mask.astype(np.uint16),
affine=self.affine)
nib.save(mask_nifti, base_path + '_mask.nii.gz')
if self.mask is not None:
mask_nifti = nib.Nifti1Image(self.mask.astype(np.uint16),
affine=self.affine)
nib.save(mask_nifti, base_path + '_mask.nii.gz')
else:
raise ValueError('No NIFTI file saved. The variable "maps" '
'should be "all" or a list of maps from '
Expand Down

0 comments on commit 3d06a8a

Please sign in to comment.