I am implementing Ultrsound DICOM files with special tags for a new ultrasound device.
I am able to save teh private elemtns since DVTK DCMView can see the Tags
(0x00290010,LO , "EiGENMedicalLLC ") # : private mapped to (0029,00FF)
(0x00291001,LO , "121212") # : private mapped to (0029,FF01)
(0x00291002,LO , "343434") # : private mapped to (0029,FF02)
But every time I try to read the private elements back teh ODCondition is TagNotFound.
I read the other entries about adding these to the dictionary so in my class Init functions I have
OFCondition ofCond = m_Dataset->putAndInsertString(DcmTag(s_PrivateGroup,0x0010),cpPrivateCreator);
if(!ofCond.good())
{
printf("Unable to Reserve Private DICOm Tags\n");
}
DcmDataDictionary& dcmModDictionary = dcmDataDict.wrlock();
dcmModDictionary.addEntry(new DcmDictEntry(s_PrivateGroup,0x1001,EVR_LO,"EigPatientID",1,1,NULL,OFTrue,cpPrivateCreator));
dcmModDictionary.addEntry(new DcmDictEntry(s_PrivateGroup,0x1002,EVR_LO,"EigProcID",1,1,NULL,OFTrue,cpPrivateCreator));
dcmModDictionary.addEntry(new DcmDictEntry(s_PrivateGroup,0xFF01,EVR_LO,"EigPatientIDFF",1,1,NULL,OFTrue,cpPrivateCreator));
dcmModDictionary.addEntry(new DcmDictEntry(s_PrivateGroup,0xFF02,EVR_LO,"EigProcIDFF",1,1,NULL,OFTrue,cpPrivateCreator));
dcmDataDict.unlock();
Add in my member function that tries to retrieve the private element after the DcmFileFormat->LoadFile
const DcmDataDictionary& dcmModDictionary = dcmDataDict.rdlock();
int iEntries = dcmModDictionary.numberOfEntries();
const DcmDictEntry * dcmPrivEntry = dcmModDictionary.findEntry(DCM_EIG_PatientID,cpPrivateCreator);
and the DcmDictEntry has the corrent private tag
0029,1001
But always I have ECC_TagNotFound for pDataSet->FindAndGetElement
Does anyone have any suggestions ?
I thank you for any help in resolving this issue.
Problem Reading Back private Tags
Moderator: Moderator Team
More Information I Find 0x0029,0x0010
Using the Code Below I am able to find the 0x0029,0x0010 Private Tag
But I still can not find any of the other private tags that I know are in the file .
DcmDataset * pDataSet = m_Fileformat->getDataset();
for ( int iElem = 0; iElem < 0xffff; iElem++)
{
ofCond = pDataSet->findAndGetElement(DcmTagKey(s_PrivateGroup,iElem),dcmEigenPatientID,OFTrue);
if(ofCond.good())
{
bReturn = true;
}
}
When I place a break on bReturn = true;
only when iElem == 0x10 do I break, otherwise I recieve nothing else
for the other two private tags that DcmView says are located in the file.
Again help on this issue would be appreciated.
But I still can not find any of the other private tags that I know are in the file .
DcmDataset * pDataSet = m_Fileformat->getDataset();
for ( int iElem = 0; iElem < 0xffff; iElem++)
{
ofCond = pDataSet->findAndGetElement(DcmTagKey(s_PrivateGroup,iElem),dcmEigenPatientID,OFTrue);
if(ofCond.good())
{
bReturn = true;
}
}
When I place a break on bReturn = true;
only when iElem == 0x10 do I break, otherwise I recieve nothing else
for the other two private tags that DcmView says are located in the file.
Again help on this issue would be appreciated.
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
The findAndGetElement() method works independently from the dictionary. Having the private tags in the data dictionary is needed only for the case that a file or dataset containing "your" private tags is read in Implicit VR. In that case the VRs of the private tags are looked up in the dictionary. If they are not present, the private attributes are interpreted as "UN". In any case, after reading the dataset, you can find them with findAndGetElement(). If findAndGetElement does not find them, they are most likely not in the dataset (or maybe "hidden" in some sequence). Use dcmdump to check if the tags are really there.
Situation Resolved
I am not sure how I messed this up, but I am able to use the findAndGetElement functionality. My biggest problem still appears to be between my ears, and misunderstanding some of the functionality that is provided by the DCMTK.
I have solved this particular issue, again by using local instantiation of the tags and search results, to force the DCMTK classes to "reset", re-initialize themselves, so that multiple searches, findAndGetElements etc always start with a clean slate.
I have solved this particular issue, again by using local instantiation of the tags and search results, to force the DCMTK classes to "reset", re-initialize themselves, so that multiple searches, findAndGetElements etc always start with a clean slate.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest