Hello!
For a project I’m working on, I am collecting point-click data in the form of labeled x, y coordinates from an external viewer to classify certain cell types (from JSON). Using this data, I am hoping to run QuPath’s cellular detection algorithm and then allow for the cells to inherit the class of the X,Y coordinate it contains, so that I can then train an object classifier.
I’ve been looking around the forum, and I’ve only seen how to create Eclipse or Rectangle ROI objects from these coordinates. However, when I create these annotations, I am unable to train an object classifier because I believe these annotations may be too small and aren’t getting correctly propagated into the hierarchy. I then get a “You need to annotate objects with atleast two classifications in order to train an object classifier”. I’ve tried increasing the eclipse size (resolves around when size ~15), and this resolves this error, but this results in the annotations becoming off of what was originally annotated via point clicks, which I’m trying to avoid.
Here is the code I’m currently running:
// read in geojson of labeled x,y coordinates into variable text
def map = new Gson().fromJson(text, Map)
def size = 1
annotations = []
for (feat in map['features']) {
def class = feat['properties']['label_name'].toString()
def points = feat['coordinates']
for (point in points){
x = point[0]
y = point[1]
double roi_size = 1
int z = 0
int t = 0
def plane = ImagePlane.getPlane(z, t)
def roi = new EllipseROI(x,y,roi_size,roi_size, plane)
def pathAnnotation = new PathAnnotationObject(roi)
pathAnnotation.setPathClass(getPathClass(name))
annotations << pathAnnotation
}
}
hierarchy.addPathObjects(annotations)
I was wondering if there is a way to add labeled Point Objects to the annotation Hierarchy? And if so, Is there a way I can assign labels to cellular objects based on the label of the Point that is contained inside them?
Thanks!