All other questions regarding DCMTK
Moderator: Moderator Team
kattabomane
Posts: 43 Joined: Tue, 2005-02-01, 22:53
#1
Post
by kattabomane » Mon, 2005-02-07, 18:43
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
Posts: 2217 Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany
#2
Post
by Jörg Riesmeier » Mon, 2005-02-07, 19:24
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
#3
Post
by kattabomane » Mon, 2005-02-07, 23:24
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 » Tue, 2005-02-08, 08:15
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
#5
Post
by kattabomane » Tue, 2005-02-08, 11:13
Hello,
Thanks again. I haven't studyed the whole class structure.
Users browsing this forum: Baidu [Spider] and 1 guest