How do I add to the built-in dictionary

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
mattywix
Posts: 15
Joined: Wed, 2011-03-30, 15:31

How do I add to the built-in dictionary

#1 Post by mattywix »

Hi

i want to add entries to the default dictionary that is compiled into the library

Code: Select all

    // make sure data dictionary is loaded
    if (!dcmDataDict.isDictionaryLoaded())
    {
        ...
    }else{
         dcmDataDict.addEntry(e);
   }
Error:

Code: Select all

 error: ‘class GlobalDcmDataDictionary’ has no member named ‘addEntry’
Please advise how I can add to the builtin dictionary.

Thanks

mattywix
Posts: 15
Joined: Wed, 2011-03-30, 15:31

#2 Post by mattywix »

Also, once Ive added the entry, can I delete or free all the items that were passed in as below? Does the dictionary make a copy and manage that?

Code: Select all

DcmDictEntry* e = new DcmDictEntry(
                       key.getGroup(), key.getElement(),
                       upperKey.getGroup(), upperKey.getElement(),
                       vr, tagName, vmMin, vmMax, standardVersion, OFTrue,
                       privCreator);

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#3 Post by Jörg Riesmeier »

You need an exclusive lock on the global dictionary:

Code: Select all

DcmDataDictionary &dict = dcmDataDict.wrlock(); 
dict.addEntry(new DcmDictEntry(...)); 
dcmDataDict.unlock();

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Read the API documentation of addEntry() :-)

mattywix
Posts: 15
Joined: Wed, 2011-03-30, 15:31

#5 Post by mattywix »

Thanks :D

Post Reply

Who is online

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