Use Fiji (ImageJ) to create Voronoi diagrams of a folder of images. Macro. run(“Make Binary”); run(“Skeletonize (2D/3D)”);

Use Fiji (ImageJ) to create Voronoi diagrams of a folder of images. Macro. run(“Make Binary”); run(“Skeletonize (2D/3D)”);  [my first ImageJ Macro)

/*
* Macro template to process multiple images in a folder
*/

input = getDirectory(“Input directory”);
output = getDirectory(“Output directory”);

Dialog.create(“File type”);
Dialog.addString(“File suffix: “, “.tif”, 5);
Dialog.show();
suffix = Dialog.getString();

processFolder(input);

function processFolder(input) {
list = getFileList(input);
for (i = 0; i < list.length; i++) {
if(File.isDirectory(list[i]))
processFolder(“” + input + list[i]);
if(endsWith(list[i], suffix))
processFile(input, output, list[i]);
}
}

function processFile(input, output, file) {
setBatchMode(true);
// do the processing here by replacing
// the following two lines by your own code
open(file);
path = getDirectory(“image”);
title = getTitle();
setOption(“BlackBackground”, true);
run(“Make Binary”);
run(“Skeletonize (2D/3D)”);
saveAs(“gif”,path+title+”.gif”);
close();
}

Leave a comment

Your email address will not be published. Required fields are marked *


5 − two =

Leave a Reply