- java.lang.Object
-
- ij.gui.Overlay
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Overlayadd(Overlay overlay2)Adds the ROIs in 'overlay2' to this overlay.voidadd(Roi roi)Adds an ROI to this Overlay.voidadd(Roi roi, java.lang.String name)Adds an ROI to this Overlay using the specified name.voidaddElement(Roi roi)Adds an ROI to this Overlay.voidclear()Removes all the ROIs in this Overlay.booleancontains(Roi roi)Returns 'true' if this Overlay contains the specified ROI.Overlaycreate()Returns a new Overlay that has the same properties as this one.static OverlaycreateStackOverlay(Roi[] rois)voidcrop(int firstSlice, int lastSlice)Removes ROIs having positions outside of the interval defined by firstSlice and lastSlice.voidcrop(int firstC, int lastC, int firstZ, int lastZ, int firstT, int lastT)Removes ROIs having a C, Z or T coordinate outside the volume defined by firstC, lastC, firstZ, lastZ, firstT and lastT.Overlaycrop(java.awt.Rectangle bounds)voiddrawBackgrounds(boolean b)voiddrawLabels(boolean b)voiddrawNames(boolean b)Overlayduplicate()Returns a clone of this Overlay.voidfill(ImagePlus imp, java.awt.Color foreground, java.awt.Color background)Fills all the ROIs in this overlay with 'foreground' after clearing the the image to 'background' if it is not null.Roiget(int index)Returns the ROI with the specified index or null if the index is invalid.Roiget(java.lang.String name)Returns the ROI with the specified name or null if not found.booleangetDrawBackgrounds()booleangetDrawLabels()booleangetDrawNames()intgetIndex(java.lang.String name)Returns the index of the ROI with the specified name, or -1 if not found.java.awt.ColorgetLabelColor()java.awt.FontgetLabelFont()intindexAt(int x, int y)Returns the index of the last ROI that contains the point (x,y) or null if no ROI contains the point.booleanisCalibrationBar()booleanisDraggable()Returns 'true' if ROIs in this overlay can be dragged by their labels.booleanisSelectable()Returns 'true' if ROIs in this overlay can be activated by clicking on their labels or by a long press.java.util.Iterator<Roi>iterator()ResultsTablemeasure(ImagePlus imp)Measures the ROIs in this overlay on the specified image and returns the results as a ResultsTable.voidremove(int index)Removes the ROI with the specified index from this Overlay.voidremove(Roi roi)Removes the specified ROI from this Overlay.voidremove(java.lang.String name)Removes all ROIs that have the specified name.Overlayrotate(double angle, double xcenter, double ycenter)Returns a rotated version of this Overlay.booleanscalableLabels()Overlayscale(double xscale, double yscale)Returns a scaled version of this Overlay.voidselectable(boolean selectable)Set 'false' to prevent ROIs in this overlay from being activated by clicking on their labels or by a long clicking.voidset(Roi roi, int index)Replaces the ROI at the specified index.voidsetDraggable(boolean draggable)Set 'false' to prevent ROIs in this overlay from being dragged by their labels.voidsetFillColor(java.awt.Color color)Sets the fill color of all the ROIs in this overlay.voidsetIsCalibrationBar(boolean b)voidsetLabelColor(java.awt.Color c)voidsetLabelFont(java.awt.Font font)voidsetLabelFont(java.awt.Font font, boolean scalable)voidsetLabelFontSize(int size, java.lang.String options)Set the label font size with options.voidsetStrokeColor(java.awt.Color color)Sets the stroke color of all the ROIs in this overlay.voidsetStrokeWidth(java.lang.Double width)Sets the stroke width of all the ROIs in this overlay.intsize()Returns the number of ROIs in this Overlay.Roi[]toArray()Returns on array containing the ROIs in this Overlay.Roi[]toArray(int[] indexes)Returns on array containing the ROIs with the specified indexes.java.lang.StringtoString()voidtranslate(double dx, double dy)Moves all the ROIs in this overlay.voidtranslate(int dx, int dy)Moves all the ROIs in this overlay.static voidupdateTableOverlay(ImagePlus imp, int first, int last, int tableSize)Updates overlays created by the particle analyzer after rows are deleted from the Results table.Roixor(int[] indexes)Returns the bounds of this overlay.
-
-
-
Constructor Detail
-
Overlay
public Overlay()
Constructs an empty Overlay.
-
Overlay
public Overlay(Roi roi)
Constructs an Overlay and adds the specified ROI.
-
-
Method Detail
-
add
public void add(Roi roi)
Adds an ROI to this Overlay.
-
add
public void add(Roi roi, java.lang.String name)
Adds an ROI to this Overlay using the specified name.
-
addElement
public void addElement(Roi roi)
Adds an ROI to this Overlay.
-
set
public void set(Roi roi, int index)
Replaces the ROI at the specified index.
-
remove
public void remove(int index)
Removes the ROI with the specified index from this Overlay.
-
remove
public void remove(Roi roi)
Removes the specified ROI from this Overlay.
-
remove
public void remove(java.lang.String name)
Removes all ROIs that have the specified name.
-
clear
public void clear()
Removes all the ROIs in this Overlay.
-
get
public Roi get(int index)
Returns the ROI with the specified index or null if the index is invalid.
-
get
public Roi get(java.lang.String name)
Returns the ROI with the specified name or null if not found.
-
getIndex
public int getIndex(java.lang.String name)
Returns the index of the ROI with the specified name, or -1 if not found.
-
indexAt
public int indexAt(int x, int y)Returns the index of the last ROI that contains the point (x,y) or null if no ROI contains the point.
-
contains
public boolean contains(Roi roi)
Returns 'true' if this Overlay contains the specified ROI.
-
size
public int size()
Returns the number of ROIs in this Overlay.
-
toArray
public Roi[] toArray()
Returns on array containing the ROIs in this Overlay.
-
toArray
public Roi[] toArray(int[] indexes)
Returns on array containing the ROIs with the specified indexes.
-
setStrokeColor
public void setStrokeColor(java.awt.Color color)
Sets the stroke color of all the ROIs in this overlay.
-
setStrokeWidth
public void setStrokeWidth(java.lang.Double width)
Sets the stroke width of all the ROIs in this overlay.
-
setFillColor
public void setFillColor(java.awt.Color color)
Sets the fill color of all the ROIs in this overlay.
-
translate
public void translate(int dx, int dy)Moves all the ROIs in this overlay.
-
translate
public void translate(double dx, double dy)Moves all the ROIs in this overlay. Marcel Boeglin, October 2013
-
measure
public ResultsTable measure(ImagePlus imp)
Measures the ROIs in this overlay on the specified image and returns the results as a ResultsTable.
-
crop
public Overlay crop(java.awt.Rectangle bounds)
-
crop
public void crop(int firstSlice, int lastSlice)Removes ROIs having positions outside of the interval defined by firstSlice and lastSlice. Marcel Boeglin, September 2013
-
crop
public void crop(int firstC, int lastC, int firstZ, int lastZ, int firstT, int lastT)Removes ROIs having a C, Z or T coordinate outside the volume defined by firstC, lastC, firstZ, lastZ, firstT and lastT. Marcel Boeglin, September 2013
-
xor
public Roi xor(int[] indexes)
Returns the bounds of this overlay.
-
create
public Overlay create()
Returns a new Overlay that has the same properties as this one.
-
duplicate
public Overlay duplicate()
Returns a clone of this Overlay.
-
scale
public Overlay scale(double xscale, double yscale)
Returns a scaled version of this Overlay.
-
rotate
public Overlay rotate(double angle, double xcenter, double ycenter)
Returns a rotated version of this Overlay.
-
drawLabels
public void drawLabels(boolean b)
-
getDrawLabels
public boolean getDrawLabels()
-
drawNames
public void drawNames(boolean b)
-
getDrawNames
public boolean getDrawNames()
-
drawBackgrounds
public void drawBackgrounds(boolean b)
-
getDrawBackgrounds
public boolean getDrawBackgrounds()
-
setLabelColor
public void setLabelColor(java.awt.Color c)
-
getLabelColor
public java.awt.Color getLabelColor()
-
setLabelFont
public void setLabelFont(java.awt.Font font)
-
setLabelFont
public void setLabelFont(java.awt.Font font, boolean scalable)
-
setLabelFontSize
public void setLabelFontSize(int size, java.lang.String options)Set the label font size with options. The options string can contain 'scale' (enlarge labels when image zoomed), 'bold' (display bold labels) or 'background' (display labels with contrasting background.
-
getLabelFont
public java.awt.Font getLabelFont()
-
setIsCalibrationBar
public void setIsCalibrationBar(boolean b)
-
isCalibrationBar
public boolean isCalibrationBar()
-
fill
public void fill(ImagePlus imp, java.awt.Color foreground, java.awt.Color background)
Fills all the ROIs in this overlay with 'foreground' after clearing the the image to 'background' if it is not null.
-
selectable
public void selectable(boolean selectable)
Set 'false' to prevent ROIs in this overlay from being activated by clicking on their labels or by a long clicking.
-
isSelectable
public boolean isSelectable()
Returns 'true' if ROIs in this overlay can be activated by clicking on their labels or by a long press.
-
setDraggable
public void setDraggable(boolean draggable)
Set 'false' to prevent ROIs in this overlay from being dragged by their labels.
-
isDraggable
public boolean isDraggable()
Returns 'true' if ROIs in this overlay can be dragged by their labels.
-
scalableLabels
public boolean scalableLabels()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
updateTableOverlay
public static void updateTableOverlay(ImagePlus imp, int first, int last, int tableSize)
Updates overlays created by the particle analyzer after rows are deleted from the Results table.
-
-