Login  Register

Re: macro ImageJ

Posted by Michelina Nascimbeni on Jul 11, 2007; 4:50pm
URL: http://imagej.273.s1.nabble.com/macro-ImageJ-tp3698877p3698879.html

Hi Michael,

Thanks for your answer. Actually, our macro runs on a folder containing a
set of images. We need to include the watershed function into this macro and
run this on the whole folder not only on one single picture.
Any other idea?
Thanks
Michelina


2007/7/11, Michael Schmid <[hidden email]>:

>
> Hi Michelina,
>
> you have to run Edit>Selection>Create Mask after setThreshold:
>    run("Create Mask");
> This creates the 8-bit binary image required.
> The mask will be in a separate window, so don't forget to close
> both, the mask and the original window.
>
> Michael
> ________________________________________________________________
>
> On 11 Jul 2007, at 16:35, Nascimbeni wrote:
>
> > Hello all,
> >
> > We do have a macro "Analyze Particles" (the copy is joined below).
> > We would like to add to that macro a watershed function.
> > We tried to add run("Watershed"); just after setThreshold(30, 80); but
> > this did not work. A message telling "8-bit binary image (0 and 255)
> > required" appears.
> > Anybody has a solution???
> >
> > Thanks a lot
> > Best regards
> > Michelina Nascimbeni
> >
> >
> >
> > requires("1.38o");
> >      dir = getDirectory("Choose a Directory ");
> >      list = getFileList(dir);
> >      setBatchMode(true);
> >      for (i=0; i<list.length; i++) {
> >          showProgress(i, list.length);
> >          open(dir+list[i]);
> >          getStatistics(area, mean, min, max, std);
> >          threshold = mean + 2.5*std;
> >          setThreshold(30, 80);
> >          run("Analyze Particles...", "size=100-650 summarize");
> >          close;
> >      }
> >      selectWindow("Summary");
> >      saveAs("Text", getDirectory("home")+"Summary.txt");
>