Why does the DICOMWRITE function in the Image Processing Toolbox create a new SOPInstanceUID for my DICOMATLAB file, when I set the 'CreateMode' option to 'Copy'?
6 views (last 30 days)
Show older comments
I am trying to create a DICOMATLAB file with the same header information as another DICOMATLAB file that I have. When I use DICOMWRITE and pass the metadata array corresponding to my other DICOMATLAB file (obtained from DICOMINFO) with the 'CreateMode' option set to 'Copy', all the header information matches up except for SOPInstanceUID and MediaStorageSOPInstanceUID.
Accepted Answer
MathWorks Support Team
on 5 Aug 2010
This is the appropriate behavior for the DICOMWRITE function. The UID in SOPInstanceUID stands for "unique identifier". When DICOMWRITE is used to input new image data to a DICOM file, the new file should contain a different UID than the original file, even when other metadata is copied.
There is a workaround which requires modifying an MATLAB file in the Image Processing Toolbox. The steps are as follows:
1. Change the MATLAB working directory to $MATLABROOT\toolbox\images\images\private, where $MATLABROOT is the MATLAB root directory.
2. At the MATLAB command line, enter the following:
edit dicom_prep_SOPCommon
3. Comment out the following line:
metadata.(dicom_name_lookup('0008', '0018')) = dicomuid;
This workaround prevents a new UID from being generated for the created DICOMATLAB file.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!