ImageJ 3D Viewer

Author: Benjamin Schmid(Bene.Schmid at
History: 2007/04/20: First public version
Limitation: Requires Java3D to be installed.
Installation: Download ImageJ_3D_Viewer.jar to the plugins folder, or subfolder, restart ImageJ, and there will be a new command in the Plugins menu, "ImageJ 3D Viewer".

1. Demo video

Find here a screencast which shows some of the viewers feature (file size: 60 MB, duration: about 15 minutes).

2. Installation of Java3D

Before you start off, make sure you have Java3D installed in your Java JRE. If you are not sure whether Java3D is installed on your machine, simply download Java3Dexample.jar and start it (double-click on Windows or Mac, java -jar Java3Dexample.jar from a console under Linux). If you can see a rotating cube and no error or exception pops up, you are fine. If this is not the case, see here for a plugin which installs Java3D for you.

3. General notations

This plugins offers both Texture-based volume rendering and surface reconstruction and visualisation. Common to both is the limitation to 8-bit stacks, be it 8-bit grayscale images or 8-bit indexed color images. Note at this point that you can always convert an RGB image to an 8-bit color image. If you need an example stack, try this.

4. Texture-based Volume Rendering

In order to invoke the volume renderer, open your image stack and click on "ImageJ 3D Viewer" in the plugins menu. A dialog pops up, asking you whether you want to display a volume or a surface. Select "Volume" here:

A second dialog appears, asking for a few parameters, which you can just ignore if you don't know what they mean:

  • Name in the above dialog specifies the name of the content which you add to the 3D world.
  • Color specifies the color which is used to display the element. If you select "None", which is the default, the colors of your stack will be used. If you select another color, the element will be shown unicolored in the color you selected.
  • Resampling factor is the factor by which the stack is resampled before it is rendered.
  • Channels specifies the channels of the original image which you want to use. The example image has just two channels, red and green. If we just want to display the red channel, uncheck the other two:

You can rotate the brains using the left mouse button, or zoom using your middle mouse button and drag. The "Hand" tool in ImageJ's menu bar has to be selected therefore.

5. Surface Extraction and visualisation

If you want to view a surface at a certain intensity threshold, choose "Surface" instead of "Volume" in the initial dialogue, just after clicking "ImageJ 3D Viewer". The appearing dialog is similar to the one used in Volume rendering, but additionally asks for the value of the threshold. As surface reconstruction algorithm the well-known marching-cubes algorithm is utilised.

Before the surface is extracted, an average gray value is calculated for each voxel including all specified channels.

6. Navigation

You can do several things with the contents of the 3D world: You can rotate them, you can move them, and you can zoom in and out. In order to rotate and translate, the HAND tool in ImageJ's toolbar must be selected. To rotate, just drag with the left mouse button. To translate, press the SHIFT-key and drag simultaneously with the left mouse button. For zooming, the MAGNIFIER tool from ImageJ's toolbar must be selected. You can then zoom in and out by dragging vertically in the 3D world.

OperationImageJ toolHow to do it
RotateHAND toolDrag with the left mouse button
TranslateHAND toolPress the SHIFT key and drag with the left mouse button
ZoomMAGNIFIER toolDrag with the left mouse button

Since it is possible to have more than one content in a 3D world, one has to distinguish, if one wants to rotate/translate the whole world or just one of the contents.
If you just want to work with one content, you have to select it before. Selection is done by left-clicking on a content. A brief message will appear for a few seconds which shows the name of the selected content. Then you can rotate and translate as described above. Zooming is not possible for a single content.
If you got lost, you can at any time select "Reset view" from the "3D Viewer" menu. It will place all objects where they have initially been.

7. Using the menu

The Viewer3D menu offers some ways to work with the content of the 3D world:

You can add other volumes, meshes (reconstructed surfaces). You can also delete them or change their color. For this, you have to select a content, by clicking on it.

"Fill selection" offers a powerful way to edit a volume (this doesn't work with surfaces) and with the volume your original stack: Open therefore a volume, select the Freehand Selection Tool of ImageJ's toolbar, and draw a ROI around the region you want to fill. Afterwards, click on "Fill selection" in the 3D Viewer menu, and wait, until the image is reloaded. The part you selected is filled with black color.

8. Creating Movies

It might happen that you'd like to create a short movie, e.g. for presentations, showing your 3D world rotating or zooming. This is also possible. To do that, Click in the menu on "Start recording", then select ImageJ's Hand tool, rotate your content, and click on "Stop recording". An image stack opens, showing your rotation from slide to slide. You can store this stack as a movie file by saving it in AVI format.

Using ImageJ's GIF Stack Writer you can also create animated GIFs like the one you see above.

If you want a smoother movie, you can animate the 3D world. This will rotate the world about a vertical axis at the origin. Note that if you have moved objects in the 3D world, the vertical axis through the origin might no longer pass the center of the object. Animation is started and stopped using the commands from the "3D Viewer" menu.

9. Macro language

The 3D Viewer now also supports ImageJ's macro language. Download this example to see how this works. Of course you can also just record it as a macro to see the commands.

| Back |