Hi all,

I have a list of XY coordinates from CytoMAP that have been, unfortunately, truncated/rounded in different ways depending on the number of decimal places - by MATLAB. Currently I am rounding QuPath’s XY coordinates for all cells and searching that list, which is noticeably slow at high numbers of cells.

What is the quickest way, per XY coordinate for a set of 100,000+ XY coordinates, to find the detection that contains it’s rounded XY coordinate (to avoid cycling through all of them)?

The assumption could be made that there will only be one detection overlapping those coordinates for the purposes of this script.

## Thoughts

Not sure if I should go into JTS ROIs for this or something else (but how would I know which detection to use for an ROI?). Creating objects to check if they are “inside” seems like it would be very slow from other code I have written doing similar things. getObjectsForROI wouldn’t work well since I would have to create objects.

I would like to avoid cycling through all detections to see if each contains the point. Not sure if I am missing something obvious.

Also looking into dividing the cells up into tile-groups so that I am comparing the XY coordinates to a given set of cells instead of all of them.

In case it helps, these are the coordinates for the same cell, from QuPath and then returning from MATLAB.

Cheers,

Mike