Re: single slice in stack: make binary / convert to mask
Posted by
Stephen Towler on
Mar 28, 2008; 3:41pm
URL: http://imagej.273.s1.nabble.com/single-slice-in-stack-make-binary-convert-to-mask-tp3696752p3696754.html
Wayne,
That is *incredibly* helpful.
Thanks so much,
Stephen
On Thu, Mar 27, 2008 at 11:51 AM, Wayne Rasband <
[hidden email]> wrote:
> > Hi all. We would like to apply Process -> Binary -> Convert to Mask
> > to individual slices in a stack so that manual raters can,
> > slice-by-slice, threshold slices and create the resulting masks. It
> > looks like this single-slice option was removed from Make Binary in
> > v.1.37k, the same revision in which Convert to Mask was introduced.
> >
> > Is there some other way to achieve this effect in the current release?
> > If not with some feature I've overlooked, maybe with an existing
> > macro or plugin?
>
> This can be done using a macro. This one that converts the current
> slice to binary and advances to the next when you press F1.
>
> macro "Make Slice Binary [F1]" {
> if (bitDepth!=8)
> exit("8-bit grayscale image required");
> run("Select None");
> setBatchMode(true);
> id = getImageID;
> run("Create Mask");
> run("Copy");
> close;
> selectImage(id);
> run("Paste");
> setBatchMode(false);
> n = getSliceNumber;
> if (n<nSlices)
> setSlice(n+1);
> }
>
> -wayne
>
--
Stephen Towler
[hidden email]
352-294-0048 office
352-682-5231 mobile (*NEW*)
352-392-8347 fax
Leonard Lab
Department of Neuroscience
PO Box 100244
University of Florida HSC
Gainesville, FL 32610