Package qupath.ext.biop.utils
Class PathUtils
- java.lang.Object
-
- qupath.ext.biop.utils.PathUtils
-
public class PathUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PathUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static qupath.lib.objects.PathObject
expand(qupath.lib.objects.PathObject pathObject, double radiusPixels, boolean removeInterior, boolean constrainToParent)
expand, taken fromDilateAnnotationPlugin
which returns an PathObject expanded or dilated by the given amount in pixelsstatic double
getAreaMicrons(qupath.lib.objects.PathObject object)
returns the area of the current PathObject in calibrated units.static qupath.lib.objects.PathObject
getFullImageAnnotation()
returns a rectangle with the whole dataset as an annotation.static java.util.List<qupath.lib.objects.PathDetectionObject>
makePieChart(java.lang.String name, java.util.Map<qupath.lib.objects.classes.PathClass,java.lang.Double> elements, qupath.lib.objects.PathObject parent)
Creates a series of detections as pie chart elements that are added to the provided parent objectstatic qupath.lib.objects.PathObject
merge(java.util.List<qupath.lib.objects.PathObject> pathObjects)
Merge all PathObjects into a single PathObject
-
-
-
Method Detail
-
getFullImageAnnotation
public static qupath.lib.objects.PathObject getFullImageAnnotation()
returns a rectangle with the whole dataset as an annotation. It does not add it to the Hierarchy- Returns:
- an Annotation Object with the whole image
-
getAreaMicrons
public static double getAreaMicrons(qupath.lib.objects.PathObject object)
returns the area of the current PathObject in calibrated units.- Parameters:
object
- the object to try and compute the area from- Returns:
- the calibrated area in um2
-
expand
public static qupath.lib.objects.PathObject expand(qupath.lib.objects.PathObject pathObject, double radiusPixels, boolean removeInterior, boolean constrainToParent)
expand, taken fromDilateAnnotationPlugin
which returns an PathObject expanded or dilated by the given amount in pixels- Parameters:
pathObject
- the PathObject to dilate or eroderadiusPixels
- the radius of erosion/dilationremoveInterior
- whether to create an annotation from the difference of the two or just a full new annotation (kind of like "make band"constrainToParent
- limits the expansion to the parent shape. pathObject must be a child of something in the image.- Returns:
- an Annotation or Detection object of the same class
-
merge
public static qupath.lib.objects.PathObject merge(java.util.List<qupath.lib.objects.PathObject> pathObjects)
Merge all PathObjects into a single PathObject- Parameters:
pathObjects
- the things to merge. The resulting PathObject will be of the type (Annotation/Detection), color and class of the first PathObject in this list.- Returns:
- a single object that is the merge of all objects in the list.
-
makePieChart
public static java.util.List<qupath.lib.objects.PathDetectionObject> makePieChart(java.lang.String name, java.util.Map<qupath.lib.objects.classes.PathClass,java.lang.Double> elements, qupath.lib.objects.PathObject parent)
Creates a series of detections as pie chart elements that are added to the provided parent object- Parameters:
name
- the name of the pie chart, for the measurementselements
- a map of PathClass > Double that contains the class and value for each piece of the chartparent
- to which ROI to attach this chart- Returns:
- the individual quadrants that make up the chart if you need to modify them further
-
-