Hello, is there any loss of information when converting a dicom file to a 16 bit png image? We are, of course, not talking about metadata in dicom. My comrade is reluctant to convert dicom files into images, claiming that this will lead to loss of information. Thank you.
Hello @Wallesss,
Your colleague is correct. This is due to two aspects of DICOM:
- The intensity values can have negative values which are not supported by the png file format (e.g. the Hounsfield value for air in CT is -1000).
- The spatial information associated with the DICOM image (its physical properties: origin, spacing, direction cosine matrix) will be lost.
For more information see the DICOM standard “Image Plane Module” section and possibly the SimpleITK fundamental concepts.
Hello, it turns out that in all projects that use transfer learning of neural networks, for example, ResNet, VGG, AlexNet, when converting dicom to png using the cv2 library, there is a loss of information? However, it is not possible to use pretrained neural network models with dicom images due to the mismatch in the number of input data channels. PNG has three channels, and dicom has one.
Examples of such projects:
Đ°nd many others.
Hello @Wallesss,
With respect to your question: “Hello, it turns out that in all projects that use transfer learning of neural networks, for example, ResNet, VGG, AlexNet, when converting dicom to png using the cv2 library, there is a loss of information?”
The answer is no. The information is encoded differently.
Let’s look at the first project you listed midl2020-cnnlstm-ich. Based on the README we see that they preprocess the DICOM data by using a window-level operation which maps the high dynamic range (original intensity range in the DICOM file) to a low dynamic range [0,255]. They repeat the process three times using different window-level values and end up with an image that has three channels with low dynamic range intensity values. This image can be safely saved in the png format (only loosing the spatial information - spacing, origin, direction cosine, which is most often ignored in deep learning).
Please familiarize yourself with the fundamentals of image analysis. This will greatly help you understand operations that were developed prior to the era of deep learning and are still widely used, though most often omitted from algorithmic explanations.
Thanks for the answer. I understand that spatial information is metadata in the dicom file in the same way as the “Study Instance UID”?
Hello @Wallesss,
Generally speaking the answer is yes (image position patient, image orientation patient). The 3D origin and spacings are computed from all the images that belong to the same series in a study. For further information see this well written “DICOM is easy” tutorial.