<html>
<head>
<base href="http://fiji.sc/bugzilla/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - ij.process.AutoThresholder and fiji.threshold.Auto_Threshold return different values"
href="http://fiji.sc/bugzilla/show_bug.cgi?id=1183">1183</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ij.process.AutoThresholder and fiji.threshold.Auto_Threshold return different values
</td>
</tr>
<tr>
<th>Product</th>
<td>Fiji
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>Mac OS
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P4
</td>
</tr>
<tr>
<th>Component</th>
<td>Plugins
</td>
</tr>
<tr>
<th>Assignee</th>
<td>imagej-bugs@imagej.net
</td>
</tr>
<tr>
<th>Reporter</th>
<td>radoslaw@ejsmont.net
</td>
</tr>
<tr>
<th>CC</th>
<td>radoslaw@ejsmont.net
</td>
</tr></table>
<p>
<div>
<pre>Hi,
I have been developing a jython script ij which I needed to autothreshold some
stacks. I have first used the ij.process.AutoThresholder using histogram I got
from the following snipplet:
```
for zsliceno in range(1, stack.getSize() + 1):
zslice = stack.getProcessor(zsliceno)
if zsno == 1:
histogram = zslice.getHistogram()
else:
temp = zslice.getHistogram()
for i in range(0, len(histogram)):
histogram[i] += temp[i]
thresholder = AutoThresholder()
threshold = thresholder.getThreshold("Moments", histogram)
```
calling the plugin gives a different value:
```
thresholder = Auto_Threshold()
anarray = thresholder.exec(image, "Moments", False, False, True, True, False,
True)
```
The image is 16-bit. These seems to be a bug in ij.process.AutoThresholder, or
I am doing something terribly wrong :)
Information about your version of Java:
os.arch => x86_64
os.name => Mac OS X
os.version => 10.11.1
java.version => 1.8.0_51
java.vendor => Oracle Corporation
java.runtime.name => Java(TM) SE Runtime Environment
java.runtime.version => 1.8.0_51-b16
java.vm.name => Java HotSpot(TM) 64-Bit Server VM
java.vm.version => 25.51-b03
java.vm.vendor => Oracle Corporation
java.vm.info => mixed mode
java.awt.graphicsenv => sun.awt.CGraphicsEnvironment
java.specification.name => Java Platform API Specification
java.specification.version => 1.8
sun.cpu.endian => little
sun.desktop => null
file.separator => /
The up-to-date check says: REMIND_LATER
Information relevant to JAVA_HOME related problems:
JAVA_HOME is set to:
/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home//jre
imagej.dir => /Applications/Fiji.app
Information about the version of each plugin:
Activated update sites:
ImageJ: <a href="http://update.imagej.net/">http://update.imagej.net/</a> (last check:20151026205651)
Fiji: <a href="http://update.fiji.sc/">http://update.fiji.sc/</a> (last check:20151028163859)
3D ImageJ Suite: <a href="http://sites.imagej.net/Tboudier/">http://sites.imagej.net/Tboudier/</a> (last check:20151103085731)
Files not up-to-date:
968c6425 (MODIFIED) 20151103165434 Contents/Info.plist
3af43208 (MODIFIED) 20150906115145 jars/jython-shaded-2.7.0.jar
e85a2018 (LOCAL_ONLY) 20150121223046
plugins/DeconvolutionLab/DeconvolutionLab_.jar
71331805 (LOCAL_ONLY) 20100820154940 plugins/jacop_.jar</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>