Class OmeroRawShapes

java.lang.Object
qupath.ext.biop.servers.omero.raw.utils.OmeroRawShapes

public class OmeroRawShapes extends Object
Handles the conversion between PathObjects and OMERO-ROIs
  • Constructor Details

    • OmeroRawShapes

      public OmeroRawShapes()
  • Method Details

    • createPathObjectFromQuPathRoi

      public static qupath.lib.objects.PathObject createPathObjectFromQuPathRoi(qupath.lib.roi.interfaces.ROI roi, String roiType)
      Create a PathObject of type annotation or detection from a QuPath ROI object without any class and with the default red color. See createPathObjectFromQuPathRoi(ROI roi, String roiType, String roiClass) for the full documentation.
      Parameters:
      roi - roi to convert
      roiType - annotation or detection type
      Returns:
      a new pathObject
    • createPathObjectFromQuPathRoi

      public static qupath.lib.objects.PathObject createPathObjectFromQuPathRoi(qupath.lib.roi.interfaces.ROI roi, String roiType, Color color)
      Create a PathObject of type annotation or detection from a QuPath ROI object, with a certain color. If the color is yellow (i.e. default color on OMERO), it is automatically converted to QuPath default red color. No class is assigned to the new PathObject. See createPathObjectFromQuPathRoi(ROI roi, String roiType, String roiClass) for the full documentation.
      Parameters:
      roi - roi to convert
      roiType - annotation or detection type
      color - color to assign to the pathObject
      Returns:
      a new pathObject
    • createPathObjectFromQuPathRoi

      public static qupath.lib.objects.PathObject createPathObjectFromQuPathRoi(qupath.lib.roi.interfaces.ROI roi, String roiType, String roiClass)
      Create a PathObject of type annotation or detection from a QuPath ROI object. with the specified class. If the class is not a valid class, no class is assigned to the pathObject and the default red color is assigned to it.
      Currently, pathObjects of "cell" type are not supported and are considered as detections. All pathObjects of other type (i.e. non recognized types) are automatically assigned to annotation type.
      Parameters:
      roi - roi to convert
      roiType - annotation or detection type
      roiClass - pathClasses assigned to the roi
      Returns:
      a new pathObject
    • convertOmeroROIsToQuPathROIs

      public static qupath.lib.roi.interfaces.ROI convertOmeroROIsToQuPathROIs(fr.igred.omero.roi.ROIWrapper roiWrapper)
      Convert OMERO ROIs To QuPath ROIs.
      For annotations, it takes into account complex ROIs (with multiple shapes) by applying a XOR operation to reduce the dimensionality.
      For detections, no complex ROIs are possible (i.e. one shape = one ROI)
      Parameters:
      roiWrapper - OMERO ROI to convert
      Returns:
      QuPath ROI
    • convertQuPathRoiToOmeroRoi

      public static List<fr.igred.omero.roi.GenericShapeWrapper<? extends omero.gateway.model.ShapeData>> convertQuPathRoiToOmeroRoi(qupath.lib.objects.PathObject src, String objectID, String parentID)
      Convert a PathObject into OMERO-readable objects. In case the PathObject contains holes (i.e. complex annotation), it is split into individual shapes and each shape will be part of the same OMERO ROI (nested hierarchy in OMERO.web).
      Parameters:
      src - : pathObject to convert
      objectID - pathObject's ID
      parentID - pathObject parent's ID
      Returns:
      list of OMERO shapes
    • createOmeroROIsFromPathObjects

      protected static List<fr.igred.omero.roi.ROIWrapper> createOmeroROIsFromPathObjects(Collection<qupath.lib.objects.PathObject> pathObjects)
      Convert QuPath pathObjects into OMERO ROIs.
      Parameters:
      pathObjects -
      Returns:
      List of OMERO ROIs
    • createPathObjectsFromOmeroROIs

      protected static Collection<qupath.lib.objects.PathObject> createPathObjectsFromOmeroROIs(List<fr.igred.omero.roi.ROIWrapper> roiWrapperList)
      Convert OMERO ROIs into QuPath pathObjects
      Parameters:
      roiWrapperList -
      Returns:
      List of QuPath pathObjects
    • getROIComment

      protected static List<String> getROIComment(fr.igred.omero.roi.ROIWrapper roiWrapper)
      Read the comments attach to an OMERO ROI (i.e. read each comment attached to each shape of the ROI)
      Parameters:
      roiWrapper -
      Returns:
      List of comments
    • getROIComment

      protected static String getROIComment(omero.model.Shape shape)
      Read the comment attached to one shape of an OMERO ROI.
      Parameters:
      shape -
      Returns:
      The shape comment
    • parseROIComment

      protected static String[] parseROIComment(String comment)
      Parse the comment based on the format introduced in {OmeroRawShapes.setRoiComment(PathObject src, String objectID, String parentID)}
      Parameters:
      comment -
      Returns:
      The split comment
    • filterByOwner

      public static List<fr.igred.omero.roi.ROIWrapper> filterByOwner(OmeroRawClient client, List<fr.igred.omero.roi.ROIWrapper> roiData, String owner)
      Parameters:
      client -
      roiData -
      owner -
      Returns:
      the list of all ROIs created by the specified owner