Multiple-Referenced Dicom Records

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
steini
Posts: 8
Joined: Tue, 2005-08-02, 13:24

Multiple-Referenced Dicom Records

#1 Post by steini »

Hallo @all,

I have a dicomdir dataset containing many subfiles which are referenced with each other. How can I access them ?

The following code just goes into the next subdirectory in which all files are located.

DcmDirectoryRecord *rootRecord = &(dicomDir->getRootRecord());
while (((record = rootRecord->nextSub(record)) != NULL)) {
...
}

Something like the following code fails.

rootRecord->assignToMRDR(rootRecord);
while (rootRecord->getReferencedMRDR())

Any ideas ?

Marc
eq

steini
Posts: 8
Joined: Tue, 2005-08-02, 13:24

#2 Post by steini »

Ok. With the following source code I get the patient, study and series data. But do I access the files and the corresponding images in the DICOMDIR ?

if(DICOMDIR) {
while (((PatientRecord = root->nextSub(PatientRecord)) != NULL)) {
if (PatientRecord->findAndGetOFString(DCM_PatientsName, tmpString).good()) {
cout << "Patient Name : " << tmpString << "\n";
} else {
cerr << "Can't retrieve patient name from DICOMDIR file!\n";
}

while (((StudyRecord = PatientRecord->nextSub(StudyRecord)) != NULL)) {
if (StudyRecord->findAndGetOFString(DCM_StudyDescription, tmpString).good()) {
cout << "Study Description : " << tmpString << "\n";
//StudyRecord->findAndGetUint8Array(DCM_PixelData, pixelData,NULL, OFTrue );

} else {
cerr << "Can't retrieve study description from DICOMDIR file!\n";
}

if (((SeriesRecord = StudyRecord->nextSub(SeriesRecord)) != NULL)) {
if (SeriesRecord->findAndGetOFString(DCM_SeriesDescription, tmpString).good()) {
cout << "Series Description : " << tmpString << "\n";
} else {
cerr << "Can't retrieve series description from DICOMDIR file!\n";
}
if (SeriesRecord->findAndGetOFString(DCM_Modality, tmpString).good()) {
cout << "Modality : " << tmpString << "\n";
} else {
cerr << "Can't retrieve modality from DICOMDIR file!\n";
}
eq

steini
Posts: 8
Joined: Tue, 2005-08-02, 13:24

#3 Post by steini »

I just go on posting since maybe it will help someone else....

I just added to the code above

while (((FileRecord = SeriesRecord->nextSub(FileRecord)) != NULL)) {
...

and these are my FileRecords which have a reference to the corresponding files. How do i access these files (findAndGetOFString(DCM_ReferencedFileID , tmpString)) now ?
eq

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1437
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#4 Post by Marco Eichelberg »

DcmFileFormat::loadFile().
The mapping of the DICOM encoding of filenames (uppercase letters and backslash as a separator) to the local filesystem conventions (which are operating system specific and on Posix systems also depend on the mount options) are not automatically converted by DCMTK - you have to do that manually. Other than that, the ReferencedFileID is just a path and filename relative to the root directory of the storage medium.

Post Reply

Who is online

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