ij.plugin.filter
Class CalibrationBar
java.lang.Object
ij.plugin.filter.CalibrationBar
- All Implemented Interfaces:
- PlugInFilter
public class CalibrationBar
- extends java.lang.Object
- implements PlugInFilter
This plugin displays a calibration bar on the active image.
Bob Dougherty, OptiNav, Inc., 4/14/2002
Based largely on HistogramWindow.java by Wayne Rasband.
Version 0 4/14/2002
Version 1 6/14/2002 Many revisions, including addition of the legend to the image.
Version 2 6/15/2002 Control over colors, including none. Automatic box width.
Version 3 6/17/2002 0 decimal places by default. Option for manual box width.
July 2002: Modified by Daniel Marsh and renamed CalibrationBar.
Fields inherited from interface ij.plugin.filter.PlugInFilter |
CONVERT_TO_FLOAT, DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, FINAL_PROCESSING, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING |
Method Summary |
(package private) void |
calculateWidth()
|
(package private) java.lang.String |
d2s(double d)
|
void |
drawColorBar(ImagePlus imp,
int x,
int y)
|
protected void |
drawColorBar(ImageProcessor ip,
int xOffset,
int yOffset)
|
(package private) int |
drawText(ImageProcessor ip,
int x,
int y,
boolean active)
|
(package private) java.awt.Color |
getColor(java.lang.String color)
|
(package private) int |
getFontHeight()
|
void |
run(ImageProcessor ipPassed)
Filters use this method to process the image. |
int |
setup(java.lang.String arg,
ImagePlus imp)
This method is called once when the filter is loaded. |
void |
verticalColorBar(ImageProcessor ip,
int x,
int y,
int thickness,
int length)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BAR_LENGTH
static final int BAR_LENGTH
- See Also:
- Constant Field Values
BAR_THICKNESS
static final int BAR_THICKNESS
- See Also:
- Constant Field Values
XMARGIN
static final int XMARGIN
- See Also:
- Constant Field Values
YMARGIN
static final int YMARGIN
- See Also:
- Constant Field Values
WIN_HEIGHT
static final int WIN_HEIGHT
- See Also:
- Constant Field Values
BOX_PAD
static final int BOX_PAD
- See Also:
- Constant Field Values
LINE_WIDTH
static final int LINE_WIDTH
- See Also:
- Constant Field Values
nBins
static int nBins
colors
static final java.lang.String[] colors
locations
static final java.lang.String[] locations
UPPER_RIGHT
static final int UPPER_RIGHT
- See Also:
- Constant Field Values
LOWER_RIGHT
static final int LOWER_RIGHT
- See Also:
- Constant Field Values
LOWER_LEFT
static final int LOWER_LEFT
- See Also:
- Constant Field Values
UPPER_LEFT
static final int UPPER_LEFT
- See Also:
- Constant Field Values
AT_SELECTION
static final int AT_SELECTION
- See Also:
- Constant Field Values
fillColor
static java.lang.String fillColor
textColor
static java.lang.String textColor
location
static java.lang.String location
zoom
static double zoom
numLabels
static int numLabels
fontSize
static int fontSize
decimalPlaces
static int decimalPlaces
imp
ImagePlus imp
impOriginal
ImagePlus impOriginal
gd
CalibrationBar.LiveDialog gd
stats
ImageStatistics stats
cal
ij.measure.Calibration cal
histogram
int[] histogram
lut
LookUpTable lut
img
java.awt.Image img
setup
java.awt.Button setup
redraw
java.awt.Button redraw
insert
java.awt.Button insert
unInsert
java.awt.Button unInsert
ne
java.awt.Checkbox ne
nw
java.awt.Checkbox nw
se
java.awt.Checkbox se
sw
java.awt.Checkbox sw
locGroup
java.awt.CheckboxGroup locGroup
value
java.awt.Label value
note
java.awt.Label note
newMaxCount
int newMaxCount
logScale
boolean logScale
win_width
int win_width
userPadding
int userPadding
fontHeight
int fontHeight
boldText
boolean boldText
backupPixels
java.lang.Object backupPixels
byteStorage
byte[] byteStorage
intStorage
int[] intStorage
shortStorage
short[] shortStorage
floatStorage
float[] floatStorage
boxOutlineColor
java.lang.String boxOutlineColor
barOutlineColor
java.lang.String barOutlineColor
impData
ImagePlus impData
ip
ImageProcessor ip
fieldNames
java.lang.String[] fieldNames
insetPad
int insetPad
decimalPlacesChanged
boolean decimalPlacesChanged
CalibrationBar
public CalibrationBar()
setup
public int setup(java.lang.String arg,
ImagePlus imp)
- Description copied from interface:
PlugInFilter
- This method is called once when the filter is loaded. 'arg',
which may be blank, is the argument specified for this plugin
in IJ_Props.txt or in the plugins.config file of a jar archive
containing the plugin. 'imp' is the currently active image.
This method should return a flag word that specifies the
filters capabilities.
For Plugin-filters specifying the FINAL_PROCESSING flag,
the setup method will be called again, this time with
arg = "final" after all other processing is done.
- Specified by:
setup
in interface PlugInFilter
run
public void run(ImageProcessor ipPassed)
- Description copied from interface:
PlugInFilter
- Filters use this method to process the image. If the
SUPPORTS_STACKS flag was set, it is called for each slice in
a stack. With CONVERT_TO_FLOAT, the filter is called with
the image data converted to a FloatProcessor (3 times per
image for RGB images).
ImageJ will lock the image before calling
this method and unlock it when the filter is finished.
For PlugInFilters specifying the NO_IMAGE_REQUIRED flag
and not the DONE flag, run(ip) is called once with the
argument
null
.
- Specified by:
run
in interface PlugInFilter
verticalColorBar
public void verticalColorBar(ImageProcessor ip,
int x,
int y,
int thickness,
int length)
drawColorBar
protected void drawColorBar(ImageProcessor ip,
int xOffset,
int yOffset)
drawText
int drawText(ImageProcessor ip,
int x,
int y,
boolean active)
d2s
java.lang.String d2s(double d)
getFontHeight
int getFontHeight()
getColor
java.awt.Color getColor(java.lang.String color)
calculateWidth
void calculateWidth()
drawColorBar
public void drawColorBar(ImagePlus imp,
int x,
int y)