/** * NeSys_Median_Filtering_Macro.txt * @version 1.1 * @author e.a.papp at medisin.uio.no * * This ImageJ macro applies a median filter with a user-specified * radius to a series of binary images. The images are expected * to be within the same directory. The resulting filtered images * are saved in .gif format in a separate directory. * * Requirements: * - ImageJ version 1.35g or later * - Only handles binary images, other files will not be processed * - The images should be in one of the following formats: * .gif, .jpg, .jpe, .jpeg, .png, .tif, .tiff, .bmp, .pgm * * This macro is part of a workflow for automated detection of axonal labeling * in series of microscopic images. See the ImageJ DokuWiki for details: * http://imagejdocu.tudor.lu/doku.php?id=plugin:analysis:autodetection_of_neuronal_labeling_in_histological_image_series:start */ imgdir = getDirectory("Choose Image Directory "); outputdir = getDirectory("Choose Output Directory "); radius = getNumber("Set radius of median filter: ",1) list = getFileList(imgdir); setBatchMode(true); for (i=0; i