MATLAB: What values can I add to the DICOM file with DICOMWRITE

attributeattributesdatadata-dictdata-dict.txtdicomdicomwritedictionaryImage Processing Toolbox

I would like to know what values I can add to my DICOM file with DICOMWRITE.

Best Answer

DICOM files are collections of DICOM information objects, called IODs. Different IODs correspond to different types of real world medical images. For example, single-frame MR images have their own IOD, as do CT, nuclear medicine, and ultrasound images. Each IOD has a specific set of DICOM attributes that it can contain. The DICOM spec defines the set of attributes for each IOD, and only those attributes can be written to a DICOM file containing the IOD.
The DICOMWRITE function included as of version 3.2 (R13) of the Image Processing Toolbox stores "Secondary Capture" (SC) objects. Only attributes associated with the SC IOD can be used by DICOMWRITE.
Nevertheless, it is possible to pass attributes to DICOMWRITE that do not belong with the SC IOD. However, these values are ignored. For example:
status = dicomwrite(X, filename, 'SliceThickness', 16)
attempts to place the 'SliceThickness' attribute in the output file. This attribute cannot be stored in a SC DICOM image, so it is ignored.
The optional output value of DICOMWRITE gives information about parameters passed to DICOMWRITE that were ignored. The value returned is a structure with three fields corresponding to the three categories of parameters that are ignored.
(1) Some parameters don't belong with the SC IOD, 'SliceThickness' for example. This field is called 'wrong_iod'.
(2) The 'not_modifiable' field lists parameters that apply to the SC IOD but can't be modified by the users. These parameters (such as 'Columns' and 'BitsAllocated') are usually values inferred from the image.
(3) If you pass a structure of attributes from DICOMINFO to DICOMWRITE, you are also passing several special values added by DICOMINFO. These parameters are contained in 'dicominfo_fields'.