<html>
<head>
<base href="http://fiji.sc/bugzilla/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:hinerm@gmail.com" title="Mark Hiner <hinerm@gmail.com>"> <span class="fn">Mark Hiner</span></a>
</span> changed
<a class="bz_bug_link
bz_status_CONFIRMED "
title="CONFIRMED - Analyze Particles and Bug Report not working"
href="http://fiji.sc/bugzilla/show_bug.cgi?id=1059">bug 1059</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>REOPENED
</td>
<td>CONFIRMED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>imagej-bugs@imagej.net
</td>
</tr>
<tr>
<td style="text-align:right;">Component</td>
<td>Other
</td>
<td>ImageJ1
</td>
</tr>
<tr>
<td style="text-align:right;">Assignee</td>
<td>imagej-bugs@imagej.net
</td>
<td>wsr@nih.gov
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_CONFIRMED "
title="CONFIRMED - Analyze Particles and Bug Report not working"
href="http://fiji.sc/bugzilla/show_bug.cgi?id=1059#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_CONFIRMED "
title="CONFIRMED - Analyze Particles and Bug Report not working"
href="http://fiji.sc/bugzilla/show_bug.cgi?id=1059">bug 1059</a>
from <span class="vcard"><a class="email" href="mailto:hinerm@gmail.com" title="Mark Hiner <hinerm@gmail.com>"> <span class="fn">Mark Hiner</span></a>
</span></b>
<pre>Oh, of course it requires float data. It's right there in the stack trace.
Sorry I missed that.
Anyway, looks like this is a bug in ImageJ 1.x so I'm giving this to Wayne.
The problem is that the getMedian method in FloatStatistics checks for even or
odd values:
<a href="https://github.com/imagej/ImageJA/blob/v1.49r/src/main/java/ij/process/FloatStatistics.java#L239">https://github.com/imagej/ImageJA/blob/v1.49r/src/main/java/ij/process/FloatStatistics.java#L239</a>
When the pixel array is empty, size = 0 which tests as even.
This causes index "0 - 1" to be accessed of the pixel array here:
<a href="https://github.com/imagej/ImageJA/blob/v1.49r/src/main/java/ij/process/FloatStatistics.java#L240">https://github.com/imagej/ImageJA/blob/v1.49r/src/main/java/ij/process/FloatStatistics.java#L240</a>
which causes the reported error.
Probably want to either return 0 or throw an exception if there are no
pixels..?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>