Hi everyone!
I managed to edit and add new contours to the metadata of the dicomfile.
I used dicominfo to edit the data
(e.g.info.ROIContourSequence.(NewItem).ReferencedROINumber = NumberOfROIs; %adapting the refROINumber in a loop)
and dicomwrite to save the altered data to a new file.
(e.g. dicomwrite([ ],[inputnewfilename '.dcm'], info, 'CreateMode', 'Copy') )
So far, so good...
A problem occurs when I try to import the new generated file back to the treatment planning system. It cannot read it ("file is not a dicomfile"?!) or complains that something's wrong with it. I suppose that the default image data dicomwrite is saving to it (e.g. Width=0, Height=0, BitDepth=16... instead of [ ]) is confusing the system, so that it cannot recognize it as structure-file.
I really need your help. Do you know how one can change this default values?
Thanks in advance!