Interface ROI

    • Field Detail

      • IJ_PROPERTY

        static final java.lang.String IJ_PROPERTY
        Default IJ property to store ROI local labels / indices.
        See Also:
        Constant Field Values
    • Method Detail

      • checkProperty

        static java.lang.String checkProperty​(java.lang.String property)
        Checks the provided property.
        Parameters:
        property - The property where the 4D ROI local index/label is stored.
        Returns:
        The property, or the default value IJ_PROPERTY (= "ROI") if it is null or empty.
      • ijIDProperty

        static java.lang.String ijIDProperty​(java.lang.String property)
        Returns the ID property corresponding to the input local index/label property (appends "_ID" to said property).
        Parameters:
        property - The property where the 4D ROI local index/label is stored. Defaults to "ROI" if null or empty.
        Returns:
        See above.
      • ijNameProperty

        static java.lang.String ijNameProperty​(java.lang.String property)
        Returns the ID property corresponding to the input local index/label property (appends "_NAME" to said property).
        Parameters:
        property - The property where the 4D ROI local index/label is stored. Defaults to "ROI" if null or empty.
        Returns:
        See above.
      • fromImageJ

        static java.util.List<ROI> fromImageJ​(java.util.Collection<? extends Roi> ijRois,
                                              java.util.function.Supplier<? extends ROI> constructor,
                                              java.util.function.Function<? super Roi,​java.lang.Iterable<? extends Shape>> converter)
        Converts an ImageJ list of ROIs to a list of OMERO ROIs using the provided constructor and shape converter.
        Parameters:
        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.
        Returns:
        The converted list of OMERO ROIs.
      • fromImageJ

        static java.util.List<ROI> fromImageJ​(java.util.Collection<? extends Roi> ijRois,
                                              java.lang.String property,
                                              java.util.function.Supplier<? extends ROI> constructor,
                                              java.util.function.Function<? super Roi,​? extends java.lang.Iterable<? extends Shape>> converter)
        Converts a collection of ImageJ ROIs to a list of OMERO ROIs using the provided constructor and shape converter.
        Parameters:
        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.
        Returns:
        The converted list of OMERO ROIs.
      • toImageJ

        static java.util.List<Roi> toImageJ​(java.util.Collection<? extends ROI> rois)
        Converts a collection of OMERO ROIs to a list of ImageJ ROIs.
        Parameters:
        rois - A collection of OMERO ROIs.
        Returns:
        The converted list of ImageJ ROIs.
      • toImageJ

        static java.util.List<Roi> toImageJ​(java.util.Collection<? extends ROI> rois,
                                            java.lang.String property)
        Converts a collection of OMERO ROIs to a list of ImageJ ROIs.
        Parameters:
        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.
        Returns:
        The converted list of ImageJ ROIs.
      • toImageJ

        static java.util.List<Roi> toImageJ​(java.util.Collection<? extends ROI> rois,
                                            java.lang.String property,
                                            boolean groupRois)
        Converts a collection of OMERO ROIs to a list of ImageJ ROIs.
        Parameters:
        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.
        Returns:
        The converted list of ImageJ ROIs.
      • asDataObject

        ROIData asDataObject()
        Returns a ROIData corresponding to the handled object.
        Specified by:
        asDataObject in interface RemoteObject
        Returns:
        See above.
      • getName

        java.lang.String getName()
        Gets the ROI name.
        Returns:
        The ROI name (can be null).
      • setName

        void setName​(java.lang.String name)
        Sets the ROI name.
        Parameters:
        name - The ROI name.
      • addShapes

        default void addShapes​(java.lang.Iterable<? extends Shape> shapes)
        Adds shape objects from a list of shapes to the ROI.
        Parameters:
        shapes - List of Shape.
      • addShape

        void addShape​(Shape shape)
        Adds a Shape to the ROI.
        Parameters:
        shape - Shape to add.
      • getShapes

        java.util.List<Shape> getShapes()
        Returns the list of shapes contained in the ROI.
        Returns:
        See above.
      • setImage

        void setImage​(Image image)
        Sets the image linked to the ROI.
        Parameters:
        image - Image linked to the ROI.
      • deleteShape

        void deleteShape​(ShapeData shape)
        Deletes a ShapeData from the ROI.
        Parameters:
        shape - ShapeData to delete.
      • deleteShape

        void deleteShape​(int pos)
        Deletes a shape from the ROI.
        Parameters:
        pos - Position of the ShapeData in the ShapeData list from the ROI.
        Throws:
        java.lang.IndexOutOfBoundsException - If pos is out of the ShapeData list bounds.
      • getBounds

        default Bounds getBounds()
        Returns the 5D bounds containing the ROI.
        Returns:
        The 5D bounds.
      • toImageJ

        default java.util.List<Roi> toImageJ()
        Converts the ROI to a list of ImageJ ROIs.
        Returns:
        A list of ROIs.
      • toImageJ

        default java.util.List<Roi> toImageJ​(java.lang.String property)
        Converts the ROI to a list of ImageJ ROIs.
        Parameters:
        property - The property where the 4D ROI local index will be stored.
        Returns:
        A list of ROIs.