Code covered by the BSD License  

Highlights from
DICOMDIR Reader

3.52632

3.5 | 19 ratings Rate this file 117 Downloads (last 30 days) File Size: 10.58 KB File ID: #7926

DICOMDIR Reader

by Laszlo Balkay

 

27 Jun 2005 (Updated 05 Oct 2011)

Select dicom series under a directory or CD using the DICOMDIR file.

| Watch this File

File Information
Description

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 program which enable to generate the relating 3D image array using the names of dicom slices.

Hints:

Reading DICOMDIR folder using the directory browser GUI:
   dcmSeries = loaddcmdir;

Generating 3D array by selecting a dicom series:
   [imaVOL, scaninfo, dcminfo] = loaddcm(loaddcmdir);

To preview the 3D array you can use the orthogonalslicer tool: (http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5934&objectType=file)

orthogonalslicer(imaVOL,scaninfo.pixsize,'gray');

To check the dicom header:
openvar('dcminfo');

Acknowledgements
This submission has inspired the following:
DICOMDIR Parser
Required Products Image Processing Toolbox
MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (31)
07 Oct 2005 YAVUZ BAYRAM

AAAA

17 Nov 2005 Vihang Patil

The program does not work. You have specified "dcmhdr = dicominfo(dcmdir_path);"
It is not applicable as dicominfo cannot read the directory. It only reads the dicom images. PLease let me know how to make it run

12 Dec 2005 Ravi Seethamraju

There is a bug in the script. The field PatientName should be replaced with PatientsName in order for the script to work

14 Jun 2006 Bob Alvarez

Also could not get it to work. Line 49 is definitely weird. I have used dicominfo many times and never for a directory.

19 Jun 2006 nicu gavanescu

good

04 Jul 2006 gabriel berindei  
04 Aug 2006 Joel Dunn

Could not open DICOMDIR from Phillips MRI scanner (tho readable on another program).
Error msg below...

ErrorOnDicomOpening =

Error using ==> medformats\private\dicom_read_attr>read_elt
Error using ==> medformats\private\dicom_read_attr>find_attr_details
Attribute (0070,0000) was not found in the data dictionary.

06 Aug 2006 zee hai  
05 Oct 2006 George Enrique Figueras Benítez

how can i modifier a especific field in a dicomdir header

11 Oct 2006 Orkopoulos Anestis  
30 Nov 2006 hamdi issa  
04 Dec 2006 pin press

Does this only work for specific type of dicomdir? I tried read that from a Philips generate dicomdir, and it reports error:

>> dcmseries=loaddcmdir(fn);

ErrorOnDicomOpening =

Error using ==> struct
Field name must be a string vector.

06 Dec 2006 Laszlo Balkay

Comments to "pin press":
As far as I know, officialy there is no different type of dicomdir files. Nevertheless I have gone into problem with Philips type dicomdir file. The only think I could suggest you, send me your dicomdir file directly to my email address to check your specific the problem.

Laszlo

04 Apr 2007 osae qafeas

hello

27 Sep 2007 mohammed ashour

nice program

22 Oct 2007 mohamed KHAFAGY

ggod

04 Feb 2008 Balaji Pillai  
11 Feb 2008 pedro aguiar

no coment

27 Mar 2008 Kalyani Mallela

I am still unclear on what your DICOMDIR is in the file "loaddcmdir". I have a folder say,data, that has 250 slices of CT. Each of the .dcm file has some name tag. Now, from this if I want to generate a 3D, can you tell me what should my DICOMDIR be. Thank you

29 Mar 2008 Laszlo Balkay

Comments to Kalyani Mallela: DICOMDIR is a "catalog" file in the DICOM CD. This is a well known "standard" in this field. If you only want to read dicom series (including 250 slices or whatever you want) you may use the "loaddcm.m" script from the loaddcmdir.zip package. I hope this help. LAszlo

18 Apr 2008 Daniel Polders

Good initiative!
I'm trying to read a dicomdir generated by a Philips Achieva MR system, but I get the following error:

??? Operands to the || and && operators must be convertible to logical scalar values.
Error in ==> loaddcmdir at 64 (dcmhdr = dicominfo(dcmdir_path);)

Any suggestions?

22 Apr 2008 Laszlo Balkay

Comment to Daniel Polders: The cause of your problem may be the version of your Img.Proc toolbox. See the link:

http://www.mathworks.com/support/bugreports/details.html?rp=343752

I hope this help,
LAszlo

20 Jul 2008 sujeet poudyal

good

31 Jul 2008 ani shiv

gud....

04 Aug 2008 Pratik Chhatbar

anyone had this error?

Undefined function or method dicominfo' for input arguments of type 'char'

07 Aug 2008 Laszlo Balkay

Comment to Pratik Chhatbar: This means matlab cannot find the 'dicominfo' function. It seems the Image Processing Toolbox is not installed in your PC, or the version is fairly old.

11 Sep 2008 Cristina Suárez-Varela

Hi!
I've tryed this dicomdir read, and it's ok but I've a problem with CT images. I must find the Hounsfield unit of each pixel to fix the window and I´ve find that the expresion is:
hu = pixel * RescaleSlope + RescaleIntercept
But I don't find these fields in the metadata info.
Could you help me?
Thanks!

12 Sep 2008 Laszlo Balkay

comment to Cristina Suárez-Varela:
Send your CT dicom series (or one instace from the series) directly to my email: balkay@pet.dote.hu

27 May 2009 Matt Thorpe  
27 May 2009 Matt Thorpe

Good work - thank you.

Our protocol tends to store images in a series across multiple directories, so I changed line 102 ( ...
 ImageNames{CurrentImage,1} = dcmfname ; )

to
... = CurrentItem.ReferencedFileID;

And adjusted accompanying load m-files accordingly.

This keeps each image associated with the correct path.

-M@

21 Mar 2011 Shrinivas

You have done a very great piece of work.Still I have an error it is giving me
?? function [dcmSeries] = loaddcmdir(directoryname)
    |
Error: Function definitions are not permitted at the prompt or in scripts.
Some how I will work on this but my problem lies when I need to calculate the Hounfied density for each pixel Please let me know how am i suppose to get the hounsfield density for each and every pixel value.

Please login to add a comment or rating.
Updates
05 Oct 2011

Fixed the bugs that were reported on comments list previously.

Tag Activity for this File
Tag Applied By Date/Time
medical Laszlo Balkay 22 Oct 2008 07:51:24
dicom Laszlo Balkay 22 Oct 2008 07:51:24
dicom cd Laszlo Balkay 22 Oct 2008 07:51:24
dicomdir Laszlo Balkay 22 Oct 2008 07:51:24
reader Laszlo Balkay 22 Oct 2008 07:51:24
directory Laszlo Balkay 22 Oct 2008 07:51:24
dicomdir S 28 Jan 2011 01:48:47
dicomdir Trevor 06 Sep 2011 13:46:37
dicom Trevor 06 Sep 2011 13:47:12
reader Trevor 06 Sep 2011 13:47:13
dicomdir Stefan 10 Feb 2012 07:18:26

Contact us at files@mathworks.com