Two related queries (so far). I’m attempting to threshold a batch of images. I’ve already written a macro to crop a standard-sized portion of an image , rename and save the images in a different folder.
It’s based on the Process Folder IJ1 template and adapted according to these instructions
It works nicely (at least it works from the macro editor!), with a popup box to choose the directories then saves the correct number of files as I intended but I keep getting the following error message:
|Error:||Index (14) out of 0-13 range in line 22:|
|if ( File . isDirectory ( input + File . separator + list [ i <]> ) )|
Any idea why this is happening?
My next task is to to automatically threshold each image. The AutoThreshold function works fine for this, but the threshold is different for each file. Does anyone have any suggestions how to automate this process please?
If I record a macro, it will produce something along the lines of:
Is there a way of running the setThreshold function with default settings then replacing the setThreshold(0,81); line here with setThreshold(0,result_for_each_image); ?
Pretty new to this so very grateful for any suggestions