File Exchange

image thumbnail

4D Volume Visualization

version 1.0 (8.49 KB) by

4D (3D+1) volume visualization with windowing, custom colormaps, and component selection



View License

A tool for visualizing vector-valued volumetric data, which has become more common recently in medical imaging (e.g., 3D + time, multi-modal acquisition). The function accepts a 4D matrix, allowing the user to interactively select the 4th dimensional component to display. The 3D volume for the particular component is shown in a neurological coordinate frame with three orthogonal planar views along with a built-in 'slice' visualization. The user may also supply a cell array of colormaps, which populate a menu within the gui.

Comments and Ratings (6)

Guy Wilson

Joshua Stough

Response to John:
Thank you for your question John. Your question concerned why certain slicing of your data seem to appear in the wrong orthoplanes. While I am slightly chagrined, the honest response is that I have intentionally permuted and flipdim'd to make my particular data (MRI images in analyze75 format) appear as I want it (RAS). Search for 'permute' and 'flipdim' in the code to customize it for yourself.
As an aside, the particular examples you provide disagree with your own description. For example, Aq(c,:,:,f) is not plotting the xz plane, it's actually the yz plane (all y and all z for a particular x).


John (view profile)

Hi Joshua,
thanks for your software. I have found it very useful.
I wondered if you would be able to explain something to me. If I plot Aq(constant,:,:,frame), I am plotting the xz plane. When I visualize it with your software, I see this cut in the yz plane. (similar occurrence with Aq(:,constant,:,frame, this time the yz cut appears in xz.) Is there any reason for this, or have I misunderstood something?


Mihai (view profile)

Joshua Stough

Response to Gustavo: My code doesn't care how you got the image. If it, say 'I', exists in matlab as a 4d array of any class (use size and class functions to determine this), then just try 'vis4d(double(I));' instead of whatever you were doing.

For loading nifti images, exchange #8797 seems popular:

Good luck,


Hi. I have started working with you toolboxes but i can't get any results. I have NIFTI images to work with. How can i adapt them to your toolbox?

Thanks in advance

MATLAB Release
MATLAB 7.14 (R2012a)

Inspired by: 3D Volume Visualization

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

» Watch video