Package fr.igred.omero.roi
Class MaskWrapper
Class containing an MaskData.
Wraps function calls to the MaskData contained.
-
Field Summary
Fields inherited from class fr.igred.omero.roi.GenericShapeWrapper
ANNOTATION_LINK
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
Constructor Summary
ConstructorDescriptionConstructor of the MaskWrapper class using a new empty MaskData.MaskWrapper
(double x, double y, double width, double height, byte[] mask) Constructor of the MaskWrapper class using a new MaskData.MaskWrapper
(MaskData mask) Constructor of the MaskWrapper class using a MaskData. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
Gets the coordinates of the MaskData shape.double
Returns the height of the mask.byte[]
getMask()
Returns the mask as a byte array.int[][]
Returns the mask image.getText()
Gets the text on the ShapeData.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
setCoordinates
(double[] coordinates) Sets the coordinates of the MaskData shape.void
setCoordinates
(double x, double y, double width, double height) Sets the coordinates of the MaskData shape.void
setHeight
(double height) Sets the height of an untransformed mask.void
setMask
(boolean[][] mask) Sets the maskvoid
setMask
(byte[] mask) Sets the mask image.void
setMask
(int[][] mask) Sets the maskvoid
Sets the text on the ShapeData.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.Converts the shape to anShape
.toImageJ()
Converts shape to ImageJ ROI.Methods inherited from class fr.igred.omero.roi.GenericShapeWrapper
annotationLinkType, asShapeData, copyFromIJRoi, copyToIJRoi, createTransformedAWTShape, getBoundingBox, getC, getFill, getFontSize, getStroke, getT, getZ, link, setC, setCZT, setFill, setFontSize, setStroke, setT, setTransform, setTransform, setZ, toAWTTransform
Methods inherited from class fr.igred.omero.AnnotatableWrapper
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addFileAnnotation, addKeyValuePair, addMapAnnotation, addPairKeyValue, addTable, addTag, addTag, addTag, addTags, addTags, copyAnnotationLinks, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getRatings, getTable, getTables, getTags, getValue, isLinked, link, link, linkIfNotLinked, rate, removeLink, unlink
Methods inherited from class fr.igred.omero.GenericObjectWrapper
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, distinct, flatten, getCreated, getGroupId, getId, getOwner, getUpdated, saveAndUpdate, toString, wrap, wrap
-
Constructor Details
-
MaskWrapper
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
Gets the text on the ShapeData.- Specified by:
getText
in classGenericShapeWrapper<MaskData>
- Returns:
- the text
-
setText
Sets the text on the ShapeData.- Specified by:
setText
in classGenericShapeWrapper<MaskData>
- Parameters:
text
- the text
-
toAWTShape
Converts the shape to anShape
.- Specified by:
toAWTShape
in classGenericShapeWrapper<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
Converts shape to ImageJ ROI.- Overrides:
toImageJ
in classGenericShapeWrapper<MaskData>
- Returns:
- An ImageJ ROI.
-