First of all, melvingelbard and Research_Associate: thank you very much for your help.
I am very sorry but I am not allowed to upload any image.
With “empty center of cells” I just meant the inner part of each cell which is empty since the cells are dead and the protoplasm is absent. Since the RGB images are brightfield, it is possible to see the white background, meaning that each cell is white except for the cell walls. My goal is create a point in each cell belonging to the same row, in order to count the number of cells in a row. I chosen the Counting tool to do that manually but it is a time-consuming process. Since the picture is rather simple, I thought that it might be easy to use an automatic detection of single cells and creation of a point inside them.
I am happy with the automatic detection after setting up some parameters. It would be nice to set the new values of the parameters as standard values. In this way, I should not set the parameters everytime I open the Cell detection tool.
[quote=“Research_Associate, post:7, topic:42313”]
If everything is white except the cell walls, it should be fairly easy to threshold on white and then remove all large objects (assuming the background outside of the cell walls is “large” relative to the inside of the cell walls).
[/quote] Keeping in mind that the cells are arranged side by side in a row (horizontally oriented), the background outside the cell walls is only below and above the row. In order to exclude these portions, I drew a narrow polygon which does not touch the upper and lower cell walls.
To wrap up:
- I have more polygons and each polygon covers a whole row
- in each row, single cells have been detected by the automatic cell detection tool. In the cell detection tool, It would be nice to set the new values of the parameters as standard values. In this way, I should not set the parameters everytime I open the Cell detection tool.
- I would need to “convert” each cell (Detection object) in a single Point and it needs the script proposed by melvingelbard, I guess.
- Would it be possible to restrict the effect of the script to the rows inside the polygons?
- By using the script form melvingelbard, I obtained an error and the sofware suggested me to add “import qupath.lib.scripting.QP” at the beginning of the script. However it does not work:
xs = [ ]
ys = [ ]
xs << it.getROI().getCentroidX()
ys << it.getROI().getCentroidY()
createPointsROI(xs, ys, QPEx.getCurrentViewer().getImagePlane())
Feedback from the sofware:
ERROR: MissingMethodException at line 10: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.createPointsROI() is applicable for argument types: (ArrayList, ArrayList, qupath.lib.regions.ImagePlane) values: [[6936.4296875, 6853.93505859375, 6765.14990234375, 6681.50537109375, …], …]