question abgout writing DICOM files

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
xargon
Posts: 15
Joined: Mon, 2007-04-30, 13:16

question abgout writing DICOM files

#1 Post by xargon »

Hi everyone,

I have a question about writing DICOM files. What I have is a DICOM volume that I segment. I want to write the result as another DICOM volume and what I was thinking was cloning the original DICOM volume and then simply changing some data fields like SeriesUID, description etc.. (whatever is needed to make it a unique volume) and then also, of course, changing the pixel data...

Does anyone have any example on how to do something like this?

Thanks,
Anja

Michael Onken
DCMTK Developer
Posts: 2052
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi Anja,

this seems to be a very unspecific question. In most cases, it is a bad idea to just copy a DICOM file (or a complete series) and to then customize it because it is quite likely that you will forget to change some attributes according to the new image data. Private attributes should be deleted completely, because you don't know whats exactly in there.

However, if you really want to copy the file and change some values, you could use class DcmFileFormat to read the file and then modify attributes by using DcmItem API. After modifying, save to a different filename (DcmFileFormat). A simple example of the different steps can be found here.

Also look into the many example application's source in DCMTK to learn how to use DCMTK for different tasks.

Regards,
Michael

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest