Skip to content

Instantly share code, notes, and snippets.

@ekatrukha
Created April 29, 2020 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekatrukha/f321b869ec8473036f5a756a19b25130 to your computer and use it in GitHub Desktop.
Save ekatrukha/f321b869ec8473036f5a756a19b25130 to your computer and use it in GitHub Desktop.
ImageJ macro for ComDet batch
//get folder with files
input = getDirectory("Input directory");
//!!!define suffix of files here
suffix = ".tif";
list = getFileList(input);
for (i = 0; i < list.length; i++)
{
if(endsWith(list[i], suffix))
{
basecurr = input+list[i];
//open file
open(basecurr);
print("Processing: ",basecurr);
//get file ID
openImageID=getImageID();
//do something to file, max proj, etc
//in this case, call ComDet with some parameters
//!!! insert detection line from Recorder here!!!!
run("Detect Particles", "ch1i ch1l ch1a=4 ch1s=50 rois=Ovals add=Nothing");
//Save Results
results_filename = basecurr +"_Results.csv";
selectWindow("Results");
saveAs("Results", "results_filename");
//Save Summary
selectWindow("Summary");
summary_filename = basecurr +"_Summary.csv";
saveAs("Results", summary_filename);
//select image again and close it
selectImage(openImageID);
close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment