ImageJ batch processing using JaCoP plug in

Sample image and/or code

Sample image:
Lingo1_batch2_separatesettings001_s012.tif (6.0 MB)

Macro recorded:

run(“Z Project…”, “projection=[Sum Slices]”);
selectWindow(“C1-SUM_Lingo1_batch2_separatesettings001_s012.tif”);
setOption(“ScaleConversions”, true);
run(“8-bit”);
selectWindow(“C3-SUM_Lingo1_batch2_separatesettings001_s012.tif”);
setOption(“ScaleConversions”, true);
run(“8-bit”);
run("JACoP ");
selectWindow(“C1-SUM_Lingo1_batch2_separatesettings001_s012.tif”);
selectWindow(“C3-SUM_Lingo1_batch2_separatesettings001_s012.tif”);
run("JACoP ", “imga=C1-SUM_Lingo1_batch2_separatesettings001_s012.tif imgb=C3-SUM_Lingo1_batch2_separatesettings001_s012.tif costesrand=20-1-200-5.0E-4-0-true-false-true”);
selectWindow(“Randomized images of C3-SUM_Lingo1_batch2_separatesettings001_s012.tif”);
selectWindow(“C1-SUM_Lingo1_batch2_separatesettings001_s012.tif”);
setAutoThreshold(“Default dark”);
//run(“Threshold…”);
setAutoThreshold(“Otsu dark”);
//setThreshold(26, 255);
setOption(“BlackBackground”, false);
run(“Convert to Mask”);
run(“Close”);
run(“Analyze Particles…”, “size=0.2-3.14 exclude summarize add”);
selectWindow(“Randomized images of C3-SUM_Lingo1_batch2_separatesettings001_s012.tif”);
setAutoThreshold(“Otsu dark”);
//run(“Threshold…”);
//setThreshold(43, 255);
run(“Convert to Mask”);
run(“Close”);
roiManager(“Measure”);
saveAs(“Results”, “/Users/nano/Desktop/trial_img12_scrambled.csv”);
selectWindow(“C3-SUM_Lingo1_batch2_separatesettings001_s012.tif”);
setAutoThreshold(“Otsu dark”);
run(“Convert to Mask”);
run(“Close”);
roiManager(“Measure”);
saveAs(“Results”, “/Users/nano/Desktop/lingo12_unscrambled.csv”);
close();

Background

I’m trying to quantify the colocalisation of target channel puncta (Channel 1) in my synaptic marker puncta (Channel 3). I want to use JaCoP’s Coste’s randomization feature to scramble the synaptic channel. The idea is to test whether the colocalisation I observe with my macro is statistically different when I scramble the image, i.e the colocalisation is not by chance. I attempted to record the macro, but how do I specify the “name” of the image that needs to be scrambled and saveitasTiff?

Analysis goals

Batch processing the Costes randomization feature from the JaCoP plug-in.

Challenges

I’m unable to batch process the costes randomization feature in my macro, please find the attached error message and the macro.

image

I’m new to ImageJ, any help will be highly appreciated. Thank you!