Hi!
I want to replace an image of an dicom file for an image of other dicom file.
After opening both files, _file1 and _file2, what I'm doing is:
DicomFile new_dicom = _file1;
DicomImage img = new DicomImage(_file1.Dataset);
new_dicom.Dataset.Remove(DicomTag.PixelData);
new_dicom.Dataset.Add(DicomTag.PixelData, img.PixelData);
new_dicom.Save("newfile.dcm");
For some reason, the program stops at line 5 (...Add(DicomTag.PixelData...)
What am I doing wrong?
Comments and suggestions are welcome.
Thank you.