What is the correct way to convert CT scan nifti files to Hounsfield units? My code is as follows:
path = 'input/volume/volume-0.nii'
img_obj = nib.load(path)
img_data = img_obj.get_fdata()
slope = img_obj.dataobj.slope
intercept = img_obj.dataobj.inter
img_data[img_data >= 1200] = 0 #trying to remove bone area
images = slope * img_data.astype(np.float32)
hu_images = images + intercept
But when I try to normalize this hu converted image to [0,1], it yields a black image.