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

조회 수: 12 (최근 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.
Rik
Rik 2023년 4월 26일
I don't have time to test myself, but you can try using this FEX submission to read the raw DICOM tags. Perhaps that will help you get the data out.

댓글을 달려면 로그인하십시오.

답변 (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