Home Image-Pro General Discussions

Inconsistent area measurements

I use the same circular annotation as a template.  I apply and position the Annotation to an image, Add it back to the Feature Manager, and then convert it to a Measurements feature.  I then apply it to the image as a Measurements feature to get an area value.  I have noticed that when I use the same template and place it in different locations within the same image, that I get different area results beginning at the 4th decimal place.  Why isn't the value reproducible?  Image Pro Premiere v 9.1.4.build 5638 64-bit  Thanks again!

Best Answer

  • Answer ✓
    Given the information you supply, I think I can see what is going on for you.  There are two issues: 1) the circles you are drawing are not aligned to pixel centers and 2) they have a very large number of vertices when converted to a polygon.

    The second issue first; it is relevant to the minor variations in the value of the Area Polygonal.  A 6mm diameter circle with a spatial calibration of 1175.7432 pixels/mm results in a circle with a radius of over 3500 pixels.  The current Area Polygon algorithm measures the area of elliptical objects by computing a bounding polygon and then using the classic formula for area of a polygon using double precision floating point arithmetic.  Since the polygon for a circle of this size has over 25,000 vertices and the polygon area formula involves summing the difference of two values for each vertex, there is some loss of precision.  In my tests, the Area Polygon should be accurate to the 9th or 10th significant digit as the measurement circle is moved.

    The first issue has to do with the fact that there is no way to create an Annotation circle that is pixel aligned, so your template annotation with be centered at different sub-pixel locations as you move it around.  When you move this Annotation into a measurement (via the Features Manager) the "Pixel Aligned" check box will have no effect on the measurement placement (that option only affects placement during creation or editing).  Thus you will get different counts of pixels under and interior to the boundary and thus differing pixel Area measurements.

    I don't understand why you cannot just use a circular ROI as your template.  ROI creation is always pixel aligned, so any ROI that you create and place on the Features Manager will be pixel aligned if you convert it to a measurement.

Answers

  • That can happen for "Area" measurement as it counts the number of pixels (pixel centers) under the outline, which is defined by floating point coordinates. Slight shift of the circle by a fraction of a pixel may give slightly different count.
    Use "Area Polygonal", in that case the area is calculated from the outline and doesn't change the value when its moved.

    Yuri
  • Yuri- I gave that a try.  The values still change with position of circle, Also, the values were very different from the results obtained using Region:Area. Any other ideas?  Thanks for your help!
  • I cannot reproduce the behavior you describe in my tests.  That is, Area Polygonal is unchanged when the measurement circle is moved.  If the template circle is created on an image shown at 100% zoom and then is placed and moved as a measurement on an image at 100% zoom, then the Area (count of pixels under and interior to the circle boundary) is also unchanged as the measurement circle is moved to different locations.  As Yuri noted, the pixel Area does vary slightly as the measurement circle is moved on a zoomed-in image (zoom > 100%), since in this case the circle can be placed with sub-pixel resolution.

    So more information might help:

    1.  What are the sizes of the source (template) and destination (measurement) images?  What was the zoom when the template was created?  What is the zoom on the measurement image where position is affecting your results.
    2.  Is your Annotation template circle created with the circle tool or the ellipse tool (holding down the shift key to make the ellipse circular)?
    3.  What is the location and size of the Annotation circle?  If created by the circle tool we need center and radius.  If created by the ellipse tool we need center and dx:dy.  Just select the object and look on the status bar to get these numbers.
    4.  Are you using a spatial calibration?  If so, what are the Units/Pixel?
    5.  Please give the results of the following measurements for two different measurement placements that give you differing results:
      Area (pixel area)
      Area Polygonal (area computed using the outline)
      Centroid X
      Centroid Y

  • Also, if you want the pixel Area to be invariant as you move measurement objects around, you can check the "Pixel Aligned" box in the "Outlines" section of the Measurement Options panel.  This will prevent you from placing a measurement object at a sub-pixel location.
  • I will work on that and get back to you; Thanks!
  • CraigW-

    I am still working on the measures you requested, but can give you answers to questions in the meantime:

    1. The image sizes are on the order of 11000 x 11000 pixels; they are montaged composites, and the software automatically adjusts the scale to fit them on the screen.  I do not change the scale once opened, but they are variable because they are montages.  The template is a 6mm circle generated using the circle tool and adjusted to-size until the diameter is as close as I can get it to the desired value. It is saved to the Feature Manager as an Annotation so it can be reused and positioned in several images.

    2. I initially use the Annotations circle to locate a feature of interest in each montage, and then convert to an ROI in order to crop the image to contain only that feature.  I later go back and apply that same Annotation circle and convert it to a Measurements feature so that I have a total area value.  All subsequent feature measures (of other features) are expressed as a % of total, so I only need to measure the circle area once. The same circle is used consistently in all of the images, so the area should be unchanging throughout the assay. What a surprise when it varies!

    3. I am using spatial calibration.  The value is 1175.7432 pixels/mm

    4. I have tried tests using Area (calibrated) and Area, Polygonal; with and without Pixel align being ON.  Both give variable results when I move the Annotations circle, convert it to a Measurements feature, and re-apply it to the image.

    I hope that this sheds more light on the problem.  I will try to get to those tests.  Let me know if this new info changes anything.  Thanks for taking the time to help out!  I really do appreciate it!


Sign In or Register to comment.