Hi everyone!
I have a U-net segmentation model that I used to deal with tiff images. Now I am working with DICOM. And the results of my model it has become really bad and weird. I did make some changes in my code to work with DICOM, but maybe he is not correct yet?
#pydicom to array, resize, normalize
image=pydicom.read_file(image_path)
image=image.pixel_array
image = (image - np.min(image)) / (np.max(image) - np.min(image))
image= np.array(image, dtype=np.float32)
image = Image.fromarray(image)
image = image.resize([int(image.width*0.1), int(image.height*0.1)], Image.LANCZOS)
image = np.array(image, dtype=np.float32)
Am I doing something wrong?
Best,
Giulia