http://imagej.273.s1.nabble.com/Why-is-the-median-value-zero-tp5017632p5017637.html
I can reproduce it, but I dont think that it is a bug.
ip.getStatistics() does nto claim to return the median.
centroid, center of mass, 256 bin histogram) for this image or ROI.
(including median), but I dont know how to set mOptions.
with the correct mOptions, you will get the median.
> Good afternoon Avital,
>
> I've just upgraded ImageJ to the daily build 1.51i and now I can
> confirm median = 0.
>
> This seems to be a case for Wayne...
>
> Best
>
> Herbie
>
> :::::::::::::::::::::::::::::::::::::::::::::
> Am 27.11.16 um 16:35 schrieb Avital Steinberg:
>> Thanks, Herbie - when I run it with Fiji on my Linux machine, which has
>> ImageJ 1.51a13 with Java 1.6.0_24, there is no bug like you said. But
>> when
>> I run it on Fiji with my 10.9.5 mac OsX, I get a value of zero.
>>
>> Can anyone else reproduce the bug?
>> Thanks,
>> Avital
>>
>> On Sun, Nov 27, 2016 at 5:20 PM, Herbie <
[hidden email]> wrote:
>>
>>> Good day Avital
>>>
>>> when running your script entered to a window from "Plugins > New >
>>> JavaScript" I get in the Log-window:
>>>
>>> "The median is: 71"
>>>
>>> ImageJ 1.51h, OSX 10.11.6, 64bit Java 1.6.0_65.
>>>
>>> HTH
>>>
>>> Herbie
>>>
>>> ::::::::::::::::::::::::::::::::::::::::::::::
>>> Am 27.11.16 um 15:57 schrieb Avital Steinberg:
>>>
>>>> importClass(Packages.ij.IJ);
>>>> importClass(Packages.ij.plugin.frame.RoiManager);
>>>> importClass(Packages.ij.ImagePlus);
>>>> importClass(Packages.ij.process.ImageProcessor);
>>>> importClass(Packages.ij.gui.Roi);
>>>> importClass(Packages.ij.gui.OvalRoi);
>>>> importClass(Packages.ij.process.ImageStatistics);
>>>>
>>>> rm = RoiManager.getInstance();
>>>> if (rm==null) rm = new RoiManager();
>>>>
>>>> imp = IJ.createImage("randRamp", "8-bit ramp", 2000, 2048, 1);
>>>> imp.setRoi(new OvalRoi(471,273,177,180));
>>>> imp.show();
>>>> IJ.run("ROI Manager...", "");
>>>> rm.addRoi(imp.getRoi());
>>>> rm.select(0);
>>>> ip = imp.getProcessor();
>>>> selROI = rm.getRoi(0);
>>>> imp.setRoi(selROI, false);
>>>> ip.setRoi(selROI);
>>>> stats = ip.getStatistics();
>>>> median = stats.median; // Adjusted median
>>>> IJ.log("The median is: " + median);
>>>>
>>>
>>> --
>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>
>>
>> --
>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>