Created
April 29, 2020 16:57
-
-
Save ekatrukha/f321b869ec8473036f5a756a19b25130 to your computer and use it in GitHub Desktop.
ImageJ macro for ComDet batch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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