This image contain 8 spots thar are closer than 100um exept one which is further (around 215um).
4- Detect all the spots in the annotation with Analyse/cell detections (do not create cells detections for that put cell expansion=0)
You should obtain 9 detections :
It could be launched in the script by this command : runPlugin('qupath.imagej.detect.cells.WatershedCellDetection',
'{"detectionImage":"Channel 1","requestedPixelSizeMicrons":1.0,"backgroundRadiusMicrons":30.0,"backgroundByReconstruction":true,
"medianRadiusMicrons":0.0,"sigmaMicrons":1.5,"minAreaMicrons":10.0,"maxAreaMicrons":900.0,"threshold":25.0,"watershedPostProcess":true,
"cellExpansionMicrons":0.0,"includeNuclei":true,"smoothBoundaries":true,"makeMeasurements":true}')
6- Classify the detected spots as beads (because the groovy script is working only on class detections). To do that go in the menu Classify/Object classification/create single measurtements classifier and put the theshold to the minimum to be sure to select all the spots:
You can put a classifier name (beads) to save the classifier in the project.
Then you should obtain this:
7- Launch the script DBSCAN.groovy (drag and drop) on the annotation with the parameter MinPts=3 and distance=100um
8- You should obtain one cluster of 8 beads (one is outside the cluster). To classify the cluster beads, go in the menu Classify/Object classification/create single measurtements and look for the measurements cluster:
You can put a classifier name (cluster) to save the classifier in the project.
9- You can hide the none class (spots that do not belong to cluster) by clicking on spacebar on the None class and change the color of the cluster class by double click on it:
10- To conclude, DBSCAN on Qupath is working perfectly and we find the same results as published with MinPoints =3 (and not MinPoints=4) if we consider the real number of neigbors without counting the central point itself. The border points are belonging to the cluster. You can try on this example the following parameters : MinPoints = 4 with distance=100um, you will find no cluster. With MinPoints = 4 and d=120um, you will find a cluster of 6 points (core = 2 points indicated with the red arrow and border points = 4 points):
11- To go further : to apply DBSCAN on multiple annotations, load the roi.zip (with name of annotated regions) or draw the annotations in Qupath and apply the groovy script "DBSCAN_loopRegion.groovy" that contain the loop for the regions. The classifier beads and clusters are saved in a folder named classifiers/object_classifiers (with threshold values) and can be reused with the groovy script command :
runObjectClassifier("beads");
runObjectClassifier("cluster");
You can dezip the classifiers.zip to obtain the classifiers and put it in your qupath project