File Exchange

image thumbnail

Interactive DICOM 3D Viewer

version 1.4 (78.6 KB) by

Viewer allows user to look through cross sections of a dicom image set.

3 Ratings



View License

The interactive viewer allows a user to select a folder with one set of dicom images. The viewer assembles the images in order and displays them as one 3D dataset. User can then scroll through and look at axial, sagittal, and coronal views. A zoom feature and measuring tool have also been added.

Comments and Ratings (11)

plz tell me how can i use this? When i 'dcm3DViewer' in matlab and give this function to path it runs and dispaly a window showing three sub window. I am adding floder to them but there is not any any further working of button ahead? How can i add images to them?

joanna kosior

Muhammad Arif


I need to display brain scans sagittal, axial and coronal views. I have run 3DViewer but it throws the error msg that 'You selected a folder that does not contain .dcm images'. Please guide me through this!

Patrice Burke


After having made the changes suggested by Kallie, I am still getting the same " You selected a folder that does not contain .dcm images" error. It seems that line 412 in the gatherImages function:
threedarray = zeros(size(topimage,1),size(topimage,2),size(d,1));
is throwing up an "out of memory" error. I'm not running anything else, so surely there is enough memory to display a dicom image...

Any suggestions please?

Kallie Brown

Those functions are indeed the issue. the files should use array indexing instead of structure indexing.
in sortDirectory :
d = dir('*.dcm'); instead of ls
metadata = dicominfo(d(i).name);

in gatherImages:
topimage = dicomread(d(1).name);
metadata = dicominfo(d(1).name);

Cool submission! Thank you


mat (view profile)

Thank you.
I have the same problem as Ghizelda agerweij.

thank you
i've the same probleme as Ghizelda agerweij

Eric Johnston

Eric Johnston (view profile)

Hi Ghizelda,
The .dcm images are sorted by instance number. I'm guessing that the file might contain sets of images that are not compatible (maybe they have overlapping instance numbers?) As a test you could copy out my "sortDirectory" function and "gatherImages" function and see if they work on your folder.

Thanks for the nice file for 3d DICOM viewer. There is only one problem. After compiling the file, I get an error: " You selected a folder that does not contain .dcm images"

Why? I am current that I have .dcm images. All the images are PET/CT scan images. Are there different .dcm images/files?

I think that the problem is between lines 86-119.

How can i convert into matlab gui? thanks!

Ehm i want find a mode to convert *.m to a gui interface but i can't do it.



Updated to include an App file for R2012b


Can Capture a an image as a figure.


Bug removed: axial, coronal views can now scroll through entire set without ever hitting an error.

MATLAB Release
MATLAB 8.0 (R2012b)

Inspired: Dicom Operator - EsmeProcess

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

» Watch video