Skip to content

Instantly share code, notes, and snippets.

@DanaCase
Created February 27, 2018 19:17
Show Gist options
  • Save DanaCase/2bd1406c86229343c8d7c4642ff785f6 to your computer and use it in GitHub Desktop.
Save DanaCase/2bd1406c86229343c8d7c4642ff785f6 to your computer and use it in GitHub Desktop.
Convert a list of patch coordinates to qupath annotations
import qupath.lib.scripting.QP
import qupath.lib.roi.RectangleROI
import qupath.lib.objects.PathAnnotationObject
points_list = [[0,0]]
def hierarchy = QP.getCurrentHierarchy()
points_list.each {
def rect = new RectangleROI(it[0].toDouble(), it[1].toDouble(), 100, 100 )
def annotation = new PathAnnotationObject(rect)
hierarchy.addPathObject(annotation, false)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment