dicominfo fails to read in all the information from a dicom file that has private fields but dicomdisp shows the information.

11 次查看(过去 30 天)
There is a field that is displayed using dicomdisp:
0001962 0 (7FE0,0010) OW 2326528 bytes - PixelData
but is dropped when using dicominfo. This appears to due to private tags. I need to obtain the information in that PixalData field, and I certainly use the offset value in the front, to know where the data starts. Is there a means of having the dicomdisp directed to a file instead of being displayed?
Only the first image is displayed by dicom views, and also in Matlab, so I need to load the dicom file in a binary file, then using the dicom information, load in the images into a 3D array, in this particular case, 2 byte - 128x128 frame size and 71 slices. The issue is that I am not guaranteed that PixelData will be the same size for all the different dicom files, therefore I need to be able to read the PixelData field.
Thank you in advance
PF
  3 个评论
Patrick Ford
Patrick Ford 2023-4-26
The format of the dicom files is atypical for most applicatons that read dicom files. MatLab uses NumberofFrames and while this uses NumberofSlices, There is something about the files that causes dicominfo to drop the last field and dicomread only brings in the first of the 71 images(aka slices). Examples enclosed.

请先登录,再进行评论。

回答(1 个)

Garmit Pant
Garmit Pant 2023-9-26
Hello Patrick
I understand that you are trying to read images from a dicom file. The MATLAB function ‘dicominfo’ reads the metadata but when it encounters a private metadata field, the function attempts to read and interpret the data if it can.
You can use the functions from the following File Exchange submission to read all the fields of the metadata of a dicom file:
Use the ‘ReadDicomElementList()’ function to get all the fields of the metadata. Refer to the following code snippet to read and add the field ‘PixelData’ to the structure created using ‘dicominfo’:
info = dicominfo('_Scs_resL_Ti.dicom') % Creates a struct with all the no-private fields
Elements = ReadDicomElementList('_Scs_resL_Ti_1.dicom'); % Reads all the fields of the dicomf file
a = Elements(end) % Access the field ‘PixelData’
info.('PixelData') = a.data % Create a new field ‘PixelData’ in the original struct
This will enable you to use the data in the ‘PixelData’ field.
For further understanding, refer to the following MATLAB Documentation:
  1. https://www.mathworks.com/help/images/ref/dicominfo.html
  2. https://www.mathworks.com/help/images/read-metadata-from-dicom-files.html
  3. https://www.mathworks.com/help/images/ref/dicomread.html
I hope this helps!
Best Regards
Garmit

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by