Skip to content

Instantly share code, notes, and snippets.

@miura
Created September 3, 2013 17:01
Show Gist options
  • Save miura/6426584 to your computer and use it in GitHub Desktop.
Save miura/6426584 to your computer and use it in GitHub Desktop.
imp = IJ.getImage()
midslice = int(imp.getStackSize() / 2)
imp.setSlice(midslice)
#IJ.setThreshold(-50, -0.62)
ip.setAutoThreshold(AutoThresholder.Method.Default, False)
IJ.setThreshold(ip.getMinThreshold(), ip.getMaxThreshold())
print ip.getMaxThreshold()
print ip.getMinThreshold()
#th = ip.getMaxThreshold()
IJ.run("Convert to Mask", "method=Default background=Light black")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment