how can we create DICOM format image from pixel data & tags

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
deepujames
Posts: 19
Joined: Wed, 2005-02-09, 08:44

how can we create DICOM format image from pixel data & tags

#1 Post by deepujames »

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.

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1435
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

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.

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

#3 Post by Michael Onken »

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

tinku99
Posts: 4
Joined: Thu, 2009-08-20, 04:21
Contact:

using dcmdump and dump2dcm to anonymize

#4 Post by tinku99 »

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 

Post Reply

Who is online

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