View5D as applet within Matlab

View5D can be easily integrated into MATLAB using the applet version of View5D. Since recently, MATLAB versions support Java, marker data can be conveniently im- and exported from and to MATLAB.

To install, copy the java archieve View5D.jar into the "java/jar/toolbox/" subfolder of your MARLAB installation. To make this file visible to MATLAB add the following line to the file "$matlabroot/toolbox/local/classpath.txt" :

In the class View5D the function
and similar functions for float[], double[], complex[], short[], and int[] as datatypes generate a new viewer. These functions return an object of type "View5D", which should be stored as a MATLAB variable (e.g. myviewer1=View5D.Start5DViewer(mybytes, mysizeX,mysizeY,mysizeZ,myelems,mytimes) ). This can then be used to import and export markers to/from this viewer:
One problem of the java-support of Matlab seems to be that matlab does not release the memory after a java application has finished. This memory is also not reused when the viewer is started a second time. As a consequence there will be a java out-of-memory error after having started the viewer a few times. One way to deal with it is to increase the total amount of memory allocated to java within matlab by putting a file named "java.opts" containing the line "-Xmx900000000" into your local matlab operation directory (e.g. /home/matlab). Another possibility is to use the appletviewer (under linux) and the script given below (for DIPimage only).

View5D, DIPimage and Matlab

View5D can be nicely called also in the "extern" mode if the DIPimage toolbox is installed by using the view5d.m script. Place this script into the matlab .... toolboxes/dipimage/ directory and copy the View5D.jar file into your "/tmp/" directory. The program "appletviewer" which is part of the java development (not runtime) package by Sun can be useful. Alternatively any Web-browser capable of java can be used to look at the file "/tmp/dipimage_view5d.html" that will be generated when "view5d( imagename, 0, 'extern') is called. To learn more try "help view5d" from within matlab after installing view5d.
With the distribution of View5D comes another useful file "view5dAddElem(

Below follows a detailed description of how to get it running under a Microsoft Windows system (curtesy of Stefan Schaefer):
The matlab script is based on assuming "explorer" in windows to be able to handle web-pages with java. This is not necessarily guaranteed and some Windows systems need the java-plugin as given below to be installed.

Requirements: The following programs must be installed:
Typing view5d(readim,0,’extern’) into the MATLAB command line should now launch the standard web browser with the viewer

Back to the View5D homepage
For hints and suggestions, contact the author under heintzmann at gmail dot com