[kepler-dev] ImageJ Actor

Dan Higgins higgins at nceas.ucsb.edu
Wed Sep 15 11:30:31 PDT 2004


Hi All,

    Image Processing is one area that is often useful in scientific 
analysis. This includes operations as simple as displaying various types 
of images, displaying data as images, changing size and orientaion of 
images, image enhancement/filtering,  counting items in images, etc.  
Ptolemy/Kepler does have some image processing capabilities, but there 
are some other projects that have already implemented a number of 
features that currently do no exist in any Kepler actors.

    In particular, I am referring to a project called ImageJ from NIH 
(http://rsb.info.nih.gov/ij/index.html). The capabilities of ImageJ are 
quite extensive as indicated in the features list shown below. ImageJ is 
completely written in Java and has a nice interactive interface combined 
with a macro language that allows specific image processing operations 
to be recorded and automatically run.

    As an example, I used ImageJ to open the large (12.7 MB) 
garpoutput.bmp file created by the existing garp workflow (7204x3604 
pixels). IMageJ automatically displays it in a window at 16.7% reolution 
, so the entire world is visible. I then resized it to 640 pixels across 
with the result shown below. This capability alone would be useful, but 
there are numberous other features.

    For demonstration purposes, I hava created an ImageJActor sink for 
use in Kepler. This actor will take an image filename input and use 
ImageJ to display the image. It also displays the ImageJ window/menu 
that allows various interactive operations on the image (and other 
images can be opened).

    The approach used for displaying the image and ImageJ controller 
window is 'borrowed' from an ImageJ applet. This is problematic because 
it ignores Ptolemy's window handling code and just creats its own 
windows. One could better integrate the displays with Ptolemy (probably 
requiring a fair amount of work) or launch ImageJ using a new JVM (which 
would avoid problems with threading).

    Currently, an ImageJActor has been added to the head of CVS. The 
actor appears under kepler/Util. You can create a workflow with only the 
ImageJActor (and a director) and then execute it. (Add an image if you 
want it to display one intially.) The ImageJ window/menu shold appear 
even without any other actors and you can try out the various capabilities.


--- from ImageJ web site


  ImageJ Features

*Runs Everywhere:*
    ImageJ runs on Linux, Mac OS 9, Mac OS X and Windows. 
*Data Types:*
    8-bit grayscale or indexed color, 16-bit unsigned integer, 32-bit
    floating-point and 32-bit RGB color. 
*File Formats:*
    Open and save all supported data types as TIFF (uncompressed) or as
    raw data. Open and save GIF, JPEG, BMP and ASCII. Open DICOM, FITS
    and PGM. Open TIFFs, GIFs, JPEGs and raw data using a URL. 
*Speed:*
    ImageJ is the world's fastest pure Java image processing program. It
    can filter a 2048x2048 image in 0.1 seconds (*
    <http://rsb.info.nih.gov/ij/features.html#footnote>). That's 40
    million pixels per second! 
*Macros:*
    Automate tasks and create custom tools using macros. More than 70
    example macros <http://rsb.info.nih.gov/ij/macros/> are available on
    the ImageJ Web site (readme
    <http://rsb.info.nih.gov/ij/macros/AA_ReadMe.txt>). 
*Plugins:*
    Extend ImageJ by developing plugins using ImageJ's built in command
    recorder, editor and Java compiler. Over 100 plugins
    <http://rsb.info.nih.gov/ij/plugins/> are available. 
*Toolkit:*
    Use ImageJ as a image processing toolkit (class library) to develop
    applets, servlets <http://rsb.info.nih.gov/ij/applets.html> or
    applications. 
*Image display:*
    Tools <http://rsb.info.nih.gov/ij/docs/tools.html> are provided for
    zooming (1:32 to 32:1) and scrolling images. All analysis and
    processing functions work at any magnification factor. 
*Regions of Interest:*
    Create rectangular, elliptical or irregular regions of interest
    (ROIs). Draw, fill, clear, filter or measure ROIs. Transfer an ROI
    to another image. 
*Image Enhancement:*
    Supports smoothing, sharpening, edge detection, median filtering and
    thresholding on both 8-bit grayscale and RGB color images.
    Interactively adjust brightness and contrast of 8, 16 and 32-bit
    images. 
*Geometric Operations:*
    Crop, scale, resize and rotate. Flip vertically or horizontally. 
*Analysis:*
    Measure area, mean, standard deviation, min and max of ROI or entire
    image. Measure lengths and angles. Use real world measurement units
    such as millimeters. Calibrate using density standards. Generate
    histograms and profile plots. 
*Editing:*
    Cut, copy or paste images or selections. Paste using AND, OR, XOR or
    "Blend" modes. Add text, arrows, rectangles, ellipses or polygons to
    images. 
*Color Processing:*
    Split a 32-bit color image into RGB or HSV components. Merge 8-bit
    components into a color image. Convert an RGB image to 8-bit indexed
    color. Apply pseudo-color palettes to grayscale images. 
*Stacks:*
    Display a "stack" of related images in a single window. Process an
    entire stack using a single command. Open a folder of images as a
    stack. Save stacks as multi-image TIFF files.


Reduced size image created from the large Garp BMP file


Sample showing ImageJ menuing system

-- 
*******************************************************************
Dan Higgins                                  higgins at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Ph: 805-892-2531
National Center for Ecological Analysis and Synthesis (NCEAS) 
735 State Street - Room 205
Santa Barbara, CA 93195
*******************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/kepler-dev/attachments/20040915/a4b9f9fb/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: garpoutput.gif
Type: image/gif
Size: 8588 bytes
Desc: not available
Url : http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/kepler-dev/attachments/20040915/a4b9f9fb/garpoutput.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ImageJ.gif
Type: image/gif
Size: 16065 bytes
Desc: not available
Url : http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/kepler-dev/attachments/20040915/a4b9f9fb/ImageJ.gif


More information about the Kepler-dev mailing list