I have 100 images of high resolution histology brain samples with different sizes (around 20000x30000pxl) and am importing ROIs from a cell segmentation software. In total each slice has around 10000 cells/rois.
I am measuring all rois and plotting a representative subset of these cells directly in imagej (15%). For the plotting I only need 15 percent of the total rois, selected randomly. I do however need to make sure, that the selected ROIs are equally distributed. Some cells are in clusters, which means that more cells in a cluster are selected than in regions with thinner cell density → plotting will be influenced by density.
I am really struggling with how I can make sure to 1. “Randomly” select rois but on the other hand make sure that the x y coordinates of the selections are equally distributed. I was thinking about creating a grid and checking for each roi if it is in grid region X and if more then X rois are in this region delete the ROI. I am however struggling on how to implement this in macro.
Does somebody have an idea?
Any input is appreciated