DICOM header modification

Hi,

After browsing the documentation and checking a similar forum post, I’m still unsure if it is possible to modify the header info within a DICOM file. Reading the header entries works fine, though each has its tag name and value concatenated to a single string. On the other hand I couldn’t add, remove or modify any of those entries. If I were to make a change in say the “Patient’s Name” on the List<string> provided through DicomInfo, the list element itself retains the new value, but as soon as I save the whole file, everything is just as it was before (i.e. no changes written to the file).

Therefore my questions would be:
1.) Is there any way to write the header entries in DICOM files (modify, add, remove)?
2.) Can header entry components be queried separately (tag name, value and the raw ID)?

Attached, you can find a sample project, which tries to do exactly the above.

Thanks in advance for your support!

headerInfo.zip (189.7 KB)

@psimon, we will investigate your question and answer.

@psimon Thank you for contacting us. We appreciate your interest in our product and would like to provide you with the best possible assistance.

Regarding your request for Dicom tags, we have created a ticket for you with ID IMAGINGNET-6313. You will be notified as soon as it is completed.

As of now, it is only possible to read existing Dicom tags, add new tags, or replace tags entirely using the following snippets. To add new tags, you can use the following code:

XmpPacketWrapper xmp = new XmpPacketWrapper();
DicomPackage dicomPackage = new DicomPackage();
dicomPackage.SetPatientName("John Doe Jr.");
xmp.AddPackage(dicomPackage);
image.XmpData = xmp;

To replace tags entirely with new ones, you can use the following code:

XmpPacketWrapper xmp = new XmpPacketWrapper();
DicomPackage dicomPackage = new DicomPackage();
dicomPackage.SetPatientName("John Doe Jr.");
xmp.AddPackage(dicomPackage);
image.Save("changedName.dcm", new DicomOptions() { XmpData = xmp });

Please note that our team is continuously working to enhance our product and add new features. If you have any further questions or concerns, please do not hesitate to contact us. We are always here to help you.

@psimon
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): IMAGINGNET-6313

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.