ij-VTK: the Visualization ToolKit for ImageJ

The goal of the ij-VTK module is to bring the power of the Visualization ToolKit (VTK) to ImageJ. The ij-VTK will provide benefits for ImageJ users and for developers of ImageJ plugins:

Why VTK and C++, and no pure Java solution?

3D visualization, of biomedical data in particular, is a complex process relying on sophisticated algorithms and techniques. There are some pure Java solutions available, for instance VolumeJ and SurfaceJ plugins from Michael Abramoff. However, there is no tool or library that can match versatility of VTK (suggestions of possibly overlooked options are very welcome, post comments at ij-plugins user's list or forum, optinally contact directly the project's admin).

The Visualization ToolKit (VTK) is an open source, freely available software system for 3D computer graphics, image processing, and visualization. VTK consists of a C++ class library, and several interpreted interface layers including Tcl/Tk, Java, and Python. VTK supports a wide variety of visualization algorithms including scalar, vector, tensor, texture, and volumetric methods; and advanced modeling techniques such as implicit modelling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay triangulation.

Rather than reinventing the wheel (a "pure Java" solution), the ij-VTK attempts to make the best use of already available and proven visualization solution. This may not satisfy needs of every ImageJ user, especially those on platforms that currently do not have complete VTK support for Java (e.g. Mac OS X 10.2 and earlier). However, reuse rather than redevelopment enables an optimal utilization of resources available to this project, to deliver new visualization functionality to many, if not most, ImageJ users.

Similar to ImageJ, VTK have very active user/developer community. It is foreseeable that with enough interest platforms like Mac OS X 10.2 will have its VTK support improved. This even may no longer be an issue in newer Mac OS and Java version, like Mac OS X 10.3 and upcoming Java 1.5 (tiger) with revamped support for native graphics.

The Big Picture

ij-VTK consists of two main parts: ij-VTK Core Utilities and ij-VTK Plugins for ImageJ. The following diagram illustrates relationship between ij-VTK, VTK, ImageJ, and ij-plugins Toolkit (core library of the ij-plugins project):

[VTK big picture]

VTK does contain wrappers that enable its use from Java. However, VTK uses event handling, error reporting, and display access that is not very familiar to Java developers. ij-VTK will contain support classes aimed at simplifying VTK use from Java and ImageJ.

ij-VTK does depend on operating system specific VTK's native libraries. "Standard" installation of VTK typically requires compilation of VTK C++ source code and a tricky setup of system variables.

ij-VTK aims at simplifying VTK setup by providing all required VTK binaries in an easy to install package customized for ImageJ users. The initial goal is to provide binaries for Linux and MS Windows. Volunteers are needed for creation, testing, and maintenance of binaries for other operating systems.

ij-VTK Core Utilities

The Core Utilities will provide functionality aimed primarily at accessing VTK through paradigms similar to Java beans or Swing GUI library. For instance, VTK callback functions for event handling will be wrapped using event listener interfaces similar to those used by Swing components. Here is some of the functionality planned for ij-VTK Core Utilities:

  • Wrapper listener for events generated by individual VTK objects

  • Monitoring of progress of VTK pipeline execution - aggregation of progress generated by individual VTK objects

  • Data transfer between Java side and C++ side

  • VTK actor property editors

  • Top level monitoring of VTK errors and warnings (after release 1.0, requires custom JNI/C++ code)

  • Screen capture (after release 1.0)

  • VTK pipeline editors (after release 1.0)

ij-VTK Plugins for ImageJ

All visual plugins will support interactive rotating, zooming, and panning of displayed 3D data and high resolution screen capture in TIFF format. Some of the planed plugins:

  • Volume rendering of 3D image data

    • Interactive editing of transfer function

    • Interactive volume clipping using re-sizable box widget

  • Surface rendering of 3D image data

  • Image filters for 2D and 3D processing (non-visual plugins)

  • Surface plots for 2D images (after release 1.0)

  • Color histograms and 3D color space visualization: RGB, CIE Lab, HSB (after release 1.0)

FAQ

  • Q: vtkPanel blank on start up, have to manually resize to show content -
    A: use -Dsun.java2d.noddraw=true option for JVM

Other Visualization Plugins for ImageJ

  • The ImageJ 3D viewer provides a plugin for ImageJ to visualize image stacks three-dimensionally. The most important features include: display stacks as volume renderings, iso-surfaces, orthoslices or surface plots; volume editing; landmark selection; rigid registration, based on manually selected landmarks; displaying 4D data.
  • VolumeJ and SurfaceJ - volume rendering. [Michael Abramoff]
  • 3D Surface Plotter - Generates static 3D surface plots. Works best with small images or small selections. Smoothing the image may improve the quality of the plot. Viewing angle have to be decided before a plot is created. [Wayne Rasband]
  • Image Layering Toolbox - This plugin does transparent image composition and creates contour maps. [Karl Schmidt]
  • Contour Plotter - Draws contour lines in the user-defined color and at the user-defined levels. Works on stacks also. [Walter O'Dell]
  • Dynamic Profiler - This plugin continuously updates a profile plot as a line or rectangular selection is moved or resized. [Wayne Rasband]
  • Z Profiler - This plugin continuously updates a profile plot through the z-axis as a line, rectangular or oval selection is moved or resized. [Kevin (Gali) Baler and Wayne Rasband]