I am trying to modify parts of the micaToolbox to create a custom batch processing workflow for my specific analyses. I have successfully customized scripts to (1) generate multispectral images for all raw photos in a directory and (2) loop through the .mspec files as non-linear images for ROI selection and save the ROIs to .mspec files. Pretty straightforward. Now I’m trying to customize a script to re-open the calibrated files as linear images, measure the ROIs, and save the results to a csv file. I have a functional script (modified from Load Multispectral Image and Measure ROIs) that opens each file as a linear image and automatically measures and saves the values, but ideally I’d like to do this in batch mode since the ROIs have already been selected and there is no reason to display the images.

To do this, I activated batch mode in Create Stack from Config File (called by Load Multispectral Image), but this causes an error in the next line of code, which calls Normalise & Align Multispectral Stack. Something about turning off the display of the stacked image causes a “No Image” error to appear referencing line 69 in Normalise & Align Multispectral Stack:

There are no images open in line 69

for (j = 0 ; j <nSlices> ; j++) {

Is there a way around this error, or is it not possible to measure ROIs in batch mode without displaying the photos in imageJ?

I hope that makes sense…I’m new to macro scripting so any guidance is much appreciated. Thanks in advance!

Measure ROIs in batch mode?
Cedric van den Berg Changed status to publish March 17, 2023