Hey @RyanL24
So… I am learning these things myself … I might not be understanding your problem completely, but from what I can gather - I would try to adapt and run something like this code below in your Script Editor.
// @File(label = "Input directory", style = "directory") input
// @File(label = "Output directory", style = "directory") output
// @String(label = "File suffix", value = ".tif") suffix
processFolder(input); // calls the function below
// function to scan folders/subfolders/files to find files with correct suffix
// you can change the suffix above according to the type of image file you want to process
function processFolder(input) {
list = getFileList(input);
for (i = 0; i < list.length; i++) {
if(File.isDirectory(input + list[i]))
processFolder("" + input + list[i]);
if(endsWith(list[i], suffix))
yourMacroCode(input, output, list[i]); // calls your macro code below
}
}
// this function runs your inserted macro code (you can rename the function)
function yourMacroCode(input, output, file) {
// ADD YOUR MACRO CODE HERE TO DO PRE-PROCESSING
// including thresholding, ROI designation, etc.
// INSERT YOUR MACRO CODE HERE TO DO THE MITOCHONDRIAL MORPHOLOGY
// Leave these print statements until things work, then remove them.
print("Processing: " + input + file);
print("Saving to: " + output);
}
Those first lines of code are Script Parameters… you can read more about them here.
I hope this helps get you started a bit in any case. Perhaps a more advanced person can give you a better answer…
eta 