Last active
August 29, 2015 13:56
-
-
Save thomie/9025224 to your computer and use it in GitHub Desktop.
ImageJ Macro to 3D project all images in directory
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
// ImageJ Macro to 3D project all images in directory | |
// | |
// Created by Thomas Miedema | |
// February 15th 2014 | |
// | |
// Tested with: ImageJ = 1.48q | |
// Probably works with: ImageJ >= 1.47o | |
// Doesn't work with: ImageJ = 1.46a | |
// rsb.info.nih.gov/ij/developer/macro/functions.html | |
// Do not display images. | |
setBatchMode(true) | |
inputDirectory = getDirectory(""); | |
outputDirectory = getDirectory(""); | |
list = getFileList(inputDirectory); | |
for (i = 0; i < list.length; i++) { | |
open(inputDirectory + list[i]); | |
run("Set Scale...", "distance=1 known=0.166 pixel=1 unit=um global"); | |
setSlice(nSlices / 2); | |
resetMinAndMax(); | |
run("3D Project...", "projection=[Brightest Point] axis=Y-Axis slice=0.3 initial=0 total=360 rotation=10 lower=1 upper=255 opacity=0 surface=100 interior=50 interpolate"); | |
saveAs("Tiff", outputDirectory + File.nameWithoutExtension + "-3dprojection"); | |
close(); | |
close(); | |
} | |
setBatchMode(false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment