DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Thu, 2018-04-26, 22:07

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat, 2016-01-02, 21:03 
Offline

Joined: Tue, 2015-11-03, 14:40
Posts: 29
Hi guys,

My application uses the following example code to read DICOM files:

Code:
DcmFileFormat fileformat;
OFCondition status = fileformat.loadFile("test.dcm");
if (status.good())
{
  OFString patientName;
  if (fileformat.getDataset()->findAndGetOFString(DCM_PatientName, patientName).good())
  {
    cout << "Patient's Name: " << patientName << endl;
  } else
    cerr << "Error: cannot access Patient's Name!" << endl;
} else
  cerr << "Error: cannot read DICOM file (" << status.text() << ")" << endl;


I want to load dicom.dic and private.dic before loading the DICOM file. How can I do this?

I found the following (for private tags only I guess???) code on Stack Overflow, but I am not sure if I should put this before my code:

Code:
DcmDataDictionary& dict = dcmDataDict.wrlock();
dict.loadDictionary(dictionaryFilePath);
dcmDataDict.unlock();


Top
 Profile  
 
PostPosted: Tue, 2016-01-05, 12:00 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1928
Location: Oldenburg, Germany
Quote:
I want to load dicom.dic and private.dic before loading the DICOM file. How can I do this?

My first question would be: Why do you want to load the dictionary file(s) manually?

The sample code you've found on StackOverflow is not wrong but if you want to rely on the default dictionary files (determined during configure or specified by the environment variable DCMDICTPATH), you could also call reloadDictionaries() instead of loadDictionary().


Top
 Profile  
 
PostPosted: Tue, 2016-01-05, 14:08 
Offline

Joined: Tue, 2015-11-03, 14:40
Posts: 29
J. Riesmeier wrote:
Quote:
I want to load dicom.dic and private.dic before loading the DICOM file. How can I do this?

My first question would be: Why do you want to load the dictionary file(s) manually?

The sample code you've found on StackOverflow is not wrong but if you want to rely on the default dictionary files (determined during configure or specified by the environment variable DCMDICTPATH), you could also call reloadDictionaries() instead of loadDictionary().


I don't know if I need to load it manually. I want to load both private/non-private tags from my own defined location. I''ve read the posts related to the environment variables but I don't understand how to do it... :(

I am using Qt and Visual Studio


Top
 Profile  
 
PostPosted: Wed, 2016-01-06, 10:01 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1928
Location: Oldenburg, Germany
You can specify the "data directory", where also the dictionary files are installed, during the configure step. Details can be found in the "datadict.txt" file of the source code package.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group