Measure Bug: Measure::Median does not work on a line ROI

I cannot get ImageJ FIJI to give me the median value of a line ROI (width=1 in this case)
I can get measure to give me the median value of a rectangle or any other type of ROI I have tried.
Here is a Record Macro of what I did:

imp = IJ.openImage("http://imagej.nih.gov/ij/images/blobs.gif");
//IJ.setTool("rectangle");
IJ.run("Set Measurements...", "area mean modal median redirect=None decimal=1");
imp.setRoi(49,63,128,1);    // rectangular roi 1 pixel width
IJ.run(imp, "Measure", "");// In Results::Area 128 Mean 84.9 Mode 48 Angle 0 Median 48
//IJ.setTool("line");
imp.setRoi(new Line(49,63,176,63));  // note line width set to 1
IJ.run(imp, "Measure", "");

In Results:: Area 128 Mean 84.9 Mode 48.0 Median 0 Length 127.0

1 Like

One can get the median with a script,but it seems ridiculous to have to write a script to get the median value of an ROI in an image analysis program.
I am using Fiji ImageJ 2.0.0-rc-65/1.52a58; java 1.8.0_66

from an ImagePlus imp and an line Roi roi

imp.setRoi(roi)
median=ArrayUtil(Tools.toFloat(ProfilePlot(imp).getProfile())).medianSort()

Iā€™d consider this a bug. For line ROIs, the measurements seem to be hard-coded here:

@Wayne, any comments?

This bug is fixed in the latest ImageJ daily build (1.52e13). Source code changes can be viewed at

2 Likes