Last active
March 22, 2021 08:59
-
-
Save JulesGorny/1cf5786ba23d65bfd7e6 to your computer and use it in GitHub Desktop.
Revisions
-
JulesGorny revised this gist
Sep 19, 2014 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,9 +30,8 @@ else //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) -
JulesGorny revised this gist
Sep 19, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ //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(); -
JulesGorny revised this gist
Sep 19, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ //Open the DICOMDIR File QString DICOMDIR_folder = "C:/Folder1/Folder2"; char *fileName = "C:/Folder1/Folder2/DICOMDIR"; DcmDicomDir dicomdir(fileName); //Retrieve root node DcmDirectoryRecord *root = &dicomdir.getRootRecord(); @@ -9,7 +9,7 @@ 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; @@ -23,7 +23,7 @@ else { while ((image = SeriesRecord->nextSub(image)) != NULL) { const char *sName; //Retrieve the file name image->findAndGetString(DCM_ReferencedFileID, sName); -
JulesGorny revised this gist
Sep 19, 2014 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ //Open the DICOMDIR File QString DICOMDIR_folder = "C:/Folder1/Folder2"; char* fileName = "C:/Folder1/Folder2/DICOMDIR"; DcmDicomDir dicomdir(fileName); //Retrieve root node DcmDirectoryRecord *root = &dicomdir.getRootRecord(); //Prepare child elements @@ -28,7 +30,13 @@ else //If a file is selected if(sName != "") { QString DICOM_file_fromDICOMDIR = sName; //Build the absolute path for DICOM file QString DICOM_file_path = DICOMDIR_folder + "/" + DICOM_file_fromDICOMDIR; //Here you can do different tests (does the file exists ? for example) //Treat the dicom file } } } -
JulesGorny renamed this gist
Sep 19, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
JulesGorny created this gist
Sep 19, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ //Open the DICOMDIR File DcmDicomDir dicomdir(fileName.toStdString().c_str()); //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 != "") { } } } } } }