View License

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

» Watch video

Highlights from

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

5.0 | 25 ratings Rate this file 39 Downloads (last 30 days) File Size: 224 KB File ID: #40440 Version: 2.2
image thumbnail




21 Feb 2013 (Updated )

4D/3D image visualization and evaluation GUI.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

Imagine is back! Comfortable, powerful and intuitive visualization and evaluation of 3D or 4D data (e.g. x-y-z-t). Version 2.0 has an improved rendering engine for better contrast, supports complex data (magnitude/phase) and can show projections. It also supports the direct import of numerous (medical) file formats. Supports evaluation along lines, of regions of interest (ROI) and volumes of interest (VOI) using an easily extendible evaluation framework. ROI and VOI drawing is assisted by livewire (2D), region growing and isocontour function (both 3D). Comes with a documentation pdf-file.
Feature highlights:
- Smooth image zooming and adjustment of brightness and contrast using simple mouse operations.
- Import data directly from MATLAB workspace, mat-, DICOM-, NifTy-, GIPL- and standard image files.
- Displays intensity/magnitude, phase or minimum/maximum intensity projections.
- Powerful image evaluation features.
- Displays up to 16 3D-images simultaneously.
- Shows image intensity and coordinates at current cursor position.
- Link multiple 3D views or operate on individual views separately.
- 3D images can be rotated in 90 degree steps around all axes.
- Write your own evaluation function and easily incorporate into the framework.
- Save stacks of images to image files using the current contrast/brighness settings.

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.4 (R2014b)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (43)
29 Jul 2016 Damien Nguyen  
16 Jun 2016 Mathieu  
26 Apr 2016 Damien Nguyen  
25 Apr 2016 zanzabros  
25 Apr 2016 Hamed

Hamed (view profile)

19 Apr 2016 Denis Anikiev

Outstanding app! Thank you! Besides the great functionality, I like the way the background image is done very much.

14 Dec 2015 Zhiwei Zhai

When I import 3D logical image(65*60*120), there are some problems with Matlab 2015b,

Comment only
13 Nov 2015 Fritz

Fritz (view profile)

27 May 2015 Tianhan

Really a beautiful work that could be a reference. Thanks for sharing!

04 May 2015 David Leffingwell  
30 Nov 2014 Jose

Jose (view profile)

Just to follow up, that solved my problem.

Comment only
30 Nov 2014 Jose

Jose (view profile)

26 Nov 2014 Christian Wuerslin

Hola Jose,

I recently installed R2014b and had the same problem. For R2014b, the eventdata of the mouse wheel callback was changed to an object instead of a struct. The solution is to add this line

if isobject(iCnt), iCnt = iCnt.VerticalScrollCount; end

a few lines above the line which throws the error (just next to a very similar line, which checks for a struct). I will also upload a fixed version soon.

Comment only
24 Nov 2014 Jose

Jose (view profile)

Hi Christian,

I use imagine a lot and I think it's a great tool. However, I just upgraded to OSX Yosemite and I had to get Matlab R2014. The new imagine version works but the mouse scroll function to explore through slices seems to be broken. Here is the message I get when I try to use it:

Error while evaluating Figure WindowScrollWheelFcn

Undefined function 'plus' for input arguments of type 'matlab.ui.eventdata.ScrollWheelData'.

Error in imagine/fChangeImage (line 1847)
iNewImgInd = SData(iSeriesInd).iActiveImage + iCnt;

Any quick fix for this?

Comment only
01 Nov 2014 Christian Wuerslin

Thanks for letting me know, Jacob. I work on windows, soI don't get that error. Will also be fixed in a nes release sool.

Comment only
31 Oct 2014 Jacob Matthews

Had a followup error in which matlab couldn't find icon lw.png. It was in the icons folder but named with a capital 'L'... fixing it was the last error. Just a heads up!

Comment only
31 Oct 2014 Christian Wuerslin

Hi Jacob,

I see the problem. The file is in the subfolder "Colormaps", but I only add that folder to the path a few lines later. I will upload a fixed version soon (along with some other bugfixes). Until then, you can either add the imagine subfolders to the path manually or move the block that is commented "Set some paths" up a few lines such that they are executed before the "load('mylines.mat');" command.
Sorry and thanks for letting me know.

Comment only
29 Oct 2014 Jacob Matthews

Hi Christian,
Loved the original release. Use it for quick visualization all the time.
Just downloaded v2, but when I try to run the imagine function it errors on line 120 trying to load mylines.mat which doesn't exist. Am I missing something obvious? Or could this be a version issue?

Comment only
18 Sep 2014 Ibraheem Al-Dhamari

I tried to load DICOM images but I get this error:
Undefined function or variable "SNewData".
Error in imagine/fLoadFiles (line 1465)
for i = 1:length(SNewData)
Error in imagine/fMenubarClick (line 475)
SNewData = fLoadFiles(csFilenames);
Error while evaluating image ButtonDownFcn
Is it not supported?

Comment only
21 Jul 2014 Patrick  
18 Apr 2014 Charles  
10 Apr 2014 t zq

t zq (view profile)


08 Apr 2014 Christian Baumgartner

I really enjoy working with your submission. Works perfectly, easy to understand and really nice UI. Well done!

02 Apr 2014 Trung

Trung (view profile)

Sorry, I have figured it out. Holding right mouse button or using "Ctrl + left mouse" would allow the zoom function.

Comment only
02 Apr 2014 Trung

Trung (view profile)

This is a great app. However, I am unable to zoom. Is there anyone having the same problem or how can I zoom my imported images in the GUI of this app?

26 Feb 2014 Ta Hai

Ta Hai (view profile)

nice job! thank you

16 Dec 2013 francesco

very great tool, either more interactive! :)

04 Dec 2013 TH81

TH81 (view profile)

23 Sep 2013 Michael  
23 May 2013 Martin

Martin (view profile)

05 May 2013 Pablo Tacconi  
12 Apr 2013 Arindam Bose

Arindam Bose (view profile)

06 Apr 2013 Christian Wuerslin

Hi Jiro,

OK, I think I'm starting to get the idea of the difference between app and function :). So the next version of the app will simply return the figure handle to comply with the specs.

Thanks for the publicity <3

Comment only
05 Apr 2013 Jiro Doke

Jiro Doke (view profile)

Yes, I think what you're doing makes sense if people are using your app from the command line. The App, on the other hand, is used through the Apps tab, so there won't be a use case of having an output argument anyway. Because of that, I think you can just remove that capability when packaging.

Great tool. BTW, I highlighted your entry on the File Exchange Pick of the Week:

Comment only
05 Apr 2013 Christian Wuerslin

Hi Jiro,

wow, thanks for the thorough investigation. Would have taken me forever to figure that out. Well, I was trying to give people the possibility to add arbitrary plots (e.g. quiver, lines) to the axes and thus introduced the axes handle output. Since the axes are destroyed when the panel leyout is changed, I disabled this feature when the axes handles are returned. I guess I have to think of something different for the app. Thanks for your suggestions!



Comment only
04 Apr 2013 Jiro Doke

Jiro Doke (view profile)


I think I know what's going on. When you create an App, MATLAB checks to see if your function has an output argument or not. If it does, it will call "imagine" with an output argument. I see that in your code, you disable the ability to change the number of axes when "nargout" is 1.

Just as a note: as you can see from the documentation for Apps (the Tips section)

MATLAB assumes that the output from your function is a figure handle, and that's how it detects whether the figure has closed or not.

A fix would be to use a slightly different version of "imagine" for the App version, and not disable the multi-axes option. You can also output the handle of the figure, as opposed to the handle of the axes.

Comment only
04 Apr 2013 Christian Wuerslin

Hi Jiro,

thanks for the feedback and making me aware of the bug. I can't test it at the moment and I am a bit puzzled why this error ocurres since the app uses the same m-file as the normal submission, which works fine (at least for me). I'll fix it as soon as I get to my 2012b workstation.

Comment only
03 Apr 2013 Jiro Doke

Jiro Doke (view profile)

Great tool, Christian!

I noticed that the App version has the "Panel Layout" button disabled, and I can't change the layout to show multiple frames.

I really like the interface and the look&feel of the App!

27 Feb 2013 Ronald

Ronald (view profile)

25 Feb 2013 Christian Wuerslin

Hi Roland,

concerning the error: I must have accidentially changed the name of the subfolder "EvalFucntions" to "EvalFunctionsf". Rename this folder and it should work; I will also upload a fixed version asap.

The slice number is shown in the upper left corner of each image panel (since the panels might show different slices) togehter with the total number of slices.

To put the tooltip in the upper left corner is a good idea, I will incorporate that.

Thanks for your feedback!


Comment only
25 Feb 2013 Ronald

Ronald (view profile)

Nice submission!
I encountered one error, Imagine cannot use the find the fEvalLineFWHM function (it is not on the path). Should be easy to fix.

Also some nice additions would be:
- show a tooltip for the buttons (or a text at the location where not the position and pixel value is shown).
- add the slice position instead of only showing x and y.

Comment only
22 Feb 2013 Thomas

Thomas (view profile)

Best MRI image visualization tool!

Comment only
22 Feb 2013 Thomas

Thomas (view profile)

21 Feb 2013 1.1

Whoops, forgot the icons in the initial upload :S

26 Feb 2013 1.2

V 1.1 changelog:

- Fixed wrong subdirectory name.
- Subdirectory for evaluation functions is automatically added to path.
- Added Tooltips

20 Mar 2013 1.3

V 1.2 changelog:

- Documentation included
- Changed GUI architecture
- Added comments
- Some bugfixes
- Line profiles show captions
- Return axes handles

21 Mar 2013 1.4

V 1.2 changelog:

- Documentation included
- Changed GUI architecture
- Added comments
- Some bugfixes
- Line profiles show captions
- Return axes handles

21 Mar 2013 1.5

New icons.

27 Mar 2013 1.6

Fixed bugs in zooming and file opening operations.

03 Apr 2013 1.8

V 1.4 changelog:

- Added app
- Added save to file feature

09 Apr 2013 1.10

^^ Typo ^^
This is still V 1.3. App returns figure handle and allows layout change.

23 Oct 2014 1.11

V 1.4 Changelog:
- Added colormaps
- Added colorbar option
- Added evalbar option
- Better zooming operation

24 Oct 2014 1.15

V 2.0
- New display engine
- DICOM, NifFty, GIPL and mat-Import
- Complex data
- Projections
- New eval framework
- more bugs :)

04 Nov 2014 1.16

Fixed some bugs, updated documentation.

28 Jan 2015 1.17

Finally fixed the R2014b mouse scroll wheel issue.

12 Mar 2015 1.18

Closed memory leaks in mex files, higher colormap resolution

28 Jul 2016 2.2

Performance update:
- Removed some obsolete elements
- Changed the way data is displayed in axes
- Changed background image

Contact us