Pixel Inspector Tool automatisation

Dear all,

I am familiar with the Pixel Inspector Tool. I use it to train naive bayes models for image segmentation. I know ilastik can do it, but that program is awfully slow on my computer. When I use the pixel inspector tool, the absolute maximum you can get out from it is a radius of 10. In other words, a matrix of 21x21 values or a total of 441 pixels. However, for some pictures this size is too big and has to be adjusted to a lower radius.

Training these models is quite slow, and I would like to make it more high throughput. Save measurements is not an option with the pixel inspector tool. So now for every measurement I have to do CTRL+C and than paste them in Excel with CTRL+V. Than I have to put all the values in this matrix into a list for a certain object and do this for all objects. Obviously this last part of fusing multiple columns into one column can be done with R-studio, Excel or Python etc…

What I would like to have is the possibility to click rapidly and get the measurements in a list or automatically into an Excel file. At least that ImageJ saves the data from every click… It would even be better if it is possible to not click all the measurements, but that I can slide the pixel inspector tool and get real-time data input when I keep my mouse clicked in.

I hope you guys can help me. Thanks.

You can have it more sophisticated by using ROI’s (selections), see this example code to extract pixels values:

Roi.getContainedPoints(x,y); (macro function)

https://imagej.nih.gov/ij/plugins/roi-iterator/index.html

You could e.g., write a simple macro to transfer you selection od arbitrary size and geometry which is more suited for classification.

You can easily install a key listener for you macro, too (instead of a mouse listener).

See also:

https://imagej.nih.gov/ij/plugins/download/Mouse_Listener.java