<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 - Bug in the Intermodes algorithm of threshold"
   href="http://fiji.sc/bugzilla/show_bug.cgi?id=938">938</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bug in the Intermodes algorithm of threshold
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Fiji
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows
          </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>gadea.mata@unirioja.es
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>gadea.mata@unirioja.es
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Dear all,

We're looking for what is the best threshold algorithm for our images. We've
seen that if we use the function "Auto Threshold" to obtain the differents
threshold values for each algortithm, the Intermodes algorithm returns a
different threshold value, that if we use the function "Threshold..." choosing
the Intermodes method.

We've studied the code of both algorithms, and we think that the algorithm
developed in the plugin "Threshold..." has a bug. We've studied the code
available at <a href="http://imagej.nih.gov/ij/source/ij/process/AutoThresholder.java">http://imagej.nih.gov/ij/source/ij/process/AutoThresholder.java</a>,
and we think that the problem arises in Line 199 of such a code. The loop in
Line 199 concerns the computation of the new values of the histogram. For each
step of the loop, the new value of the histogram is calculated using the values
of the updated histogram instead of using the values of the original histogram. 

However, the Intermodes algorithm in the plugin "Auto Thresholder" is correct.

We attached you a minimal macro that reproduces this bug:

run("Neuron (1.6M, 5 channels)");
run("Split Channels");
//close all channels minus channel 2
selectWindow("C5-Rat_Hippocampal_Neuron.tif");
close();
selectWindow("C4-Rat_Hippocampal_Neuron.tif");
close();
selectWindow("C3-Rat_Hippocampal_Neuron.tif");
close();
selectWindow("C2-Rat_Hippocampal_Neuron.tif");
selectWindow("C1-Rat_Hippocampal_Neuron.tif");
close();
selectWindow("C2-Rat_Hippocampal_Neuron.tif");
//AUTO THRESHOLD
run("Auto Threshold", "method=[Try all] white show");
//the threshold value of Intermodes method: 525
close();
selectWindow("C2-Rat_Hippocampal_Neuron.tif");
//THRESHOLD
setAutoThreshold("Intermodes dark");
//run("Threshold...");
setThreshold(1713, 6238); //here, the threshold value is 1713
run("Convert to Mask");
run("Close");

Best regards,

--Gadea Mata Martínez
<a href="mailto:gadea.mata@unirioja.es">gadea.mata@unirioja.es</a>
Department of Mathematics and Computer Science
University of La Rioja
Logroño, La Rioja (Spain)

Information about your version of Java:

  os.arch => x86
  os.name => Windows 7
  os.version => 6.1
  java.version => 1.6.0_24
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_24-b07
  java.vm.name => Java HotSpot(TM) Client VM
  java.vm.version => 19.1-b02
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to:
C:\Users\gamata\PROGRA~1\Fiji.app/java/win32/jdk1.6.0_24//jre
  imagej.dir => C:\Users\gamata\PROGRA~1\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:20140925235708)
Fiji: <a href="http://fiji.sc/update/">http://fiji.sc/update/</a> (last check:20141002110637)</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>