//Needs 3D ImageJ suite, ImageScience and IJPB added to Fiji Dialog.create("Set cutoff"); Dialog.addNumber("Threshold: ", 330.0); Dialog.addNumber("Padding (pixels): ", 0); Dialog.addNumber("Minimum object size (pixels): ", 1000); Dialog.addCheckbox("Use uncalibrated pixel value?",false); Dialog.addCheckbox("Crop? ", true); Dialog.addCheckbox("Autosave and close? ", true); Dialog.show(); threshold = Dialog.getNumber(); buffer = Dialog.getNumber(); minSize = Dialog.getNumber(); calibrated = !Dialog.getCheckbox(); crop = Dialog.getCheckbox(); autosave = Dialog.getCheckbox(); list = getList("image.titles"); setBatchMode(true); for (i = 0; i < list.length; i++) { dims = newArray(6); selectImage(list[i]); if(autosave){ path = getInfo("image.directory") + list[i] + "-isolated\\"; File.makeDirectory(path); } Stack.getStatistics(voxelCount, mean, min, tMax, stdDev); if(calibrated){ setThreshold(threshold, tMax); run("Convert to Mask", "method=Default background=Dark black create"); } else{ setThreshold(threshold, Math.ceil(((tMax-calibrate(0))/(calibrate(1)-calibrate(0)))), "raw"); run("Convert to Mask", "method=Default background=Dark black create"); } for(k=0; k