Login  Register

Re: bugs in batch mode

Posted by Michael Schmid on Oct 03, 2011; 2:10pm
URL: http://imagej.273.s1.nabble.com/bugs-in-batch-mode-tp3682997p3682998.html

Hi Sanghyun,

hmm, I can't reproduce your problem; this macro runs correctly with  
my version of ImageJ (1.45q6):

setBatchMode(true);
run("Blobs (25K)");
setThreshold(126, 255);
run ("Invert");
run("Find Maxima...", "noise=0 output=List exclude");
   a=getResult("X", 0);
   b=getResult("Y", 0);
print("nResults="+nResults()+" a,b="+a+","+b);

It won't work, however, if your image has no maxima.  getResult("X",  
0) will result in an error if there is no line 0 in the Results table  
because the table is empty.

Michael
________________________________________________________________

On 3 Oct 2011, at 15:26, Kim Sanghyun wrote:

> Dear list,
>
> I have two strange phenomena in Batch mode which didn't happen in  
> non Batch mode during my macro running.
> At first, roiManager("count") didn't give a right number after run
> ("Analyze Particles...", ..). I guess that it counts the number of  
> particles including the rejected particles by the size limitation I  
> set. In the present time I resolved this problem by using  
> "nResults" instead of using "roiManager("count")".
>
> Second one is...
> to find the pixel position of the maximum intensity which is any  
> white place in my binary image, I used this
>  run("Find Maxima...", "noise=0 output=List exclude");
>   a=getResult("X", 0);
>   b=getResult("Y", 0);
> In batch mode, error comes as no result in the table for  
> "getResult". I don't know what is the real problem yet, because in  
> non batch mode it works well.
>
> Is there anybody who has the same problem and resolved it??
> Thanks,
> Sanghyun.
>
>
> SangHyun Kim (Post-Doc.) Tel. 972-8-9343423  
> [hidden email]
> @ Dep. of Materials and Interfaces, Weizmann Institute of Science,  
> Rehovot 76100, Israel