Hi everyone,
So I’m trying to write a macro to batch analyze photos for colocalization using the coloc2 plugin in imageJ. I have two directories that contain preprocessed images, all ordered the same way between the two different directories. I basically want to do coloc2 analysis for each pair of images in the different directories. I then save the PDF in a third directory.
I’m having trouble getting the macro to work. It runs for a brief second and then says the command is finished. I’m not sure if I am using the wrong language during the “run(coloc2…)” command, or if there is something else wrong. Could someone help me out here? The code is listed below.
macro "batch_coloc2" {
count = 1;
setBatchMode(true);
file1 = getDirectory("C1");
list1 = getFileList(file1);
n1 = lengthOf(list1);
file2 = getDirectory("C2");
list2 = getFileList(file2);
n2 = lengthOf(list2);
file3 = getDirectory("Output");
small = n1;
if(small<n2){
small = n2;
for (i=0; small<1; i++){
open(file1+list1[1]);
open(file2+list2[1]);
run("Coloc 2", "channel_1=["+list[1]+"] channel_2=["+list[2]+"] roi_or_mask=<None> threshold_regression=Costes display_images_in_result spearman's_rank_correlation manders'_correlation costes'_significance_test psf=3 costes_randomisations=10");
save(file3);
close();
}
}
}