Package omero.gateway.model
Class MaskData
- java.lang.Object
-
- omero.gateway.model.DataObject
-
- omero.gateway.model.ShapeData
-
- omero.gateway.model.MaskData
-
public class MaskData extends ShapeData
Represents an Mask in the Euclidean space R2.- Since:
- 3.0-Beta4
-
-
Field Summary
-
Fields inherited from class omero.gateway.model.ShapeData
READONLY_FLAG, settings
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
getBit(byte[] data, int bit)
Sets the bit value in a byte array at position bit to be the value value.double
getHeight()
Returns the height of the mask.ImageData
getImage()
Get the image this masks belongs tobyte[]
getMask()
Returns the mask as a byte array.int[][]
getMaskAsBinaryArray()
Returns the mask image.java.awt.image.BufferedImage
getMaskAsBufferedImage()
Returns the mask image.java.lang.String
getText()
Returns the text of the shape.double
getWidth()
Returns the width of the mask.double
getX()
Returns the x-coordinate of the top-left corner of the mask.double
getY()
Returns the y-coordinate of the top-left corner of the mask.void
setBit(byte[] data, int bit, int val)
Sets the bit value in a byte array at position bit to be the value value.void
setHeight(double height)
Sets the height of an untransformed mask.void
setImage(ImageData image)
Set the image this masks belongs tovoid
setMask(boolean[] mask)
Set the maskvoid
setMask(boolean[][] mask)
Set the maskvoid
setMask(byte[] mask)
Sets the mask image.void
setMask(int[] mask)
Set the maskvoid
setMask(int[][] mask)
Set the maskvoid
setMask(java.awt.image.BufferedImage image)
Sets the mask from the bufferedImage.void
setText(java.lang.String text)
Sets the text of the shape.void
setWidth(double width)
Sets the width of an untransformed mask.void
setX(double x)
Sets the x-coordinate top-left corner of an untransformed mask.void
setY(double y)
Sets the y-coordinate top-left corner of an untransformed mask.java.lang.String
toString()
Overridden to return the name of the class and the object id.-
Methods inherited from class omero.gateway.model.ShapeData
fromPoints, getC, getROICoordinate, getShapeSettings, getT, getTransform, getZ, isClientObject, isReadOnly, parsePointsToIntegerList, parsePointsToPoint2DList, setC, setClientObject, setDirty, setReadOnly, setROICoordinate, setShapeSettings, setT, setTransform, setZ, toNumber, toPoints
-
Methods inherited from class omero.gateway.model.DataObject
asAnnotation, asChannel, asDataset, asExperimenter, asFolder, asGroup, asIAnnotated, asImage, asIObject, asPixels, asPlaneInfo, asPlate, asPojo, asPojos, asPojos, asProject, asScreen, asWell, asWellSample, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, getCreated, getDetails, getGroupId, getId, getOwner, getPermissions, getUpdated, getVersion, isDirty, isLoaded, nullDetails, nullSafe, nullSafe, nullSafe, nullSafe, nullSafe, nullSafe, nullSafe, nullSafe, setId, setValue, setVersion, timeOfEvent
-
-
-
-
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 classDataObject
- See Also:
Object.toString()
-
-