Search in sources :

Example 1 with Mask

use of ome.xml.model.Mask in project bioformats by openmicroscopy.

the class PrintROIs method printShape.

/**
 * Print the given shape.
 */
public static void printShape(Shape shapeObject) {
    if (shapeObject instanceof Ellipse) {
        Ellipse ellipse = (Ellipse) shapeObject;
        System.out.println("    Ellipse:");
        System.out.println("      Text = " + ellipse.getText());
        System.out.println("      X = " + ellipse.getX());
        System.out.println("      Y = " + ellipse.getY());
        System.out.println("      Radius (X) = " + ellipse.getRadiusX());
        System.out.println("      Radius (Y) = " + ellipse.getRadiusY());
    } else if (shapeObject instanceof Line) {
        Line line = (Line) shapeObject;
        System.out.println("    Line:");
        System.out.println("      Text = " + line.getText());
        System.out.println("      X1 = " + line.getX1());
        System.out.println("      Y1 = " + line.getY1());
        System.out.println("      X2 = " + line.getX2());
        System.out.println("      Y2 = " + line.getY2());
    } else if (shapeObject instanceof Point) {
        Point point = (Point) shapeObject;
        System.out.println("    Point:");
        System.out.println("      Text = " + point.getText());
        System.out.println("      X = " + point.getX());
        System.out.println("      Y = " + point.getY());
    } else if (shapeObject instanceof Polyline) {
        Polyline polyline = (Polyline) shapeObject;
        System.out.println("    Polyline:");
        System.out.println("      Text = " + polyline.getText());
        System.out.println("      Points = " + polyline.getPoints());
    } else if (shapeObject instanceof Polygon) {
        Polygon polygon = (Polygon) shapeObject;
        System.out.println("    Polygon:");
        System.out.println("      Text = " + polygon.getText());
        System.out.println("      Points = " + polygon.getPoints());
    } else if (shapeObject instanceof Rectangle) {
        Rectangle rectangle = (Rectangle) shapeObject;
        System.out.println("    Rectangle:");
        System.out.println("      Text = " + rectangle.getText());
    } else if (shapeObject instanceof Mask) {
        Mask mask = (Mask) shapeObject;
        System.out.println("    Mask:");
        System.out.println("      Text = " + mask.getText());
        System.out.println("      X = " + mask.getX());
        System.out.println("      Y = " + mask.getY());
        System.out.println("      Width = " + mask.getWidth());
        System.out.println("      Height = " + mask.getHeight());
    } else if (shapeObject instanceof Label) {
        Label text = (Label) shapeObject;
        System.out.println("    Label:");
        System.out.println("      Text = " + text.getText());
        System.out.println("      X = " + text.getX());
        System.out.println("      Y = " + text.getY());
    }
}
Also used : Line(ome.xml.model.Line) Ellipse(ome.xml.model.Ellipse) Polyline(ome.xml.model.Polyline) Rectangle(ome.xml.model.Rectangle) Mask(ome.xml.model.Mask) Label(ome.xml.model.Label) Point(ome.xml.model.Point) Polygon(ome.xml.model.Polygon)

Aggregations

Ellipse (ome.xml.model.Ellipse)1 Label (ome.xml.model.Label)1 Line (ome.xml.model.Line)1 Mask (ome.xml.model.Mask)1 Point (ome.xml.model.Point)1 Polygon (ome.xml.model.Polygon)1 Polyline (ome.xml.model.Polyline)1 Rectangle (ome.xml.model.Rectangle)1