Create Dicomdir From Dicom Files Download
DcmSeries = loaddcmdir(directoryname). LOADDICOMDIR reads metadata from DICOMDIR file and shows a list of the different DICOM SERIES in a Pop-up menus. After selecting a dicom series the program creates the dcmSeries structure containig the related file names and path. The zip file also contains the loaddcm.m.
/ 8 years ago / (PLEASE READ THE DESCRIPTION! THANK YOU!) IT'S FINALLY DONE! This is us: Read CF tweets: Like us on Facebook: http://www.facebook.com/coasterforce.
pydicom is a pure python package for working with DICOM files.It was made for inspecting and modifying DICOM data in an easy 'pythonic' way.The modifications can be written again to a new file.
As a pure python package, pydicom can run anywhere python runs without any other requirements,although NumPy is needed if manipulating pixel data.
pydicom is not a DICOM server, and is not primarily about viewing images.It is designed to let youmanipulate data elements in DICOM files with python code.
Limitations -- for files with compressed pixel data, pydicom can decompressit (with additional libraries installed) and allow you to manipulate the data,but can only store changed pixel data as uncompressed. Files can always beread and saved (including compressed pixel data that has not been modified),but once decompressed, modified pixel data cannot be compressed again.
Documentation
Dicomdir File Opener
pydicom documentation is available on GitHub Pages both for the development(master) version and for thereleased version. Thedocumentation for the previous 0.9.9 versionis still there for reference.
See Getting Startedfor installation and basic information, and theUser Guidefor an overview of how to use the pydicom library.To contribute to pydicom, read our contribution guide.To contribute an example or extension of pydicom that does not belong withthe core software, see our contribution repository,contrib-pydicom.
//Open the DICOMDIR File |
QString DICOMDIR_folder = 'C:/Folder1/Folder2'; |
constchar *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) |
{ |
constchar *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 |
} |
} |
} |
} |
} |
} |