Adding Field to DICOM Header when "ObjectType" is "CT Image Storage"

4 views (last 30 days)
Hi,
(I apologize in advance if my tone is a little curt. I've been struggling with this for over two hours, read all of the documentation and other questions about dicomwrite and nothing seems to be working!)
I have been attempting for a while now to add DICOM-supported fields to a header using many variations of the following command:
dicomwrite(someimg,'testfile.dcm',headerdata,'ObjectType','CT Image Storage')
Headerdata contains the following :
headerdata.TablePosition
headerdata.SliceThickness
headerdata.ReconstructionDiameter
dicomwrite does return a non-empty status structure for MissingData, however all fields listed are
'(0028,0030)'
'(0020,0037)'
'(0020,0032)'
'(0008,0008)'
'(0028,1052)'
'(0028,1053)'
which do not have any direct relationship to the fields I'm trying to write. I feel like this is a bug though since according to the documentation, the default 'CreateMode' is 'Create' in which case MATLAB will "verify input values and generate missing data."
The headerdata fields I'm trying to add are fields that are 100% supported by the DICOM standard as far as I understand, however every time I write the file, they are ignored. If I change 'CreateMode' to 'copy' the fields are written to the file with proper tags (verified using a hex editor).
While this will get the job done, it's not ideal since I indeed would like MATLAB to verify my data, find any missing values, and generate them if needed. I also don't want to risk reusing UIDs (it's unclear from the documentation what, if any would or would not be reused with 'createmode','copy') from the dummy file that I get the rest of the header data from when using 'copy'.
If I'm missing something that would get these fields written into a file, I'd love some help figuring out what that is in order to get this data written.
If not, then is there a reason MATLAB does not support this in the way that appears to be indicated in the documentation?
Either way, my feedback for MathWorks would be that the documentation for this function, specifically with regards to modifying/adding/removing header data and what MATLAB does and doesn't support in this realm is a little confusing and maybe incomplete.
Thanks for any help you can provide. You have no idea how much I will appreciate it!
Best, John H

Answers (0)

Categories

Find more on DICOM Format in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!