Modify DICOM elements without modifying PixelData
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am writing a program that reads in DICOM images, modifies elements of the header so they will be regrouped in our PACS, and writes that back out as a new file. The problem I am encountering is that the writing of the new file causes the pixel data to be recompressed, resulting in a difference from the original. Here's a simple example:
metadata = dicominfo('MyDICOM.dcm');
X = dicomread(metadata);
% Maybe modify some header elements here
dicomwrite(X, 'MyDICOM_new.dcm', metadata, 'createmode', 'copy', 'WritePrivate', true);
X2 = dicomread('MyDICOM_new.dcm');
imshowpair(X, X2, 'diff');
I was expecting the two images to be identical, but they are different (I believe they are JPEG compression differences).
I also tried the dicomanon() function, but it also seems to recompress the image data. In my code I played with changing the new file format to be uncompressed by using a different TransferSyntax, but my multi-frame images exploded in size.
How can I modify DICOM header elements without causing the pixel data to change?
Thank you.
2 comentarios
Yoichi Watanabe
el 29 de Jun. de 2019
Scott,
you posted your question a long time. Have you found an answer to your question? If so, I want to know the solution. I am having the same issue. I am trying to anonymize Dicom CT data written in 12 bits. thanks.
Respuestas (2)
John
el 29 de Jul. de 2014
Hi Scott,
MATLAB's Image Processing Toolbox has a superbly decked out DICOM handling component.
I do not have any DICOMs on hand but have had this issue before and found out that using 'dicomwrite' with the 'CompressionMode' name-value pair setting with one of the lossless compression settings worked. The documentation for 2014a has this name-value pair, I am not sure about the earlier releases though.
These days though, with GBs costing pennies, consider using no compression at all :-).
John
el 30 de Jul. de 2014
You could use the Grass roots dicom tools (GDCM). It is a well documented collection of tools.
0 comentarios
Ver también
Categorías
Más información sobre DICOM Format en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!