Package fr.igred.omero.roi
Class MaskWrapper
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- fr.igred.omero.AnnotatableWrapper<T>
-
- fr.igred.omero.roi.GenericShapeWrapper<MaskData>
-
- fr.igred.omero.roi.MaskWrapper
-
public class MaskWrapper extends GenericShapeWrapper<MaskData>
Class containing an MaskData.Wraps function calls to the MaskData contained.
-
-
Field Summary
-
Fields inherited from class fr.igred.omero.roi.GenericShapeWrapper
ANNOTATION_LINK, IJ_ID_PROPERTY
-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
-
Constructor Summary
Constructors Constructor Description MaskWrapper()Constructor 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(ImageRoi imageRoi)Constructor of the MaskWrapper class using an ImageJ ImageRoi.MaskWrapper(MaskData mask)Constructor of the MaskWrapper class using a MaskData.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]getCoordinates()Gets the coordinates of the MaskData shape.doublegetHeight()Returns the height of the mask.byte[]getMask()Returns the mask as a byte array.int[][]getMaskAsBinaryArray()Returns the mask image.BufferedImagegetMaskAsBufferedImage()Returns the mask image.StringgetText()Gets the text on the ShapeData.doublegetWidth()Returns the width of the mask.doublegetX()Returns the x-coordinate of the top-left corner of the mask.doublegetY()Returns the y-coordinate of the top-left corner of the mask.voidsetCoordinates(double[] coordinates)Sets the coordinates of the MaskData shape.voidsetCoordinates(double x, double y, double width, double height)Sets the coordinates of the MaskData shape.voidsetHeight(double height)Sets the height of an untransformed mask.voidsetMask(boolean[][] mask)Sets the maskvoidsetMask(byte[] mask)Sets the mask image.voidsetMask(int[][] mask)Sets the maskvoidsetText(String text)Sets the text on the ShapeData.voidsetWidth(double width)Sets the width of an untransformed mask.voidsetX(double x)Sets the x-coordinate top-left corner of an untransformed mask.voidsetY(double y)Sets the y-coordinate top-left corner of an untransformed mask.ShapetoAWTShape()Converts the shape to anShape.RoitoImageJ()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, removeLinks, unlink, unlink
-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, distinct, flatten, getCreated, getGroupId, getId, getOwner, getUpdated, saveAndUpdate, toString, wrap, wrap
-
-
-
-
Constructor Detail
-
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(ImageRoi imageRoi)
Constructor of the MaskWrapper class using an ImageJ ImageRoi.- Parameters:
imageRoi- An ImageJ ImageRoi.
-
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 Detail
-
getText
public String getText()
Gets the text on the ShapeData.- Specified by:
getTextin classGenericShapeWrapper<MaskData>- Returns:
- the text
-
setText
public void setText(String text)
Sets the text on the ShapeData.- Specified by:
setTextin classGenericShapeWrapper<MaskData>- Parameters:
text- the text
-
toAWTShape
public Shape toAWTShape()
Converts the shape to anShape.- Specified by:
toAWTShapein 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.
-
getMaskAsBufferedImage
public BufferedImage getMaskAsBufferedImage()
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:
toImageJin classGenericShapeWrapper<MaskData>- Returns:
- An ImageJ ROI.
-
-