edu.jhu.tmaj.beans.masks.lasso
Class Lasso
java.lang.Object
edu.jhu.tmaj.beans.masks.lasso.Lasso
- All Implemented Interfaces:
- java.io.Serializable
public final class Lasso
- extends java.lang.Object
- implements java.io.Serializable
A data class for storing free hand Lassos the user draws on an image.
ImageJ calls these free hand lassos "irregular Rois".
If the user draws 1 shape, ImageJ calls it a PolygonRoi.
If the user draws 2 or more shapes, ImageJ calls it a ShapeRoi.
PolygonRoi's "data field" is a Polygon.
ShapeRoi's "data field" is a float array.
We need a "data field" because we will need to write this to XML.
We don't want to serialize PolygonRoi or ShapeRoi since that might change between
ImageJ versions, and it wouldn't be a text file (which couldn't be part of our XML file.)
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getPolygonLasso
public static Lasso getPolygonLasso(java.awt.Polygon polygon)
getGenericShapeLasso
public static Lasso getGenericShapeLasso(float[] shapeData)
getInstanceFromRoi
public static Lasso getInstanceFromRoi(ij.gui.Roi roi)
isGenericShape
public boolean isGenericShape()
getRoi
public ij.gui.Roi getRoi()
getPolygon
public java.awt.Polygon getPolygon()
getShapeArray
public float[] getShapeArray()
polygonToString
public static java.lang.String polygonToString(java.awt.Polygon polygon)
floatArrayToString
public static java.lang.String floatArrayToString(float[] shapeData)
stringToFloatArray
public static float[] stringToFloatArray(java.lang.String shapeDataString)
stringToPolygon
public static java.awt.Polygon stringToPolygon(java.lang.String shapeDataString)