How I create a new DicomFile

432 views
Skip to first unread message

Luis Miguel Bustamante Palacio

unread,
Mar 13, 2018, 2:51:31 PM3/13/18
to Fellow Oak DICOM
1. How can I create a new DicomFile ?

2. It is possible to use a dicom file as a template, modify data, and finally generate a new dicom file ?

What is the best way to do this ?

reini....@aon.at

unread,
Mar 16, 2018, 2:27:04 AM3/16/18
to Fellow Oak DICOM
Hi, take a look at the usage samples: https://github.com/fo-dicom/fo-dicom/#file-operations

1. to create a new DicomFile you first have to create a new DicomDataset. Then you add all the dicom tags to this DicomDataset. When you are done, then write
(new DicomFile(dcmDataset)).Save("output.dcm");

2. of course this is possible. After you have created the template dicom file you can open it, change the Dataset and save again. thats prety exactly the sample shown in the link above. But do not forget to change all UIDs (SopInstanceUid, SeriesInstanceUid, AccessionNumber, ...).

Luis Miguel Bustamante Palacio

unread,
Mar 16, 2018, 5:42:58 AM3/16/18
to Fellow Oak DICOM
Thank you very much for the information.

1. Ok, thanks.

2. Ok, thanks. I have present change all the tags.

3. How can I modify the image inside the dicom file ?

Thanks for everything.

reini....@aon.at

unread,
Mar 16, 2018, 7:50:21 AM3/16/18
to Fellow Oak DICOM
the wiki on github gives a link to a example code of how to create a dicomfile from pixel data. Please take a look at https://gist.github.com/mdubey82/4030263
You will find how to set the pixel data of a dicom image

Luis Miguel Bustamante Palacio

unread,
Mar 16, 2018, 11:46:00 AM3/16/18
to Fellow Oak DICOM
All the answers have been great.
Thanks for everything.

Reply all
Reply to author
Forward
0 new messages