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
Multiple-Referenced Dicom Records
Moderator: Moderator Team
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";
}
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
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 ?
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
-
- OFFIS DICOM Team
- Posts: 1461
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
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.
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.
Who is online
Users browsing this forum: Baidu [Spider], Google [Bot] and 1 guest