annotations = getAnnotationObjects()
longPerimeter = annotations.findAll{it.getROI().getPerimeter() >300}
println(longPerimeter)// Get all annotations with ellipse ROIs
def annotations = getAnnotationObjects()
def ellipses = annotations.findAll {it.getROI() instanceof qupath.lib.roi.EllipseROI}
// Create corresponding detections (name this however you like)
def classification = getPathClass('Node')
def detections = ellipses.collect {
new qupath.lib.objects.PathDetectionObject(it.getROI(), classification)
}
// Remove ellipse annotations & replace with detections
removeObjects(ellipses, true)
addObjects(detections)Or here's an alternative that just assigns classifications, but keeps the nodes as annotations and not detections - and uses names and classifications to help distinguish them. I've shown a screenshot of how the table can look with v0.1.3 (I suspect it's less useful with v0.1.2).
Whichever script you use, you could opt not to classify all ellipses simply as 'Node', but rather assign a different classification based on size - to incorporate more information into the results tables.
// Get all annotations with ellipse ROIs
def annotations = getAnnotationObjects()
def ellipses = annotations.findAll {it.getROI() instanceof qupath.lib.roi.EllipseROI}
// Assign classifications to nodes
def classification = getPathClass('Node')
ellipses.each {it.setPathClass(classification)}
// Assign names to all other annotations
annotations.removeAll(ellipses)
annotations.eachWithIndex {annotation, i -> annotation.setName('Annotation ' + (i+1))}
fireHierarchyUpdate()