Copy and paste Dicom tag segments

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
JL
Posts: 33
Joined: Sun, 2004-11-14, 00:05
Location: US

Copy and paste Dicom tag segments

#1 Post by JL »

Hello All,
I am doing a test. I want copy a segment of dicom tag from one file and insert and replace the same segment in another dicom file.

I want to do the following:

1/ copy the tags from pixel data section and tags from private tag section from a Dicom file.
2/ Insert and replace the existing tags from pixel data section and the private tag section of the second file with the above.

I attempted to use dcmdump as the tool for the first task and dcmodify as the tool for the second task.
But the manual for dcmdump does not seem to provide an option how I can extract all the tags from (0028,xxxx) section into a file for export. In fact, I don't think I can extract a single tag into a file if I use dcmdump. What is the proper toolset to do this?

Also, it seems like dcmodify can only allow the insertion of tag line by line and not the entire segment. Is there a way to insert and replace the entire segment of pixel data tag (the way I described above)?

If the above methods are incorrect, what is/are the best way(s) to accomplish copying sections of the tags from one file to another?

Thanks in advance.
JL

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#2 Post by J. Riesmeier »

First of all, there is no concept like "section" or "segment" in DICOM datasets. Are you talking about groups (the relict from ACR/NEMA)? Most of your related questions do not really make sense to me since the "groups", e.g. (0028,xxxx), have no special meaning in DICOM.

JL
Posts: 33
Joined: Sun, 2004-11-14, 00:05
Location: US

#3 Post by JL »

[quote="J. Riesmeier"]Most of your related questions do not really make sense to me since the "groups", e.g. (0028,xxxx), have no special meaning in DICOM.[/quote]

More than likely, I used the wrong terminology. Please correct me for the use of proper name.
For pixel data, for example, I want to copy the tags with label (0028,3010) VOI LUT Sequence and its subsequence related tags (0028,3002) LUT Descriptor … to (0028,3006) LUT Data from one dicom file to another one. The reason why I want to do this is the dicom file I want to insert the LUT info into has the entire LUT segment missing. So maybe I should call this as (0028,3xxx) group instead. I want to find out how to copy these specific groups of tags from one dicom file to the other. The 2 dicom files contain the same image of the same tissue area from the same person using the same equipment around the same time frame.

However, more importantly, I want to know how I can copy groups of private tags from one file to another using available dcmtk toolset. For example I want to copy (004x,xx58) to (004x,xx72) from one file to another. The target recipient file does not have these tags in its private tag group segment.

Regards,
JL

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#4 Post by J. Riesmeier »

Copying element values from one DICOM file to another is only supported for a few specific DCMTK tools like "pdf2dcm" or "img2dcm" but not for the general ones (like "dcmodify"). Of course, it would be possible to add such an option to dcmodify, so I'll add a note to our internal to-do list.

In the meantime, you could either write a small C++ program based on the DCMTK or you could write a small script (in the language of your choice) that merges the output of "dcmdump" or "dcm2xml" and feeds the result into "dump2dcm" or "xml2dcm".

JL
Posts: 33
Joined: Sun, 2004-11-14, 00:05
Location: US

#5 Post by JL »

[quote="J. Riesmeier"] write a small C++ program based on the DCMTK".[/quote]

Thank you. Will do.
John

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest