Posted by
Weller Andrew Francis on
Jun 30, 2006; 3:29pm
URL: http://imagej.273.s1.nabble.com/Segmentation-macro-problems-still-tp3702363p3702365.html
OK, so it's not setBatchMode that's causing the problem, but
thresholding. I've tried several combinations of:
run("Threshold", "thresholded");
run("Threshold", "thresholded remaining");
run("Threshold", "thresholded remaining black");
run("Threshold", "thresholded black");
etc
and it appears that it isn't doing it correctly. It kinda just
thresholds everything, and therefore the Particle Analyzer doesn't work
as the wrong information is passed to it. I've tried opening and
re-saving my images as new tifs, but nothing.
Is this a bug?
I am running 1.37j and need this as I use the run("Create Selection")
function.
Thanks, Andy
On Fri, 2006-06-30 at 14:57 +0200, seb wrote:
> Andy Weller wrote:
> > Dear all,
> >
> > Can anyone see any problems with the following macro? I can't for the
> > life of me get it doing what I want it to do.
> >
> > In essence I want my segmented particle (bright foreground, black
> > background) and its associated ROI saved, but all I keep getting is
> > black and white images (black particle + specks, white background). I've
> > tried all various settings I can think of (threshold, etc), but nothing.
> > My current problem is this:
> >
> > The 'Particle Analyzer' box comes up with "A threshold image or 8-bit
> > binary image is required. Threshold levels can ve set using the Image ->
> > Adjust -> Threshold tool." I am doing this (see macro), but the strange
> > thing is, it seems to work manually...?!
> >
> > Many thanks, Andy
> >
> > <MACRO>
> >
> > setBatchMode(true);
> [SNIP]
>
> save(fileName+".tif");
> > selectImage(mask);
> > run("Create Selection"); // requires 1.37j
> > selectImage(img);
> > run("Restore Selection");
> > save(fileName+".roi");
>
>
> Hello Andy, hello ImageJers
>
> I might be wrong, but I noticed some strange behaviours with the
> setBatchMode(true) recently.
> I don't know yet what's going wrong but when setBatchMode is set to
> "true" before some piece of macro code creating a new image it seems to
> fail, at least with some combinations of ij/JRE.
> I didn't post it because I had to check first on other ij installations.
> Could you try without setBatchMode?
>
> sebastien.