public interface ROI extends Annotatable
Modifier and Type | Field and Description |
---|---|
static String |
IJ_PROPERTY
Default IJ property to store ROI local labels / indices.
|
Modifier and Type | Method and Description |
---|---|
void |
addShape(Shape shape)
Adds a Shape to the ROI.
|
default void |
addShapes(Iterable<? extends Shape> shapes)
Adds shape objects from a list of shapes to the ROI.
|
ROIData |
asDataObject()
Returns a ROIData corresponding to the handled object.
|
static String |
checkProperty(String property)
Checks the provided property.
|
void |
deleteShape(int pos)
Deletes a shape from the ROI.
|
void |
deleteShape(ShapeData shape)
Deletes a ShapeData from the ROI.
|
static List<ROI> |
fromImageJ(Collection<? extends Roi> ijRois,
String property,
Supplier<? extends ROI> constructor,
Function<? super Roi,? extends Iterable<? extends Shape>> converter)
Converts a collection of ImageJ ROIs to a list of OMERO ROIs using the provided constructor and shape converter.
|
static List<ROI> |
fromImageJ(Collection<? extends Roi> ijRois,
Supplier<? extends ROI> constructor,
Function<? super Roi,Iterable<? extends Shape>> converter)
Converts an ImageJ list of ROIs to a list of OMERO ROIs using the provided constructor and shape converter.
|
default Bounds |
getBounds()
Returns the 5D bounds containing the ROI.
|
String |
getName()
Gets the ROI name.
|
List<Shape> |
getShapes()
Returns the list of shapes contained in the ROI.
|
static String |
ijIDProperty(String property)
Returns the ID property corresponding to the input local index/label property (appends "_ID" to said property).
|
static String |
ijNameProperty(String property)
Returns the ID property corresponding to the input local index/label property (appends "_NAME" to said
property).
|
default <A extends AnnotationData> |
link(DataManager dm,
A annotation)
Attach an
AnnotationData to this object. |
void |
saveROI(DataManager dm)
Saves the ROI.
|
void |
setImage(Image image)
Sets the image linked to the ROI.
|
void |
setName(String name)
Sets the ROI name.
|
default List<Roi> |
toImageJ()
Converts the ROI to a list of ImageJ ROIs.
|
static List<Roi> |
toImageJ(Collection<? extends ROI> rois)
Converts a collection of OMERO ROIs to a list of ImageJ ROIs.
|
static List<Roi> |
toImageJ(Collection<? extends ROI> rois,
String property)
Converts a collection of OMERO ROIs to a list of ImageJ ROIs.
|
static List<Roi> |
toImageJ(Collection<? extends ROI> rois,
String property,
boolean groupRois)
Converts a collection of OMERO ROIs to a list of ImageJ ROIs.
|
default List<Roi> |
toImageJ(String property)
Converts the ROI to a list of ImageJ ROIs.
|
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
canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, distinct, flatten, getCreated, getElementsOf, getGroupId, getId, getOwner, getUpdated, saveAndUpdate
static final String IJ_PROPERTY
static String checkProperty(String property)
property
- The property where the 4D ROI local index/label is stored.IJ_PROPERTY
(= "ROI") if it is null or empty.static String ijIDProperty(String property)
property
- The property where the 4D ROI local index/label is stored. Defaults to "ROI" if
null or empty.static String ijNameProperty(String property)
property
- The property where the 4D ROI local index/label is stored. Defaults to "ROI" if
null or empty.static List<ROI> fromImageJ(Collection<? extends Roi> ijRois, Supplier<? extends ROI> constructor, Function<? super Roi,Iterable<? extends Shape>> converter)
ijRois
- A collection of ImageJ ROIs.constructor
- A constructor to create ROI instances.converter
- A function to convert an IJ Roi to a list of OMERO Shapes.static List<ROI> fromImageJ(Collection<? extends Roi> ijRois, String property, Supplier<? extends ROI> constructor, Function<? super Roi,? extends Iterable<? extends Shape>> converter)
ijRois
- A collection of ImageJ ROIs.property
- The property used to store the 4D ROI local index/label. Defaults to "ROI" if
null or empty.constructor
- A constructor to create ROI instances.converter
- A function to convert an IJ Roi to a list of OMERO Shapes.static List<Roi> toImageJ(Collection<? extends ROI> rois)
rois
- A collection of OMERO ROIs.static List<Roi> toImageJ(Collection<? extends ROI> rois, String property)
rois
- A collection of OMERO ROIs.property
- The property used to store the 4D ROI local index/label. Defaults to "ROI" if null
or empty.static List<Roi> toImageJ(Collection<? extends ROI> rois, String property, boolean groupRois)
rois
- A collection of OMERO ROIs.property
- The property used to store the 4D ROI local labels/IDs. Defaults to "ROI" if null
or empty.groupRois
- Whether ImageJ Rois belonging to the same OMERO ROI should be grouped or not.ROIData asDataObject()
asDataObject
in interface RemoteObject
String getName()
void setName(String name)
name
- The ROI name.default void addShapes(Iterable<? extends Shape> shapes)
shapes
- List of Shape.void addShape(Shape shape)
shape
- Shape to add.List<Shape> getShapes()
void setImage(Image image)
image
- Image linked to the ROI.void deleteShape(ShapeData shape)
shape
- ShapeData to delete.void deleteShape(int pos)
pos
- Position of the ShapeData in the ShapeData list from the ROI.IndexOutOfBoundsException
- If pos is out of the ShapeData list bounds.void saveROI(DataManager dm) throws ServiceException, AccessException, ExecutionException
dm
- The data manager.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.default Bounds getBounds()
default List<Roi> toImageJ()
default List<Roi> toImageJ(String property)
property
- The property where the 4D ROI local index will be stored.default <A extends AnnotationData> void link(DataManager dm, A annotation) throws ServiceException, AccessException, ExecutionException
AnnotationData
to this object.link
in interface Annotatable
A
- The type of the annotation.dm
- The client handling the connection.annotation
- The AnnotationData
.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.Copyright © 2020–2023 GReD. All rights reserved.