From 2d6f8c46708439f7e973163ede2ef494afcf2880 Mon Sep 17 00:00:00 2001 From: wexeee Date: Wed, 11 Jan 2023 10:08:50 +0000 Subject: [PATCH] Fix int dtype in Image. --- spec2nii/spec2nii.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec2nii/spec2nii.py b/spec2nii/spec2nii.py index b5f220d..8d034a1 100644 --- a/spec2nii/spec2nii.py +++ b/spec2nii/spec2nii.py @@ -405,11 +405,12 @@ def dicom(self, args): from nibabel import save for img, f_out in zip(self.imageOut, self.fileoutNames): out = self.outputDir / (f_out + '_voi.nii.gz') + mask_data = np.ones((1, 1, 1), int) save( Nifti2Image( - np.ones((1, 1, 1), int), + mask_data, img.hdr_ext['VOI'], - dtype=int), + dtype=mask_data.dtype), out) # Siemens RDA (.rda) format