I want to apply bias field correction in 3D T1w MR volumes(including non-brain sections too). Images are in NIfTI format. Though it is recommended to use masks, I don’t have masks or atlas for the data.
I saw the documentation here, N4 Bias Field Correction — SimpleITK 2.0rc2 documentation
and ran the following codes:
input = sitk.ReadImage(files) image = sitk.Cast(input, sitk.sitkFloat32) # print(type(image)) correctedImg = sitk.N4BiasFieldCorrection(image) sitk.WriteImage(correctedImg, outfile) # outfile is just string variable or path
But the output comes totally blank. What am I missing?
Edit: I got the bias corrected image in MNI format. Is there a way to get the images in native MR space?