How to save and read NIfTI file

80 Views Asked by At

I am trying to save a NIfTI file but I am not sure if I am doing everything right.

Recon_Img[:, :, d-1, :] = MeanImg[:,:,ITERATIONS-1]/NumberOfSlices


recon_filename = 'ReconstructedImage.nii.gz'
    
recon_image = nib.Nifti1Image(Recon_Img, reconstructed_aff, reconstructed_hd)
nib.save(recon_image, recon_filename)

The first row is part of a loop, where d iterates through NumberOfSlices.

This generates a .nii.gz file but I do not know how to open and check if the reconstructed image is correct or not.

0

There are 0 best solutions below