Skip to content
Snippets Groups Projects
Commit 41024b84 authored by Marius Hintsche's avatar Marius Hintsche
Browse files

add avi export macro

parent 1e532a76
No related branches found
No related tags found
No related merge requests found
//This macro should be called in Fiji's headless mode e.g.
// fiji --headless -macro /path-to-macro.ijm /path-to-file.tif
// or by runMacro(macro, arg)
// (apparently file path must be absolute)
frameRate = 20; // set fixed frame rate TODO: read time resolution and calculate frate
outExtension = ".avi";
inFile = getArgument();
dotIndex = lastIndexOf(inFile, ".");
if (dotIndex >= 0) {
baseName = substring(inFile, 0, dotIndex);
}
outFile = baseName+outExtension;
// escape spaces in path with \ and "" // does not work!
//outFile = "\"" + outFile + "\"";
//outFile = replace(outFile, " ", "\\\\\\\\ ");
if ( indexOf(outFile," ") >= 0 ) {
exit("Input path must no contain whitespace!");
}
//print("will export to "+outFile);
setBatchMode(true);
open(inFile);
run("8-bit");
run("AVI... ", "compression=JPEG frame="+frameRate+" save="+outFile);
close();
setBatchMode(false);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment