Toolbox with Dicom Search/Read/Write tools ...
- dicom_folder_info, search a folder and sub-folders for all dicom files and gives a structure back with the information of all datasets present in that folder.
- dicom_read_volume, read a dicom volume, it doesn't matter if the dicom volume consist of a single file or multiple files, or is in a sub-folder
- dicom_write_volume, write a dicom volume
- SiemensInfo, reads the MRI and DTI information from the Siemens Private tag 0029 1020
.
.
.
Example Dicom_Folder_info:
datasets=dicom_folder_info('D:\MedicalVolumeData',true);
datasets = 1x7 struct array with fields
datasets(1) =
Filenames: {24x1 cell}
Sizes: [512 512 24]
Scales: [0.3320 0.3320 4.4992]
DicomInfo: [1x1 struct]
SeriesInstanceUID: '1.2.840.113619.2.176.2025'
SeriesDescription: 'AX. FSE PD'
SeriesDate: '20070101'
SeriesTime: '120000.000000'
Modality: 'MR'
datasets(1).Filenames =
'D:\MedicalVolumeData\IM-0001-0001.dcm'
'D:\MedicalVolumeData\IM-0001-0002.dcm'
'D:\MedicalVolumeData\IM-0001-0003.dcm'
Dirk-Jan Kroon (2021). Dicom Toolbox (https://www.mathworks.com/matlabcentral/fileexchange/27941-dicom-toolbox), MATLAB Central File Exchange. Retrieved .
Inspired: dicomfolder
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Is it possible to show the Dicominfo of all the ".dcm" files in a folder? When I try it, it only shows the Dicominfo for the first dcm file. Wish there was more detailed instruction.
'SiemensInfo' function was very helpful for me. Thanks
Thank you very much,It`s wonderfull
Excellent toolbox.
I think there's a typo in function dicom_read_header it's says dicom_read_volume in the code.
Thanks. Very helpful. But I am getting an error as recurssion limit reached 500. It can crash your system.
thank you
Thank you so much!!
Thanks. Very helpful but, it sorts the dicom files strangely, e.g., IMG0, IMG11, 22, 33, 44, 47, 49, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, ....
tanx
tanx
Great Submission! However, I also can't get the SiemensInfo to work. This creates problems when trying to write the Dicom files. Has anyone figured out how to fix this yet? I get errors:
Attempted to access name(0); index must be a positive integer or logical.
Error in SiemensInfo (line 21)
while(name(end)==' '); name=name(1:end-1); end
Working pretty well, so far. Thanks.
I was a bit tripped up at the beginning on the difference between dicom_folder_info and dicom_read_header, since both functions can accept a folder name as input. It could be worthwhile adding a word of emphasis in the documentation about the differences between the two...
This submission seems to require the image processing toolbox. At least it uses "dicominfo", which AFAIK is part of the image processing toolbox. If that's the case, it would be nice if it was indicated on this page.
Thanks, the dicom_write_volume function came in handy.
Very helpful.
Thank you.
Unfortunately the SiemensInfo seems not to work for me. At least not for projection data in the AX environment.
I guess it chokes on GE data?
>> series27 = dicom_folder_info('s27-T1-map-TR50_3acqs');
>> vol = dicom_read_volume(series27);
??? Reference to non-existent field 'ImageType'.
Error in ==> dicom_read_volume at 20
if(~isempty(strfind(info.ImageType,'MOSAIC')))