Closed yuhancui closed 2 years ago
@yuhancui Hi Yuhan, thanks for your contribution. Would you like me to merge this to the master branch?
Yes, please.
On 02/18/2022 16:58, Raymond Pomponio wrote:
@yuhancui Hi Yuhan, thanks for your contribution. Would you like me to merge this to the master branch?
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>
When Nibabel reads in nifti data, it reads as float64 regardless of its actual type (but if you check the header, it’s the correct original type). When save output image, if directly use Nibabel data (float64) and header from input (int16), due to type conflict (float is larger), output will have scaling factor saved in header. To fix the issue, use: nifti_out = nib.Nifti1Image(np.round(nifti_out).astype(np.int16), affine, header)