Class MaskData


  • public class MaskData
    extends ShapeData
    Represents an Mask in the Euclidean space R2.
    Since:
    3.0-Beta4
    • Constructor Detail

      • MaskData

        public MaskData​(omero.model.Shape shape)
        Creates a new instance.
        Parameters:
        shape - The shape this object represents.
      • MaskData

        public MaskData()
        Creates a new instance of MaskData.
      • MaskData

        public MaskData​(double x,
                        double y,
                        double width,
                        double height,
                        byte[] mask)
        Creates a new instance of the 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 Detail

      • getText

        public java.lang.String getText()
        Returns the text of the shape.
        Returns:
        See above.
      • setText

        public void setText​(java.lang.String text)
        Sets the text of the shape.
        Parameters:
        text - See above.
      • 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.
      • setMask

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

        public void setMask​(java.awt.image.BufferedImage image)
        Sets the mask from the bufferedImage.
        Parameters:
        image - See above.
      • getMaskAsBufferedImage

        public java.awt.image.BufferedImage getMaskAsBufferedImage()
        Returns the mask image.
        Returns:
        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.
      • setBit

        public void setBit​(byte[] data,
                           int bit,
                           int val)
        Sets the bit value in a byte array at position bit to be the value value.
        Parameters:
        data - See above.
        bit - See above.
        val - See above.
      • getBit

        public byte getBit​(byte[] data,
                           int bit)
        Sets the bit value in a byte array at position bit to be the value value.
        Parameters:
        data - See above.
        bit - See above.
      • setMask

        public void setMask​(int[] mask)
        Set the mask
        Parameters:
        mask - The binary mask
      • setMask

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

        public void setMask​(boolean[] mask)
        Set the mask
        Parameters:
        mask - The binary mask
      • setMask

        public void setMask​(boolean[][] mask)
        Set the mask
        Parameters:
        mask - The binary mask (boolean[width][height])
      • getImage

        public ImageData getImage()
        Get the image this masks belongs to
        Returns:
        See above.
      • setImage

        public void setImage​(ImageData image)
        Set the image this masks belongs to
        Parameters:
        image - The image
      • toString

        public java.lang.String toString()
        Description copied from class: DataObject
        Overridden to return the name of the class and the object id.
        Overrides:
        toString in class DataObject
        See Also:
        Object.toString()