/* * Roughness approximater * * Macro to determine the 'roughness' of a surface in a binary AmiraMesh file * Assumptions: * Object oriented laterally i.e. slices look through the xy plane / along the z axis * Z = 0 is the bottom, Z = max is the top * the surface is defined as the FIRST edge encountered relative to the base of the object * Macro fails for complicated structures, or objects that deviate significantly from a predominantly * smooth surface relative to the base * * Measurements are all in pixels */ print("\\Clear"); IJ.log("Starting analysis"); IJ.log("*****************"); dir1 = getDirectory("Save location for results"); extension = ".am"; dir = getDirectory("Choose Source Directory "); setBatchMode(true); n = 0; processFolder(dir); function processFolder(dir) { list = getFileList(dir); for (i=0; i