Hi
Is there any utility avaialble in DCMTK for DICOM translation of images. Suppose i have the tag values and pixel data of certain non- DICOM image. How can I create a DICOM formatted image out of that. Which Application in DCMTK I can model upon for this.
I have tried doing this by using dcmodify after creation of a template with the utility dump2dcm. After template is ready I use dcmodify application to create a new copy of the template with new values in it. Is this the right approach. But here I am finding it difficult to handle pixel data which is very large. Can anybody help me out in this problem.
how can we create DICOM format image from pixel data & tags
Moderator: Moderator Team
-
- Posts: 19
- Joined: Wed, 2005-02-09, 08:44
-
- OFFIS DICOM Team
- Posts: 1447
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
See FAQ #34. Using dump2dcm and dcmodify is possible but, as you noted, everything but ideal. In particular, there is no way to generate new UIDs. Basically, you will have to create you own application for this purpose. I would use pdf2dcm as a model, because this tool is doing something related, converting a PDF document into a DICOM SOP instance.
-
- DCMTK Developer
- Posts: 2052
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
A minor addition:
With DCMTK 3.5.4, there are some new UID options for dcmodify, that allow to generate new Study, Series and SOP Instance UIDs automatically. So this part of the problem could be solved using dcmodify.
Concerning your problems with large pixel data values: Did you noticed the +W option of dcmdump? It writes pixel data to a separate file and inserts a reference to this file into the dump; dump2dcm resolves this file refererence when converting a dump to DICOM and inserts the pixel data from the referenced file. See dcmdump and dump2dcm manpages for explanations and syntax.
But finally writing your own small application will be a much better solution;-)
Regards,
Michael
With DCMTK 3.5.4, there are some new UID options for dcmodify, that allow to generate new Study, Series and SOP Instance UIDs automatically. So this part of the problem could be solved using dcmodify.
Concerning your problems with large pixel data values: Did you noticed the +W option of dcmdump? It writes pixel data to a separate file and inserts a reference to this file into the dump; dump2dcm resolves this file refererence when converting a dump to DICOM and inserts the pixel data from the referenced file. See dcmdump and dump2dcm manpages for explanations and syntax.
But finally writing your own small application will be a much better solution;-)
Regards,
Michael
using dcmdump and dump2dcm to anonymize
here is an autohotkey script to do it
Code: Select all
runwait, dcmdump +W . in.dcm
FileAppend,
(
(0010,0010) PN [] # PatientsName
(0010,0020) LO [] # PatientID
(0020,000d) UI [] # 54, 1 StudyID
(0020,000d) UI [] # 50, 1 StudyInstanceUID
(0020,000e) UI [] # 38, 1 SeriesInstanceUID
(0008,0050) SH [] # 14, 1 AccessionNumber
(0008,0060) CS [] # 2, 1 Modality
(0008,0018) UI [] #
(7fe0,0010) OW =.\in.dcm.0.raw # PixelData
), header.txt
runwait, dump2dcm -v header.txt out.dcm
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest