converting 12 bit DICOM image to 8 bit jpeg
问题 I am trying to load DICOM files into python using the dicom library. I have done the following ds=dicom.read_file(r"C:\Users\Z003SPFR.AD005\ML\GLCM AND SVM\data\NECT\1.IMA") # # store the raw image data DicomImage = ds.pixel_array This gives me values that appear to be 12 bit, since the highest value obtained was around 3047 and lowest value was 0. Then i made my own mapping function to bring it to the range 0-255. I used the following code: leftMin = 0 leftMax = np.amax(DicomImage) rightMin