Class MaskWrapper


public class MaskWrapper extends GenericShapeWrapper<MaskData>
Class containing an MaskData.

Wraps function calls to the MaskData contained.

  • Constructor Details

    • MaskWrapper

      public MaskWrapper(MaskData mask)
      Constructor of the MaskWrapper class using a MaskData.
      Parameters:
      mask - The MaskData to wrap.
    • MaskWrapper

      public MaskWrapper()
      Constructor of the MaskWrapper class using a new empty MaskData.
    • MaskWrapper

      public MaskWrapper(double x, double y, double width, double height, byte[] mask)
      Constructor of the MaskWrapper class using a new MaskData.
      Parameters:
      x - The x-coordinate of the top-left corner of the image.
      y - The y-coordinate of the top-left corner of the image.
      width - The width of the image.
      height - The height of the image.
      mask - The mask image.
  • Method Details

    • getText

      public String getText()
      Gets the text on the ShapeData.
      Specified by:
      getText in class GenericShapeWrapper<MaskData>
      Returns:
      the text
    • setText

      public void setText(String text)
      Sets the text on the ShapeData.
      Specified by:
      setText in class GenericShapeWrapper<MaskData>
      Parameters:
      text - the text
    • toAWTShape

      public Shape toAWTShape()
      Converts the shape to an Shape.
      Specified by:
      toAWTShape in class GenericShapeWrapper<MaskData>
      Returns:
      The converted AWT Shape.
    • getX

      public double getX()
      Returns the x-coordinate of the top-left corner of the mask.
      Returns:
      See above.
    • setX

      public void setX(double x)
      Sets the x-coordinate top-left corner of an untransformed mask.
      Parameters:
      x - The value to set.
    • getY

      public double getY()
      Returns the y-coordinate of the top-left corner of the mask.
      Returns:
      See above.
    • setY

      public void setY(double y)
      Sets the y-coordinate top-left corner of an untransformed mask.
      Parameters:
      y - See above.
    • getWidth

      public double getWidth()
      Returns the width of the mask.
      Returns:
      See above.
    • setWidth

      public void setWidth(double width)
      Sets the width of an untransformed mask.
      Parameters:
      width - See above.
    • getHeight

      public double getHeight()
      Returns the height of the mask.
      Returns:
      See above.
    • setHeight

      public void setHeight(double height)
      Sets the height of an untransformed mask.
      Parameters:
      height - See above.
    • getMaskAsBinaryArray

      public int[][] getMaskAsBinaryArray()
      Returns the mask image.
      Returns:
      See above.
    • getMask

      public byte[] getMask()
      Returns the mask as a byte array.
      Returns:
      See above.
    • setMask

      public void setMask(byte[] mask)
      Sets the mask image.
      Parameters:
      mask - See above.
    • setMask

      public void setMask(int[][] mask)
      Sets the mask
      Parameters:
      mask - The binary mask (int[width][height])
    • setMask

      public void setMask(boolean[][] mask)
      Sets the mask
      Parameters:
      mask - The binary mask (boolean[width][height])
    • setCoordinates

      public void setCoordinates(double x, double y, double width, double height)
      Sets the coordinates of the MaskData shape.
      Parameters:
      x - The x-coordinate of the top-left corner.
      y - The y-coordinate of the top-left corner.
      width - The width of the rectangle.
      height - The height of the rectangle.
    • getCoordinates

      public double[] getCoordinates()
      Gets the coordinates of the MaskData shape.
      Returns:
      Array of coordinates containing {X,Y,Width,Height}.
    • setCoordinates

      public void setCoordinates(double[] coordinates)
      Sets the coordinates of the MaskData shape.
      Parameters:
      coordinates - Array of coordinates containing {X,Y,Width,Height}.
    • toImageJ

      public Roi toImageJ()
      Converts shape to ImageJ ROI.
      Overrides:
      toImageJ in class GenericShapeWrapper<MaskData>
      Returns:
      An ImageJ ROI.