Created
February 27, 2018 19:17
-
-
Save DanaCase/2bd1406c86229343c8d7c4642ff785f6 to your computer and use it in GitHub Desktop.
Convert a list of patch coordinates to qupath annotations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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