File Exchange

image thumbnail

Dicom Toolbox

version 1.4 (7.88 KB) by

Search/Read/Write dicom folders and dicom volumes

78 Downloads

Updated

View License

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'

Comments and Ratings (15)

lily liu

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.

neenu prakash

Thanks. Very helpful. But I am getting an error as recurssion limit reached 500. It can crash your system.

hang phan

thank you

Thanos

Thanos (view profile)

Thank you so much!!

Q

Q (view profile)

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, ....

shari shari

tanx

shari shari

tanx

Elise

Elise (view profile)

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

Matt J

Matt J (view profile)

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...

Georg Stillfried

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.

Antonio

Thanks, the dicom_write_volume function came in handy.

Felix

Felix (view profile)

Very helpful.
Thank you.
Unfortunately the SiemensInfo seems not to work for me. At least not for projection data in the AX environment.

Andrew Davis

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')))

Updates

1.4

dicom_write_volume.m, writes now all files with the same Study and Series Instance UID.

1.3

Added Siemens Mosaic Support

1.2

Better support for 4D format, and windows-shares.

1.1

Dicom Sorting Bug solved

MATLAB Release
MATLAB 7.10 (R2010a)
Acknowledgements

Inspired: dicomfolder

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video