Skip to content

Instantly share code, notes, and snippets.

@Omnistic
Created July 9, 2021 10:35
Show Gist options
  • Save Omnistic/76dc38f2f532be78952b41c61fec542d to your computer and use it in GitHub Desktop.
Save Omnistic/76dc38f2f532be78952b41c61fec542d to your computer and use it in GitHub Desktop.
SIMVIEW_Multistack-ZProj_FijiMacro
path = getDirectory("Choose a Directory");
filename = getFileList(path);
newDir = path + "Max Projections" + File.separator;
if (File.exists(newDir))
exit("Destination directory already exists; remove it and then run this macro again");
File.makeDirectory(newDir);
for (i=0; i<filename.length; i++) {
if(endsWith(filename[i], ".stack")) {
run("Raw...", "open=["+path+filename[i]+"] image=[16-bit Unsigned] width=1024 height=624 number=20000 little-endian");
//run("Z Project...", "projection=[Max Intensity]");
run("Z Project...", "projection=[Average Intensity]");
saveAs("tiff", newDir + getTitle);
close(); close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment