Hi
I would like to know what is the best way to read all the tag of a dicom file. O would like to read the tag and display the value in a visual interface. Is it possible to read at the same time Tag containning string, unsigned number, date float number etc
Thank you
Best way to read dicom file
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi,
you should use the API of DcmItem (accessible here), especially the findAndGetOFStringArray() which works for most DICOM data types (value representations): AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OF, OW, PN, SH, SL, SS, ST, TM, UI, UL, US, UT.
A list of all value representations (VRs) can be found in the DICOM standard, part 5. Especially for some numeric VRs you will have to use other member functions of DcmItem, e. g. findAndGetSint32() to get a numeric representation of the element value and to do the string conversion yourself.
Regards,
Michael
you should use the API of DcmItem (accessible here), especially the findAndGetOFStringArray() which works for most DICOM data types (value representations): AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OF, OW, PN, SH, SL, SS, ST, TM, UI, UL, US, UT.
A list of all value representations (VRs) can be found in the DICOM standard, part 5. Especially for some numeric VRs you will have to use other member functions of DcmItem, e. g. findAndGetSint32() to get a numeric representation of the element value and to do the string conversion yourself.
Regards,
Michael
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi Geof,
I am sorry, I do not understand the question...
Contour data is saved in DICOM attributes (tags), too. So you can access them like other data with the API functions mentioned above. For most data types (and so for most tags) you can use the findAndGetOFSTringArray method, for some numeric data types you have to choose an appropriate one. So you always have to look at the elements VR first, before accessing its value.
If you want to iterate over all elements of a dataset (in cases you don't know, what will be the next tag you want to look at), you can use DcmItem's nextObject() method or (not that good) getElement().
Regards,
Michael
I am sorry, I do not understand the question...
Contour data is saved in DICOM attributes (tags), too. So you can access them like other data with the API functions mentioned above. For most data types (and so for most tags) you can use the findAndGetOFSTringArray method, for some numeric data types you have to choose an appropriate one. So you always have to look at the elements VR first, before accessing its value.
If you want to iterate over all elements of a dataset (in cases you don't know, what will be the next tag you want to look at), you can use DcmItem's nextObject() method or (not that good) getElement().
Regards,
Michael
Who is online
Users browsing this forum: Google [Bot] and 1 guest