After extracting information out of a radiation therapy plan stored as a DICOM-File, my issue is now a different one.
I know, that I can add or update items in an existing plan with (e.g.)
file.Dataset.AddOrUpdate(Dicom.DicomTag.PatientAge,23);
Even handling DicomTags in a sequence is not the problem with (e.g.)
file.Dataset.Get<Dicom.DicomSequence>(Dicom.DicomTag.BeamSequence).Items[1].
Get<Dicom.DicomSequence>(Dicom.DicomTag.ControlPointSequence).Items[0].
Get<Dicom.DicomSequence>(Dicom.DicomTag.BeamLimitingDevicePositionSequence).Items[2].
AddOrUpdate(Dicom.DicomTag.LeafJawPositions, "-30\\30");
But now I am wondering if it is possible to create a complete new sequence and store information in it? I know that wanting this forces me to create not only one item, but much more information arround this item, cause there is no sequence in the plans I looked through which have this.
In the fo-dicom API documentation I found the Dicom.IO.Writer
Namespace. I looked through but didn't find what i expected to find. Following my first instinct, I would have written this
string filename = "output.dcm";
DicomWriter file = new DicomWriter(@filename);
... trying to create TagElements
Also the other command line DicomFileWriter file = new DicomFileWriter(...);
doesn't work because the constructor only wants to receive options. The other DicomWriter()
constructor is similar to this.
I also checked the file.Dataset
possibilities for writing new tags, but without succes. So I hope one of you can give me a hint where I did a wrong step.