Show_Legend
 
Author: Bob Dougherty (rpd@optinav.com
Installation: Download ( Show_Legend.class and Show_Legend$LegendWindow.class  ) or Show_Legend.java into the Plugins folder.
Description: ImageJ plugin to display a legend for an image.

Use Setup to adjust the appearance of the legend.  Choose "None" for the color of a feature to remove it.

When the image has changed,  the legend in the plugin's window can be updated by pressing "Redraw."

As requested by Gary Chinga, a copy of the legend can be destructively inserted into the image by pressing Insert.  The radio buttons determine which corner of the image gets the legend.  If a selection (ROI) exists in the image window, then the legend will be positioned at the location of the ROI regardless of which radio button is depressed.  (This idea was stolen from Wayne Rasband's Scale Bar plugin.)

The colors of the lines, text, and fill of the inserted legend may not match the colors shown in the plugin window if the LUT of the image does not contain those colors.

To remove a legend from the image, press unInsert.  This should be done before any other changes are made, since unInsert simply replaces the current image with the image that existed just before the most recent legend insertion.

A similar function to Show Legend is now built into ImageJ: Analyze->Tools->Calibration Bar.... 

ImageJ can be freely downloaded from the ImageJ web site.

Versions: 0: 4/14/2002
1: 6/14/2002  Major revision.  Added the ability to insert the legend into the image and more controls.
2: 6/15/2002  Added controls to adjust colors and permit features to be removed.  Made the box width automatic.
3: 6/17/2002  Default number of decimal places = 0.  Option for manual box width.
3.1 10/6/2004  Updated ROI removing code to call ip.resetRoi();.
License:

Copyright (c) 2002, 2005, OptiNav, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of OptiNav, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.