I'm trying to write out a dicom file with metadata using the Dicomwrite function.
dicomwrite(image, 'newimage.dcm', metadata)
However, I get the error below, indicating MATLAB does not support this particular IOD class (1.2.840.10008.5.1.4.1.1.77.1.5.4, Ophthalmic Tomography Class). Is there a way to work around this? Thanks.
Error Message:
??? Error using ==> dicomwrite>write_message at 253
Unimplemented IOD (1.2.840.10008.5.1.4.1.1.77.1.5.4)
Error in ==> dicomwrite at 195
status = write_message(X, filename, map, metadata, options);
It's true that DICOMWRITE does not support writing ophthalmic tomography images from scratch, but I see that you've already got some metadata to pass to the function. If that includes the required metadata from another ophthalmic tomography DICOM file, you'll probably be okay writing a new file using a value of 'copy' for 'CreateMode'. For example:
dicomwrite(image, 'newimage.dcm', metadata, 'createmode', 'copy')
Jeff Mather
Image Processing Group
MathWorks
Thank you for your help. I tried your suggestion below and it didn't complain about the IOD class, but I did get another error (see below). When I look at the DICOM metadata, the Photometric Interpretation is set to 'MONOCHROME2'. Any help would be much appreciated. Thanks.
??? Error using ==> dicom_prep_ImagePixel>getPhotometricInterp at 98
Cannot determine photometric interpretation.
Error in ==> dicom_prep_ImagePixel at 10
metadata.(dicom_name_lookup('0028', '0004')) = getPhotometricInterp(X, map, txfr);
Error in ==> dicom_copy_IOD at 31
metadata = dicom_prep_ImagePixel(metadata, X, map, options.txfr);
Error in ==> dicomwrite>write_message at 241
[attrs, msg, status] = dicom_copy_IOD(X(:,:,:,p), map, ...
Error in ==> dicomwrite at 195
status = write_message(X, filename, map, metadata, options);
"Jeff Mather" <jeff....@mathworks.com> wrote in message <ig7fc6$e16$1...@fred.mathworks.com>...