name = getTitle() run("Duplicate...", "title=[multichannel]"); run("Split Channels"); selectWindow("multichannel (green)"); run("16-bit"); run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel"); run("Invert"); run("Duplicate...", "title=[name_1]"); run("Duplicate...", "title=[name_3]"); selectWindow("name_3"); selectWindow("multichannel (red)"); //run("Threshold..."); setThreshold(5, 255); run("Make Binary", "thresholded remaining black"); run("Create Selection") selectWindow("name_3"); run("Restore Selection"); run("Enhance Contrast...", "saturated=10"); run("Select None"); run("Subtract Background...", "rolling=3 light"); run("Smooth"); run("Smooth"); run("Smooth"); run("Restore Selection"); run("Enhance Contrast...", "saturated=.5"); run("Make Binary"); run("Fill Holes"); selectWindow("name_1"); run("Find Maxima...", "noise=30 output=[Single Points] light"); run("Create Selection"); run("Enlarge...", "enlarge=5"); selectWindow("name_3"); run("Invert"); run("Restore Selection"); run("Clear", "slice"); run("Select None"); selectWindow("name_1"); setOption("BlackBackground", false); run("Make Binary"); run("Erode"); run("Erode"); run("Erode"); run("Dilate"); run("Dilate"); run("Dilate"); run("Dilate"); run("Dilate"); run("Dilate"); run("Create Selection"); selectWindow("name_3"); run("Restore Selection"); run("Clear", "slice"); run("Select None"); run("Invert"); run("Skeletonize"); run("Canvas Size...", "width=1020 height=1020 position=Center"); run("Make Binary") run("Analyze Skeleton (2D/3D)", "prune=none calculate"); close("Tagged skeleton"); close("Longest shortest paths"); // *********************************************************************** // *********************************************************************** // Replace the following directory with desired location for .csv files // Note the presence of '\\' rather than the convetional '/' saveAs("Results", "C:\\Example\\File\\Path\\" + name + ".csv"); // *********************************************************************** // *********************************************************************** run("Close");