DcmTag

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
kattabomane
Posts: 43
Joined: Tue, 2005-02-01, 22:53

DcmTag

#1 Post by kattabomane »

Hello,
I am not yet familiar with the DCMTK.
I have a small stupid question.
I have taken an example from the help :


Code: Select all


#include "dcfilefo.h"

DcmFileFormat fileformat;
OFCondition status = fileformat.loadFile("test.dcm");
if (status.good())
{
  OFString patientsName;
  if (fileformat.getDataset().findAndGetOFString(DCM_PatientsName, patientsName).good())
  {
    cout << "Patient's Name: " << patientsName << endl;
  } else
    cerr << "Error: cannot access Patient's Name!" << endl;
} else
  cerr << "Error: cannot read DICOM file (" << status.text() << ")" << endl;
The compiler says DCM_PatientsName is an unidentified identifier. Where is this defined ?
How to convert OFString to CString ?
Thanks for your help.

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

#2 Post by Jörg Riesmeier »

The standard tags are defined in "dcmdata/include/dcdeftag.h". Just include "dctk.h" instead of "dcfilefo.h" and it should work.

With regard to your second question: I don't know. Please refer to the documentation of both classes. For example, OFString::c_str() returns a "const char *".

kattabomane
Posts: 43
Joined: Tue, 2005-02-01, 22:53

dcmtag

#3 Post by kattabomane »

Hello,
Thanks for your help. It solved my problem.
But why can't i get the dicom tags (0002,XXXX) ?
Otherwice i am able to read all other tags.
Is there any reason ?
Thanks

Thomas Wilkens
DCMTK Developer
Posts: 117
Joined: Tue, 2004-11-02, 17:21
Location: Oldenburg, Germany
Contact:

#4 Post by Thomas Wilkens »

The attributes of the 0002-group are contained in the metaheader of the file, not in the dataset. Use

Code: Select all

fileformat.getMetaInfo()->findAndGet...
instead of the method to get a file's dataset.

kattabomane
Posts: 43
Joined: Tue, 2005-02-01, 22:53

dctag

#5 Post by kattabomane »

Hello,
Thanks again. I haven't studyed the whole class structure.

Post Reply

Who is online

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