Issue with DICOM to Nifti Conversion

I am trying to convert Dicom files to Nifti. But after conversion, I see a huge change in intensity (2nd image). I have also tried SimpleITK library bias correction. But the outcomes are the same.

Would anyone explain why it happened and how to fix this?


Nifti (after conversion)

DICOM files can contain window/level information to indicated how they should be displayed, but nii files do not have that, so viewers just guess how best to display. Try different window/level settings to confirm that the data was transferred correcty.

1 Like

I have tried to apply the same windowing and leveling using sitk while converting DICOM to NIFTI. But still, it doesn’t look the same. Any idea what would be the best conversion method to keep the visual information intact?

@pieper the NIfTI header does provide cal_min and cal_max. While these NIfTI fields are not often used, they would provide you a mechanism to retain the DICOM Window Center (0028,1050) and Window Width (0028,1051) tags. Specifically:

 cal_min = WC - (WW/2)
 cal_max = WC + (WW/2)

@Shovon_Ahmed have you tried converting your DICOMs to NIfTI and loading the resulting NIfTI allows you apply the original window values? This would help you trouble shoot at what stage the problem is occurring. My first thought might be to make sure that the DICOM Rescale intercept, (0028,1052), and rescale slope (0028,1053) have been correctly converted to the NIfTI scl_inter and scl_slope fields.

Thanks for the heads up on that @Chris_Rorden - perhaps we should add support for these cal_min/max fields in our nifti readers and writers. It wouldn’t be a hard task if someone wants to take it on.

Thank you @Chris_Rorden. Normalizing WW and WC gives the same visual result as DICOM.