What values can I add to my DICOM file with DICOMWRITE?
Show older comments
I would like to know what values I can add to my DICOM file with DICOMWRITE.
Accepted Answer
More Answers (1)
Julianna Mather
on 11 Mar 2019
0 votes
The answer from 2009 is no longer accurate. (It might not have been accurate at the time it was posted.)
In short: DICOMWRITE supports any arbitrary DICOM file that contains images. This includes much, much more than SC. Use the "CreateMode" parameter instead of the "IOD" parameter to get access to all of these information objects.
Longer answer: DICOMWRITE has two modes: Create and Copy. These are specified with the "CreateMode" name-value pair. In "Create" mode, you have to give all of the relevant metadata beyond what we can infer from the image pixels. For Secondary Capture images, there isn't anything extra that has to be given. CreateMode == Create was the way that DICOMWRITE originally worked, which is why the default result from DICOMWRITE is a Secondary Capture image. Other DICOM information objects that we can create with full validation are CT and MR.
It quickly became apparent that people wanted to write DICOM files containing many more kinds of information objects than CT, MR, and SC. For us (at MathWorks) to create that metadata from scratch--or more accurately, for us to list all of the metadata that needs to be specified and to validate it all--became prohibitively difficult and we recognized that customers wanted to make new DICOM files based on existing metadata from other files, modifying only a couple of values and the pixel data. This is when we added CreateMode == copy. This was a *really* long time ago (around 2005... maybe earlier... the years blend together). Using this parameter, every conceivable DICOM information object that stores pixel data is supported by DICOMWRITE, assuming the customer has a similar DICOM file with accurate metadata that they can use. It's worth noting that we only do minimal validation of this metadata.
Notable exceptions to "every conceivable DICOM information object that stores pixel data" are DICOM IODs that don't store pixels: radiotherapy, DICOMDIR, and structured reports. This could conceivably change in the near future.
1 Comment
Walter Roberson
on 21 Jul 2020
dicom files are binary files. you do not edit them.
can you post a link to the file? I understand that dicom files often contain private information, so it is understandable if you cannot do that, but it would make it easier for us
Categories
Find more on DICOM Format in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!