Login  Register

Re: Is it possible to measure with sub-pixel resolution?

Posted by Michael Schmid on May 08, 2016; 6:10pm
URL: http://imagej.273.s1.nabble.com/Is-it-possible-to-measure-with-sub-pixel-resolution-tp5016356p5016357.html

Hi Emmanuel,

selections (=ROIs, regions of interest) in ImageJ cannot contain something
like half a pixel. A pixel is considered either inside or outside a
selection, nothing in between.

If you need better resolution for measurements, you have to increase the
image size, Image>Adjust>Size, and use interpolation.

Michael
___________________________________________________________________

On Sun, May 8, 2016 18:15, Emmanuel Levy wrote:

> Dear list members,
>
> I was wondering if there's a specific option/way to do measurements in an
> image with sub-pixel resolution?
>
> I paste below macro code to illustrate what I mean. The following creates
> a
> 10x10 pixels image, half of which is back and the other half white. If I
> draw a triangle that is half in the black and half in the white area, with
> a total area of 1pixel, I get a mean value of 255, but I would have
> expected 127.5
>
> newImage("Untitled", "8-bit black", 10, 10, 1);
>
> makeRectangle(5, 0, 5, 10);
>
> setBackgroundColor(255, 255, 255);
>
> run("Clear", "slice");
>
> makePolygon(4,5,6,5,5,6);
>
> run("Measure");
>
>
> Does anyone know if it's possible to get 127.5?
>
> Thanks for your help,
>
> Best wishes,
>
> Emmanuel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html