Posted by
Kim Sanghyun on
Oct 03, 2011; 9:37pm
URL: http://imagej.273.s1.nabble.com/bugs-in-batch-mode-tp3682997p3682999.html
Hi Michael,
Thanks. Yes, I found that no maxima in the image was the problem.
Somehow the index in "if/else"and "for" seem not to work properly in the batch mode. In non batch mode, ImageJ choose the right ROI and do this operation properly. But in batch mode, it choose wrong one and create an empty image, so no maxima in that case.
Still I could not find the exact bug point....
Sanghyun.
SangHyun Kim (Post-Doc.) Tel. 972-8-9343423
[hidden email]
@ Dep. of Materials and Interfaces, Weizmann Institute of Science, Rehovot 76100, Israel
>>> Michael Schmid <
[hidden email]> 10/3/2011 4:10 PM >>>
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