Code covered by the BSD License  

Highlights from
3D Slicer

5.0

5.0 | 8 ratings Rate this file 113 Downloads (last 30 days) File Size: 173 KB File ID: #27983
image thumbnail

3D Slicer

by

 

22 Jun 2010 (Updated )

Slicer for exploring 3D images (grayscale, color or vectorial) through planar or 3D slices.

| Watch this File

File Information
Description

Simple interface for exploring 3D images by visualizing planar slices. The interface also allows displaying 3 orthogonal slices, either in 3D or in three subplots.

Among the interface features:
- navigation within image,
- zoom management,
- edition of grayscale range (from datataype, from image, manual)
- interactively change display range, color map, spatial resolution...
- 3D image flip or 90-degrees rotation,
- import of metaimage, analyze or dicom images
- interactive 3D orthogonal slices, planar or 3D
- management of several look-up tables

It supports 3D grayscale, binary, RGB, or vector images (in this case, the vector norm is used for display).

The package includes functions to read/write image stacks stored as tif slices or bundle, as well as basic support for reading and writing images in metaimage format (mhd).

Examples of use:
 Slicer(img); % display the 3D or 4D imge
 Slicer('fileName.tif'); % read the 3D image from file
 Slicer('img000.tif'); % read a series of images
 Slicer % opens a dialog to choose the file
 Slice(img, 'DisplayRange', [0 80], 'Spacing', [1 1 2.5], 'Origin', [0 0 0], 'unitName', '┬Ám'); % Specify some options

Type "help slicer" at matlab prompt, or "help imStacks" to have an overview of all functions within the package.

To install, simply unzip, and add the directory "imStacks" to the path. The new version of the Slicer (from July 2012) uses the GUILayout toolbox by Ben Tordoff (FEx #27758). Version 1.10 is included in the archive for convenience.

Acknowledgements

Tiffread2.M, Myslicer Make Mouse Interactive Slices Of A 3 D Volume, and Gui Layout Toolbox inspired this file.

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (19)
20 Nov 2013 David Legland

Hi Jun,

From what I remember, the offset is the same as the origin, and the field "origin" is used to specify the coordinates of the first pixel. "origin" and "spacing" are used to display mouse cursor coordinates in user units, but changing the origin does not change the display of the image itself.

The transformMatrix is not used at the moment. This could be used to update cursor coordinates (for example within the displayPixelCoords function). But if you want to display the image after applying the transform, this would require much more work...

07 Nov 2013 Jun Hao

Hi David, you really did a brilliant work!
However, I have some doubts here. After reading the mhd file, some of the info retrieved, such as 'TransformMatrix' and 'Offset', you didn't use them to reconstruct the original image, right? Do you know anyway to implement those information during the reconstruction of the image? Thanks

29 Aug 2013 David Legland

Hi Gianni,
I agree, this would be a nice improvement! Note that there is a limited support for vector images that can be displayed in main frame when they are given as [Ny*Nx*Nc*Nz] arrays. But only the norm of the current slice can be displayed. I will have a look to extend it!

28 Aug 2013 Gianni Schena

what about 3d orthoslices of a vector field , i.e. Slicer(U,V,W) as an improvement to the present capability limited to a scalar field (Slicer(M)).

with U,V,W on the 3 orthogonal planes

23 Aug 2013 Bondy  
10 Jun 2013 Colleen

I was using this app on R2012b but recently upgraded to R2013a and now have difficulty running the Slicer app. I'm wondering if that's a result of the new version of Matlab or if I did not install it correctly. Any assistance on this issue would be much appreciated.
Thank you,
Colleen

18 Apr 2013 David Legland

Hi Niru C,
This contribution is devoted to the visualisation of 3D images. For your problem, I would suggest trying my other contributions geom3d (#24484) and geom2d (#7844), in particular functions intersectPlaneMesh, and polygonLength.

15 Apr 2013 Niru C

Hello David

I have this 3D point-cloud which I made into a triangulation mesh (~4500 points) using the ball-pivot algorithm. I want to find the perimeter of an outline formed from intersection of this 3D mesh and a plane parallel to XY plane say at different Z values. Can I do this in this program ? What will be your suggestion?

Thank you

14 Aug 2012 Sean de Wolski

Hi David,

I had to grab the "Patch" folder from the GUI Layout Toolbox in order to avoid run time errors.

%Sean

14 Aug 2012 Gianni Schena

This function offers the same capability available with expensive commercial software for CT / MR explotation.
It would be desirable to have an option to generate the histogramm of the voxels-luminosity (excluding the background voxels ) e.g. like : hist(Volume(good_voxels),nbins).
The valley of the histrogram can used for region-based volume segmentation.

14 Jul 2012 Gianni Schena  
18 Aug 2011 David Legland

Hi Martijn,
your suggestion is good ! I have just submitted an updated version that fixes it. I'll also try to add support for data stored in header file in a future version.

Regards,
David

17 Aug 2011 Martijn Steenwijk

Hi David,

Great work! A small suggestion regarding the metaImageInfo function. Currently, if a mhd file contains the tag ElementSize, but not the tag ElementSpacing, ElementSpacing will be set by default as [1 1 1].

This while the specification states (http://www.itk.org/Wiki/MetaIO/Documentation):
If ElementSpacing is not specified, it is assumed to be equal to ElementSize. If neither is specified, both are assumed to be 1.

Would it be an idea to follow this ITK convention?

Best,
Martijn

22 Jul 2011 David Legland

@OPS:
I think the problem depends on the image you tried to visualize.

Input should be either a M*N*P 3D grayscale image, or a M*N*3*P 3D color image.

hope this helps ?

05 May 2011 ops OPS

not work for me
??? Index exceeds matrix dimensions.

Error in ==> slicer>computeDisplayData at 415
data = img(:, :, zslice);

Error in ==> slicer>setSlice at 656
cdata = computeDisplayData(handles);

Error in ==> slicer>slicer_OpeningFcn at 216
setSlice(handles);

Error in ==> gui_mainfcn at 221
feval(gui_State.gui_OpeningFcn, gui_hFigure, [],
guidata(gui_hFigure), varargin{:});

Error in ==> slicer at 124
gui_mainfcn(gui_State, varargin{:});

27 Apr 2011 David Legland

@sdf: It is actually possible to load dicom images (files->import->dicom). Note that the gui does not support all dicom features. I have submitted an updated version, that should be more intuitive.
If you still have some bugs, please email me.

24 Apr 2011 sdf

do not open .dcm image....error of
Index exceeds matrix dimensions.

23 Apr 2011 sdf

??? Attempt to reference field of non-structure array.

Error in ==> slicer>itemOpen_Callback at 980
[filename, pathname] = uigetfile( ...

Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> slicer at 113
gui_mainfcn(gui_State, varargin{:});

Error in ==>
@(hObject,eventdata)slicer('itemOpen_Callback',hObject,eventdata,guidata(hObject))


??? Error while evaluating uimenu Callback

plyz tell me my mistake..and i have also added path to matlab.

01 Jul 2010 J Rey

Excellent, thank you very much.

Updates
30 Nov 2010

added options to choose grayscale extent, lut management, and fixed several bugs.

27 Apr 2011

added display of orthoslices, enhanced loading of new images, enhance display of image infos (name, pixel value...)

12 Aug 2011

fix bug when opening without arguments

18 Aug 2011

better control on size/spacing when importing metaImage format

13 Jul 2012

Switched the interface to GUILayout Toolbox. Lot of code rewritting...

12 Sep 2012

Updated to include an App file for R2012b

02 Dec 2013

better support of the different image types (binary, label...), more options for displaying orthoslices and histograms, added demo images, read offset from mhd files

Contact us