single slice in stack: make binary / convert to mask

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

single slice in stack: make binary / convert to mask

Stephen Towler
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?

for reference:
v1.37k, 14 July 2006: Renamed the Process/Binary/Threshold command to
Make Binary and removed the option to apply the threshold to only one
slice in a stack. Added the Process/Binary/Convert to Mask command,
which is similar to Make Binary but always creates images with white
(0) backgrounds and inverting LUTs.

Thanks!
Stephen



--
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
Reply | Threaded
Open this post in threaded view
|

Re: single slice in stack: make binary / convert to mask

Wayne Rasband
> 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
Reply | Threaded
Open this post in threaded view
|

Re: single slice in stack: make binary / convert to mask

Stephen Towler
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