Hi, I’m writing a popularization paper (in Czech for local nerds) about using MICA Toolbox for analysing colour and pattern (with focus on measuring colour and pattern differences). But I found out that I cannot do a simple Pattern (granularity) analysis on my ROIs for the loaded mspec (it works for the batch mode though). It’s showing me this error:
Error: Selection required in line 602:
setSelectionLocation ( selectionX , selectionY <)> ;
I’m using older Toolbox 2.2.1. (because of “DCRaw” issues in my windows), however that should not be the problem.
Any idea why it is not working, please?
In one of the past updates, the toolbox switched to displaying pixel values in the multispectral images ranging from 0-1, rather than its corresponding bit value (i.e. 65 thousand for a 16-bit image). Thus, when defining the maximum value of luminance when choosing your settings for the script, set it as 100 rather than 2^16.
Edit: When looking into the specific line (602) of the script, it hints at looking for position descriptors of the ROIs. When removing the scale bar (which is the one ROI different from your egg ROIs), the error disappears and the script runs through.
Therefore, the error seems to be caused by a difference between the batch script and the standalone script in how they deal with the scale bar (the scaling in the batch script removes it I think).
As a quick fix:
Solution 1: add ‘-1’ to the end of lines 51 and 256 in the ‘Pattern_Colour_&_Luminance_Measurements’ script, save the file and refresh your imageJ menus (or close and open it).
When running your script on your images, make sure the scale bar is at the bottom of your ROI list (i.e. create it last).
Solution 2: Just delete the scale bar
This should allow the script to run through.
I hope this helps?
thank you for your help!
Both solutions work. Solution 2 is definitely better because the batch script (“Batch_Multispectral_Image_Analysis”) is using the singular script (“Pattern_Colour_&_Luminance_Measurements”) and making the change in it as you recommend in your solution 1 would cause another problem (deleting last ROI we want to measure).
Best way definitely remains to use batch script for analysing patterns which actually deletes scale bar by using the script for scaling the image (Multispectral_Image_Scaler). Therefore the error I mentioned at the beginning is not appearing when using batch script.