MATLAB: Can I read a single field using DICOMINFO

dicomdicominfo

Hi all,
Ive got a pretty large number of dicom files, and using "dicominfo" for each image is causing my GUI to run extremely slowly. I'd like to read a single field of the header that I am interested in, rather than having to read in the entire thing as I'm not using 99% of it.
Does anyone know how this might be accomplished?
Cheers Jim

Best Answer

Just to post a follow up - I found a way around this using the dicomtoolkit (just google dcmtk). I'm using a Mac
This gives you access to a host of extra dicom functionality, including the ability to query a dicom file header using a single tag - thereby allowing a route around using "dicominfo". Below is an example I used to find the slice index in a sequence.
images(:,:,count) = dicomread([pathname fname]); %read each file
str=['dcmdump +P "0020,0013" ' ([pathname fname])]; %create the string
[s,result]=system(str); %run command in Unix terminal
pos_index=strfind(result, ']')-1; %search for the second square bracket
n_instance(count) = str2double(result(17:pos_index));
This saved me almost 9 minutes while analysing a sequence of 11,000 files (it now takes 3).
Jim