Package fr.igred.omero.roi
Class ROIWrapper
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<ROIData>
-
- fr.igred.omero.roi.ROIWrapper
-
public class ROIWrapper extends GenericObjectWrapper<ROIData>
Class containing a ROIData object.Wraps function calls to the ROIData contained.
-
-
Field Summary
Fields Modifier and Type Field Description static String
IJ_PROPERTY
Default IJ property to store ROI local IDs / indices.-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
-
Constructor Summary
Constructors Constructor Description ROIWrapper()
Constructor of the ROIWrapper class.ROIWrapper(Iterable<? extends GenericShapeWrapper<?>> shapes)
Constructor of the ROIWrapper class.ROIWrapper(ROIData data)
Constructor of the ROIWrapper class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addShape(GenericShapeWrapper<?> shape)
Adds a ShapeData from a GenericShapeWrapper to the ROIDatavoid
addShapes(List<? extends GenericShapeWrapper<?>> shapes)
Adds ShapeData objects from a list of GenericShapeWrapper to the ROIDataROIData
asROIData()
Returns the ROIData contained.static String
checkProperty(String property)
Checks the provided property.void
deleteShape(int pos)
Deletes a ShapeData from the ROIData.void
deleteShape(ShapeData shape)
Deletes a ShapeData from the ROIData.static List<ROIWrapper>
fromImageJ(List<? extends Roi> ijRois)
Converts an ImageJ list of ROIs to a list of OMERO ROIsstatic List<ROIWrapper>
fromImageJ(List<? extends Roi> ijRois, String property)
Converts an ImageJ list of ROIs to a list of OMERO ROIsPixelsWrapper.Bounds
getBounds()
Returns the 5D bounds containing the ROI.ShapeList
getShapes()
Returns the list of shapes contained in the ROIDatastatic String
ijIDProperty(String property)
Returns ID property corresponding to input local ID property (appends "_ID" to said property).void
saveROI(Client client)
Saves the ROI.void
setData(ROIData data)
Changes the wrapped data.void
setImage(ImageWrapper image)
Sets the image linked to the ROI.List<Roi>
toImageJ()
Convert ROI to ImageJ list of ROIs.List<Roi>
toImageJ(String property)
Convert ROI to ImageJ list of ROIs.static List<Roi>
toImageJ(List<? extends ROIWrapper> rois)
Converts an OMERO list of ROIs to a list of ImageJ ROIsstatic List<Roi>
toImageJ(List<? extends ROIWrapper> rois, String property)
Converts an OMERO list of ROIs to a list of ImageJ ROIs-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, distinct, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString, wrap, wrap
-
-
-
-
Field Detail
-
IJ_PROPERTY
public static final String IJ_PROPERTY
Default IJ property to store ROI local IDs / indices.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ROIWrapper
public ROIWrapper()
Constructor of the ROIWrapper class.
-
ROIWrapper
public ROIWrapper(Iterable<? extends GenericShapeWrapper<?>> shapes)
Constructor of the ROIWrapper class.- Parameters:
shapes
- List of shapes to add to the ROIData.
-
ROIWrapper
public ROIWrapper(ROIData data)
Constructor of the ROIWrapper class.- Parameters:
data
- ROIData to be contained.
-
-
Method Detail
-
checkProperty
public static String checkProperty(String property)
Checks the provided property.- Parameters:
property
- The property where 4D ROI local ID is stored.- Returns:
- The property, or the default value
IJ_PROPERTY
(= "ROI") if it is null or empty.
-
ijIDProperty
public static String ijIDProperty(String property)
Returns ID property corresponding to input local ID property (appends "_ID" to said property).- Parameters:
property
- The property where 4D ROI local ID is stored, defaults to "ROI" if null or empty.- Returns:
- See above.
-
fromImageJ
public static List<ROIWrapper> fromImageJ(List<? extends Roi> ijRois)
Converts an ImageJ list of ROIs to a list of OMERO ROIs- Parameters:
ijRois
- A list of ImageJ ROIs.- Returns:
- The converted list of OMERO ROIs.
-
fromImageJ
public static List<ROIWrapper> fromImageJ(List<? extends Roi> ijRois, String property)
Converts an ImageJ list of ROIs to a list of OMERO ROIs- Parameters:
ijRois
- A list of ImageJ ROIs.property
- The property where 4D ROI local ID is stored. Defaults to "ROI" if null or empty.- Returns:
- The converted list of OMERO ROIs.
-
toImageJ
public static List<Roi> toImageJ(List<? extends ROIWrapper> rois)
Converts an OMERO list of ROIs to a list of ImageJ ROIs- Parameters:
rois
- A list of OMERO ROIs.- Returns:
- The converted list of ImageJ ROIs.
-
toImageJ
public static List<Roi> toImageJ(List<? extends ROIWrapper> rois, String property)
Converts an OMERO list of ROIs to a list of ImageJ ROIs- Parameters:
rois
- A list of OMERO ROIs.property
- The property used to store 4D ROI local IDs. Defaults to "ROI" if null or empty.- Returns:
- The converted list of ImageJ ROIs.
-
setData
public void setData(ROIData data)
Changes the wrapped data.- Parameters:
data
- The ROI data.
-
addShapes
public void addShapes(List<? extends GenericShapeWrapper<?>> shapes)
Adds ShapeData objects from a list of GenericShapeWrapper to the ROIData- Parameters:
shapes
- List of GenericShapeWrapper.
-
addShape
public void addShape(GenericShapeWrapper<?> shape)
Adds a ShapeData from a GenericShapeWrapper to the ROIData- Parameters:
shape
- GenericShapeWrapper to add.
-
getShapes
public ShapeList getShapes()
Returns the list of shapes contained in the ROIData- Returns:
- list of shape contained in the ROIData.
-
setImage
public void setImage(ImageWrapper image)
Sets the image linked to the ROI.- Parameters:
image
- Image linked to the ROIData.
-
deleteShape
public void deleteShape(ShapeData shape)
Deletes a ShapeData from the ROIData.- Parameters:
shape
- ShapeData to delete.
-
deleteShape
public void deleteShape(int pos)
Deletes a ShapeData from the ROIData.- Parameters:
pos
- Position of the ShapeData in the ShapeData list from the ROIData.- Throws:
IndexOutOfBoundsException
- If pos is out of the ShapeData list bounds.
-
saveROI
public void saveROI(Client client) throws OMEROServerError, ServiceException
Saves the ROI.- Parameters:
client
- The client handling the connection.- Throws:
ServiceException
- Cannot connect to OMERO.OMEROServerError
- Server error.
-
getBounds
public PixelsWrapper.Bounds getBounds()
Returns the 5D bounds containing the ROI.- Returns:
- The 5D bounds.
-
-