Reading private sequences
Moderator: Moderator Team
Reading private sequences
Hi all,
I am trying to find / resolve the number of the private code meaning to open a sequence with group, element code 2005,140F. My dictionary contains:
(2005,"Philips MR Imaging DD 005",0F) SQ Philips MR Imaging Private Sequence 1
As you can see the number ‘14’ is not part of the dictionary, because it might be different for every file.
The following piece of code is clearly missing something, because found becomes false
DcmTag dcmTag ("Philips MR Imaging DD 005", 0x2005, 0x0F);
DcmItem* dataset (GetDataset (dcmTag));
bool found = dataset->tagExists (dcmTag);
But in the following code, found becomes true (here the number 14 is entered before 0F in the dcmTag constructor as element value)
DcmTag dcmTag ("Philips MR Imaging DD 005", 0x2005, 0x140F);
DcmItem* dataset (GetDataset (dcmTag));
bool found = dataset->tagExists (dcmTag);
Hardcoding the value to 0x140F from 0x0F is not an option: it should be derived from "Philips MR Imaging DD 005", 0x2005, 0x0F
I hope that someone can help me.
I am trying to find / resolve the number of the private code meaning to open a sequence with group, element code 2005,140F. My dictionary contains:
(2005,"Philips MR Imaging DD 005",0F) SQ Philips MR Imaging Private Sequence 1
As you can see the number ‘14’ is not part of the dictionary, because it might be different for every file.
The following piece of code is clearly missing something, because found becomes false
DcmTag dcmTag ("Philips MR Imaging DD 005", 0x2005, 0x0F);
DcmItem* dataset (GetDataset (dcmTag));
bool found = dataset->tagExists (dcmTag);
But in the following code, found becomes true (here the number 14 is entered before 0F in the dcmTag constructor as element value)
DcmTag dcmTag ("Philips MR Imaging DD 005", 0x2005, 0x140F);
DcmItem* dataset (GetDataset (dcmTag));
bool found = dataset->tagExists (dcmTag);
Hardcoding the value to 0x140F from 0x0F is not an option: it should be derived from "Philips MR Imaging DD 005", 0x2005, 0x0F
I hope that someone can help me.
-
- DCMTK Developer
- Posts: 2501
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Reading private sequences
This is just a wild guess but... the method DcmItem::tagsExists() takes a DcmTagKey as the first parameter, which does not know anything about the Private Creator string
Re: Reading private sequences
Indeed. Therefore the value (i.e. the element number) must be resolved before checking if the tag exists. My question is: does DcmTk have methods to resolve this?
I.e. how to go from 0x2005,0x0F to 0x2005,0x140F using the private creator string with DcmTk?
I.e. how to go from 0x2005,0x0F to 0x2005,0x140F using the private creator string with DcmTk?
-
- OFFIS DICOM Team
- Posts: 1437
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: Reading private sequences
There is no simple call to do what you want. You will indeed have to first iterate over the reservation elements (GGGG,00xx) to find the element with the reservation string representing "your" private group, and based on the tag of that reservation element determine the tag range of your private elements, i.e. (GGGG,xxyy).
It would perhaps be nice to have a method that would search by private reservation string within a given group GGGG, and return the tag range xx00, but that simply isn't there.
It would perhaps be nice to have a method that would search by private reservation string within a given group GGGG, and return the tag range xx00, but that simply isn't there.
Re: Reading private sequences
BTW: I noticed a bug in DcmTag class
The following constructor does a vr lookup which requires a privateCreator. But the creator is NULL
DcmTag::DcmTag(Uint16 g, Uint16 e)
: DcmTagKey(g, e),
vr(EVR_UNKNOWN),
tagName(NULL),
privateCreator(NULL),
errorFlag(EC_InvalidTag)
{
lookupVRinDictionary();//this method requires a correct privateCreator otherwise the outcome is random
}
Please add a proper constructor with extra argument the private creator. I.e.:
DcmTag::DcmTag(Uint16 g, Uint16 e, char* privateCreatorCode)
: DcmTagKey(g, e),
vr(EVR_UNKNOWN),
tagName(NULL),
privateCreator(privateCreatorCode),
errorFlag(EC_InvalidTag)
{
lookupVRinDictionary();//would result in a proper VR lookup now
}
The following constructor does a vr lookup which requires a privateCreator. But the creator is NULL
DcmTag::DcmTag(Uint16 g, Uint16 e)
: DcmTagKey(g, e),
vr(EVR_UNKNOWN),
tagName(NULL),
privateCreator(NULL),
errorFlag(EC_InvalidTag)
{
lookupVRinDictionary();//this method requires a correct privateCreator otherwise the outcome is random
}
Please add a proper constructor with extra argument the private creator. I.e.:
DcmTag::DcmTag(Uint16 g, Uint16 e, char* privateCreatorCode)
: DcmTagKey(g, e),
vr(EVR_UNKNOWN),
tagName(NULL),
privateCreator(privateCreatorCode),
errorFlag(EC_InvalidTag)
{
lookupVRinDictionary();//would result in a proper VR lookup now
}
-
- DCMTK Developer
- Posts: 2501
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Reading private sequences
Thank you for the report but this has already been done (more than five years ago): http://git.dcmtk.org/?p=dcmtk.git;a=com ... 7283763458
Re: Reading private sequences
Sorry, I noticed that we have version 3.6 and not 3.6.1 which contains the fix
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest