A specific plug-in is being developed to provide SAMP connection and receive data from other VO tools.
This development also improves the support of fits files and compress formats in ImageJ.

With SAMP connection, ImageJ will provide extended visualization, format conversion, and image processing functions to the VO.

First development in 2017 (EPN2020)

This requires a version of ImageJ running under java 1.8 (v 1.51 at this point)
Note: this was broken with later version v1.53 - see below for an update

Installation procedure

Usage

Launch ImageJ on your machine and click on new menu item SAMP > SAMP to register it to the Hub (no need to launch TOPCAT first). ImageJ will now receive images sent to the SAMP Hub by other VO applications.
ImageJ will accept fits, jpeg, png, and tiff images, among others. More fits images are now supported, including multi-extension files. Tiff images are prime products in some EPN-TAP services (from digitized photographic plates, e.g., BDIP) but are not usually viewable in a web browser.

For the time being, ImageJ cannot send back images to the Hub. Results have to be stored on the user machine in a VO compliant format (eg, fits, jpg, or png), and possibly loaded in another environment.

A manual of ImageJ in astronomical context is available here: http://www.astro.physik.uni-goettingen.de/~hessman/ImageJ/Book/
Additional plugins of interest include:
http://www.astro.physik.uni-goettingen.de/~hessman/ImageJ/Astronomy/



Use cases:

- ImageJ is now a VO viewer for Tiff images (provided e.g. by the BDIP data service)

- Any image sent to ImageJ can benefit from image processing functions

- Image format can be modified on output (via Save As…), providing effective format conversion functionalities.
Additional type conversions (e.g. 16 to 8 bits, stacking/unstacking, etc) are accessible via menu item Image > Type
Any B&W image can be saved as fits with a minimal header - beware that for fits images, the original header is lost (including WCS)
Saved images can be reopened in a VO tool or a computing environment such as IDL

Usage

From the VESPA search interface

On a service result page, select one or more lines (dataproduct_type must be "image") and click the Selected Data > Send Images button (bottom left).
A progress bar is located on the small ImageJ palette during loading of large images (related to each frame for stacks).

From VESPA, many image formats (Fits, JPG, PNG, TIFF, at least) will be samped to ImageJ

• Ex in APIS:

Uranus_-_2011_09-29_Nov/obrx18hbq_pol_s.fits
Jupiter_-_1999_14-16_Aug/o5g202x4q_proc.fits    are OK
Uranus_-_2011_09-29_Nov/obrx18hbq_x2d.fits        (multi-extension fits file - this loads as a stack of images with multiple frames)

• Geotiff images are not supported (included in CRISM service or provided via WMS links) - but versions converted to geofits via Gdal are OK (Chiara's routines).

Compressed images such as *.fts.bz2 from CLIMSO are not handled (even with commons-compress installed)
   - A workaround is to samp them to Aladin, then from Aladin to ImageJ

From Aladin

Images can be samped to ImageJ via the menu items:

Interop > Broadcast selected plane
Interop > Broadcast selected image to…

However Aladin will only samp fits-formatted images (since the official MTYPE is image.load.fits); the menu items will be dimmed otherwise

From TOPCAT

Load a table providing links to images (can be a metadata table from a VESPA result page)
Click "Activation Action" in the main window
In the Set Activation Action window, click View URL as Image and identify the column including the link (access_url or thumbnail_url for an EPN-TAP service); select either All Clients or ImageJ in the Image Viewer menu

The image will be sent to ImageJ on mouse click
   - if this does not work, check the Activation Action value in the main window; if set to (no action) try to open/close it again (by clicking the OK button)

From TOPCAT many image formats (Fits, JPG, GIF, TIFF at least) will be samped to ImageJ (no need to select an image type in the Activation window)

Possible developments

√ • Autostart the hub connection at launch (like in Aladin, with optional switch)

• Grab the cursor position and send it to / from Aladin via SAMP

• Send back images/results via SAMP - there are use cases for transforms that do not affect image size, but this is difficult for fits images if dimensions are changed (WCS nearly impossible to maintain)

• Better support of compressed files (from CLIMSO)

• Support of VOtable in I/O to store analysis results and load them. The current .xls output files can be loaded in TOPCAT as csv format.

• Check if ImageJ has the ability to compute and return an average of consecutive lines/columns, or averages in the third dimension - this would address many on-line comparison difficulties (e.g., local means of dynamic spectra from APIS, and comparison between MCD and Spicam profiles - the latter would be restricted to cubes however).

√ • Possible usage in AstroImageJ? Does not work on 3.2.0 (error when launching SAMP)

• Support for geofits, ie complete WCS including planetary frames & Chiara's additional keywords - should in particular return coordinates on the surface of current body (ie: VELN, VELT for Venus) - currently no support at all (and AstroImageJ only support RA/DEC, no planetary coord).


Update in Dec 2022 (EPN2024)

The current version of ImageJ is v 1.53, which is slightly different from v1.51 previously used. The previous plugin no longer works with the current version.
Version 1.53t (Aug 2022) is used for this test, together with AstroImageJ version 5.1.3.

Installation procedure

The plugin can also be used with recent versions of AstroImageJ (tested on v5.1.3). The installation is identical (on Mac at least, to directory Resources/plugins/jars)

- At this point the plugin is still monolithic: uses its own fits support when data are transferred via SAMP - not a good idea. In particular, the fits plugin is not required for AstroImageJ which has better fits support (headers and WCS).

Usage

Launch ImageJ on your machine. The SAMP Hub should start automatically and ImageJ will receive images sent there by other VO applications.  Click on new menu item SAMP > SAMP to start the Hub again if you've closed it manually.
ImageJ will accept fits, jpeg, png, and tiff images, among others. More fits images are now supported, including multi-extension files. Tiff images are prime products in some EPN-TAP services (from digitized photographic plates, e.g., BDIP) but are not usually viewable in a web browser.

For the time being, ImageJ cannot send back images to the Hub. Results have to be stored on the user machine in a VO compliant format (eg, fits, jpg, or png), and possibly loaded in another environment.

Prospects (oct 2023)

- Split the plugin in two, to support SAMP and fits independently

- Send back processing outcome to other VO tools via SAMP, in particular processed images and result tables

- Support VOTables in I/O to store analysis results.The current .xls output files can be loaded in TOPCAT in csv format (?)
     AstroImageJ reads csv but can only write tabulated ascii (can be read by TOPCAT though)

- Support of compressed images such as *.fits.bz2 (supported in Aladin) (beware that such files from the CLIMSO service are not currently images, but error messages)

- Support sending time series from VO services to AstroImageJ (e.g. from BASS2000)

- Grab the cursor position and send it to / from Aladin via SAMP

- Assess functioning with v1.54 (Jan 2023) and various OS

- SAMPing from VESPA portal seems much slower than to DS9

- AstroImageJ does not seem to understand all WCS (eg, Gaia_DEM, which is solar HPTL/LN)

- (long term) support for planetary WCS (Marmo et al 2018)

- Assess the python interface to the new version ImageJ2, e.g. in Jupyter notebooks