Last active
August 29, 2015 13:57
-
-
Save miura/9845061 to your computer and use it in GitHub Desktop.
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
setBatchMode(true); | |
title = getTitle(); | |
c1 = "C1-" + title; | |
c2 = "C2-" + title; | |
run("Split Channels"); | |
selectWindow(c1); | |
c1ID = getImageID(); | |
selectWindow(c2); | |
c2ID = getImageID(); | |
run("Gaussian Blur...", "sigma=1"); | |
run("Auto Threshold", "method=Li white"); | |
run("Open"); | |
run("Fill Holes"); | |
run("Duplicate...", "title=C2-2-" + title); | |
c2bID = getImageID(); | |
setOption("BlackBackground", true); | |
for (i = 0; i < 3; i++) | |
run("Erode"); | |
selectImage(c2ID); | |
for (i = 0; i < 3; i++) | |
run("Dilate"); | |
imageCalculator("Subtract create", c2ID, c2bID); | |
rimID = getImageID(); | |
run("Create Selection"); | |
run("Make Inverse"); | |
roiManager("Add"); | |
selectImage(c1ID) | |
run("Set Measurements...", "area mean min integrated redirect=None decimal=2"); | |
roiManager("select", 0) | |
roiManager("Measure"); | |
//cleanup | |
selectImage(c2ID); close(); | |
selectImage(c2bID); close(); | |
selectImage(rimID); close(); | |
setBatchMode("exit and display"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment