//Open the DICOMDIR File QString DICOMDIR_folder = "C:/Folder1/Folder2"; const char *fileName = "C:/Folder1/Folder2/DICOMDIR"; DcmDicomDir dicomdir(fileName); //Retrieve root node DcmDirectoryRecord *root = &dicomdir.getRootRecord(); //Prepare child elements DcmDirectoryRecord *rootTest = new DcmDirectoryRecord(*root); DcmDirectoryRecord *PatientRecord = NULL; DcmDirectoryRecord *StudyRecord = NULL; DcmDirectoryRecord *SeriesRecord = NULL; DcmDirectoryRecord *image = NULL; if(rootTest == NULL || rootTest->nextSub(PatientRecord) == NULL) std::cout << "It looks like the selected file does not have the expected format." << std::endl; else { while ((PatientRecord = root->nextSub(PatientRecord)) != NULL) { while ((StudyRecord = PatientRecord->nextSub(StudyRecord)) != NULL) { while ((SeriesRecord = StudyRecord->nextSub(SeriesRecord)) != NULL) { while ((image = SeriesRecord->nextSub(image)) != NULL) { const char *sName; //Retrieve the file name image->findAndGetString(DCM_ReferencedFileID, sName); //If a file is selected if(sName != "") { //sName is the path for the file from the DICOMDIR file //You need to create the absolute path to use the DICOM file //Here you can do different tests (does the file exists ? for example) //Treat the dicom file } } } } } }