Package fr.igred.omero.roi
Interface Shape
-
- All Superinterfaces:
Annotatable
,RemoteObject
- All Known Implementing Classes:
EllipseWrapper
,LineWrapper
,MaskWrapper
,PointWrapper
,PolygonWrapper
,PolylineWrapper
,RectangleWrapper
,ShapeWrapper
,TextWrapper
public interface Shape extends Annotatable
Generic interface to handle Shape objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ShapeData
asDataObject()
Returns a ShapeData corresponding to the handled object.default java.awt.Shape
createTransformedAWTShape()
Returns a newShape
defined by the geometry of the specified Shape after it has been transformed by the transform.Rectangle
getBoundingBox()
Returns a newRectangle
corresponding to the bounding box of the shape, once the relatedAffineTransform
has been applied.int
getC()
Gets the channel.default java.lang.String
getCZT()
Returns the C,Z,T positions as a comma-delimited String.java.awt.Color
getFill()
Gets ShapeData fill color.double
getFontSize()
Gets ShapeData font size.java.awt.Color
getStroke()
Gets the ShapeData stroke color.int
getT()
Sets the time-point.java.lang.String
getText()
Gets the text on the ShapeData.int
getZ()
Gets the z-section.default <A extends AnnotationData>
voidlink(DataManager dm, A annotation)
Attach anAnnotationData
to this object.void
setC(int c)
Sets the channel.default void
setCZT(int c, int z, int t)
Sets the channel, z-section and time-point at once.void
setFill(java.awt.Color fillColour)
Sets the ShapeData fill color.void
setFontSize(double value)
Sets ShapeData font size.void
setStroke(java.awt.Color strokeColour)
Sets ShapeData stroke color.void
setT(int t)
Sets the time-point.void
setText(java.lang.String text)
Sets the text on the ShapeData.void
setTransform(double a00, double a10, double a01, double a11, double a02, double a12)
Sets the transform to the matrix specified by the 6 double precision values.default void
setTransform(java.awt.geom.AffineTransform transform)
Sets the transform from aAffineTransform
.void
setZ(int z)
Sets the z-section.java.awt.Shape
toAWTShape()
Converts the shape to anShape
.java.awt.geom.AffineTransform
toAWTTransform()
ConvertsAffineTransform
toAffineTransform
.Roi
toImageJ()
Converts shape to ImageJ ROI.-
Methods inherited from interface fr.igred.omero.Annotatable
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addKeyValuePair, addTable, addTag, addTag, addTags, copyAnnotationLinks, getAnnotationData, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getTable, getTables, getTags, getValues, isLinked, link, link, linkIfNotLinked, rate, unlink
-
Methods inherited from interface fr.igred.omero.RemoteObject
canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, getCreated, getGroupId, getId, getOwner, saveAndUpdate
-
-
-
-
Method Detail
-
asDataObject
ShapeData asDataObject()
Returns a ShapeData corresponding to the handled object.- Specified by:
asDataObject
in interfaceRemoteObject
- Returns:
- See above.
-
getC
int getC()
Gets the channel.- Returns:
- the channel. -1 if the shape applies to all channels of the image.
-
setC
void setC(int c)
Sets the channel.- Parameters:
c
- the channel. Pass -1 to remove z value, i.e. shape applies to all channels of the image.
-
getZ
int getZ()
Gets the z-section.- Returns:
- the z-section. -1 if the shape applies to all z-sections of the image.
-
setZ
void setZ(int z)
Sets the z-section.- Parameters:
z
- the z-section. Pass -1 to remove z value, i.e. shape applies to all z-sections of the image.
-
getT
int getT()
Sets the time-point.- Returns:
- the time-point. -1 if the shape applies to all time-points of the image.
-
setT
void setT(int t)
Sets the time-point.- Parameters:
t
- the time-point. Pass -1 to remove t value, i.e. shape applies to all time-points of the image.
-
setCZT
default void setCZT(int c, int z, int t)
Sets the channel, z-section and time-point at once.- Parameters:
c
- the channel. Pass -1 to remove z value, i.e. shape applies to all channels of the image.z
- the z-section. Pass -1 to remove z value, i.e. shape applies to all z-sections of the image.t
- the time-point. Pass -1 to remove t value, i.e. shape applies to all time-points of the image.
-
getCZT
default java.lang.String getCZT()
Returns the C,Z,T positions as a comma-delimited String.- Returns:
- See above.
-
getFontSize
double getFontSize()
Gets ShapeData font size.- Returns:
- The font size (in typography points)
-
setFontSize
void setFontSize(double value)
Sets ShapeData font size.- Parameters:
value
- The font size (in typography points)
-
getStroke
java.awt.Color getStroke()
Gets the ShapeData stroke color.- Returns:
- The stroke color
-
setStroke
void setStroke(java.awt.Color strokeColour)
Sets ShapeData stroke color.- Parameters:
strokeColour
- The stroke color
-
getFill
java.awt.Color getFill()
Gets ShapeData fill color.- Returns:
- The fill color
-
setFill
void setFill(java.awt.Color fillColour)
Sets the ShapeData fill color.- Parameters:
fillColour
- The fill color
-
getText
java.lang.String getText()
Gets the text on the ShapeData.- Returns:
- the text
-
setText
void setText(java.lang.String text)
Sets the text on the ShapeData.- Parameters:
text
- the text
-
toAWTShape
java.awt.Shape toAWTShape()
Converts the shape to anShape
.- Returns:
- The converted AWT Shape.
-
setTransform
void setTransform(double a00, double a10, double a01, double a11, double a02, double a12)
Sets the transform to the matrix specified by the 6 double precision values.- Parameters:
a00
- the X coordinate scaling element of the 3x3 matrixa10
- the Y coordinate shearing element of the 3x3 matrixa01
- the X coordinate shearing element of the 3x3 matrixa11
- the Y coordinate scaling element of the 3x3 matrixa02
- the X coordinate translation element of the 3x3 matrixa12
- the Y coordinate translation element of the 3x3 matrix
-
setTransform
default void setTransform(java.awt.geom.AffineTransform transform)
Sets the transform from aAffineTransform
.- Parameters:
transform
- A Java AffineTransform.
-
toAWTTransform
java.awt.geom.AffineTransform toAWTTransform()
ConvertsAffineTransform
toAffineTransform
.- Returns:
- The converted affine transform.
-
createTransformedAWTShape
default java.awt.Shape createTransformedAWTShape()
Returns a newShape
defined by the geometry of the specified Shape after it has been transformed by the transform.- Returns:
- A new transformed
Shape
.
-
getBoundingBox
Rectangle getBoundingBox()
Returns a newRectangle
corresponding to the bounding box of the shape, once the relatedAffineTransform
has been applied.- Returns:
- The bounding box.
-
toImageJ
Roi toImageJ()
Converts shape to ImageJ ROI.- Returns:
- An ImageJ ROI.
-
link
default <A extends AnnotationData> void link(DataManager dm, A annotation) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Attach anAnnotationData
to this object.- Specified by:
link
in interfaceAnnotatable
- Type Parameters:
A
- The type of the annotation.- Parameters:
dm
- The data manager.annotation
- TheAnnotationData
.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-