Iterate throught tags

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
hieuhoang
Posts: 3
Joined: Tue, 2005-07-05, 12:14

Iterate throught tags

#1 Post by hieuhoang »

hiya all,

Is there a way to iterate through all tags in a DICOM file and get the tag id and value (as a string, for isntance) ?

i've looked at the code for dcmdump which prints out all tags, but the print() uses internal variable to the DcmDataset and DcmFileInfo class.

thx in advance

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

#2 Post by Marco Eichelberg »

You can use either DcmItem::getElement() or DcmItem::nextObject() for this purpose. See dcmdata/include/dcitem.h for declaration, parameters etc.

hieuhoang
Posts: 3
Joined: Tue, 2005-07-05, 12:14

#3 Post by hieuhoang »

thx,

found the link to this code frag, which was useful:

http://groups.google.com/group/comp.pro ... bbf5b91d0f

i get the string value from each tag but this breaks when it encounters FFFE, E000 (sequence tags)

is there a way to iterate throught the tags and avoid problems like this?

Post Reply

Who is online

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