Reading and re-writing a Dicom file (header) with private tags

26 visualizaciones (últimos 30 días)
Zubin
Zubin el 20 de Nov. de 2022
Movida: Walter Roberson el 25 de Jul. de 2024
I have an RT ION dicom plan file which has a big nested header file with a lot of private tags.
I have opened the header file and processed everything I need to process and want to write it back into an updated DICOM RT plan file.
The plan file writes back. However, all the private or unknown tags that are not in the DICOM dictionary (dicom-dict.txt file) get read and re-written with a Private_ prefix e.g. Private_0300_0309 and the values under these tags is usually garbled.
Things I've tried so far:
  1. I just let the private tags stay in as they are but then my re-written file has trouble being read again by the planning system I want to re-send, so that's a no go.
  2. I have all the information about the type of these DICOM tags (VR, VM, etc) and I have added a few of them to the dicom-dict.txt file but it makes no difference, and they still get read as private_ tags and get re-written as private tags.
  3. I have tried using the 'wiriteprivate' modifier with dicomwrite but it doesn't help because the tags are probably still showing up as private tags.
(dicomwrite([], FNnew, DICinfo, 'CreateMode', 'copy' , 'WritePrivate', true)
Is there any way to manually change the name of the tag/variable and assign the correct values or something? I can read the garbled values under these private tags using the char function on the transpose of the value. eg. char(variable') but there's not much I can do with that information unless I can re-write the name of the variable/tag and remove the private_ prefix of the tag name.
Or is there something I'm missing with teh dicom-dict.txt file? Do I need to force matlab to refresh or read it, or check if my additional tags in the dicom-dict.txt file have been read and accepted properly?
I've already spent a lot of time looking for a solution and I feel like a solution is right around the corner but I can't figure it out.
Any help would be greatly appreciated.

Respuesta aceptada

Zubin
Zubin el 25 de Jul. de 2024
Movida: Walter Roberson el 25 de Jul. de 2024
Yes from what I remember, it was an issue with the way I was updating the dicom-dict.txt. For some reason, Matlab was not loading the changes I had put in the original DICOM-dict.txt and didn't have the detailed information of the private tags, to write them correctly in the outputted DICOM file.
What I did was I created a copy of the dicom-dict.txt and added all the necessary tags to it, and I would load it up each time in my script. Something like:
dicomdict('set','C:\Users\User\Documents\MATLAB\dicom-dict_custom.txt');
That solved my issue and it could then write the dicom tags properly to the output dicom file.
Hope it helps.

Más respuestas (0)

Categorías

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

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by