How do I use dicomwrite to specify Photometri​cInterpret​ation metadata?

6 visualizaciones (últimos 30 días)
Felix
Felix el 11 de Mzo. de 2011
Respondida: UDAYA PEDDIRAJU el 3 de En. de 2025
Hi,
I am attempting to write a dicom file with PhotometricInterpretation set to MONOCHROME1 instead of MONOCHROME2, but no matter how I try it always writes the tag with MONOCHROME2. I've tried editing the metadata, using CreateMode 'copy', inputting 'MONOCHROME1' as a parameter, and various combinations.
Is it impossible to edit this dicom tag while writing a dicom file with dicomwrite?
Thank you.

Respuestas (1)

UDAYA PEDDIRAJU
UDAYA PEDDIRAJU el 3 de En. de 2025
Hi Felix,
To specify the "PhotometricInterpretation" metadata when using "dicomwrite", you can include it in the metadata structure that you pass to the function. Here's an example of how to set "PhotometricInterpretation" to "MONOCHROME1":
% Sample image data
imageData = rand(256, 256); % Example grayscale image
% Create metadata structure
metadata = struct();
metadata.PhotometricInterpretation = 'MONOCHROME1'; % Set to MONOCHROME1
% Write DICOM file
dicomwrite(imageData, 'output.dcm', metadata);
Make sure that the image data is compatible with the specified photometric interpretation. If the image is grayscale, "MONOCHROME1" and "MONOCHROME2" should be appropriate, but the actual pixel values should also reflect the intended interpretation.
If you continue to experience issues with "dicomwrite" defaulting to "MONOCHROME2", ensure that your image data and other metadata are correctly set up, as some "DICOM" viewers may interpret the data differently based on the pixel values.

Categorías

Más información sobre DICOM Format en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by