View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005357ITKpublic2007-07-17 17:272010-10-21 11:12
ReporterDan Homerick 
Assigned ToLuis Ibanez 
PrioritynormalSeveritymajorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product VersionITK-4-A3 
Target VersionFixed in Version 
Summary0005357: PolygonSpatialObject cannot calculate area with 2D image
DescriptionThe Area() method depends on the Plane() method. Plane() is hard-coded for 3-D and doesn't work in 2-D (since min[2] != max[2], at least with gcc v4.1.2).

Best solution is to rewrite Plane to handle cases other than 3D properly. Quick solution is to add the special case:
if (TDimension == 2) return Coronal;
TagsNo tags attached.
Resolution Date
Sprint
Sprint Statusbacklog
Attached Files

 Relationships

  Notes
(0010276)
Luis Ibanez (manager)
2008-01-23 17:08

will fix code and add test.
(0018120)
mseise (reporter)
2009-10-20 02:23

The same problem occurs when using the IsInside() method for a 2dimensional Polygon (PolygonSpatialObject< 2 >).
That method is used, for example, in SpatialObjectToImageFilter.
(0021527)
pingkunyan (reporter)
2010-07-28 15:55

The bug still exists when calculating the area of a 2D polygon.

In line 32-35 of "itkPolygonSpatialObject.txx", it is hard coded that
  if (Self::ObjectDimension == 2)
    {
    return Axial;
    }

However, when calculating area, in line 156-157
    case Axial:
      X = 0; Y = 2;

For 2D case, this will never get the right Y location and thus give invalid area size.

A quick fix is to take mseise's suggestion:
  if (Self::ObjectDimension == 2)
    {
    return Coronal;
    }
(0022565)
Hans Johnson (developer)
2010-10-21 11:11

To be fixed in ITKv4

 Issue History
Date Modified Username Field Change
2008-01-23 17:07 Luis Ibanez Assigned To Lydia Ng => Luis Ibanez
2008-01-23 17:08 Luis Ibanez Note Added: 0010276
2008-01-23 17:08 Luis Ibanez Status assigned => acknowledged
2008-04-29 11:01 Luis Ibanez Status acknowledged => assigned
2008-04-29 11:01 Luis Ibanez Assigned To Luis Ibanez => Brad Davis
2009-10-20 02:23 mseise Note Added: 0018120
2010-07-28 15:55 pingkunyan Note Added: 0021527
2010-10-21 11:09 Hans Johnson Assigned To Brad Davis => Luis Ibanez
2010-10-21 11:11 Hans Johnson Note Added: 0022565
2010-10-21 11:12 Hans Johnson Sprint Status => backlog
2010-10-21 11:12 Hans Johnson Product Version => ITK-4-A3


Copyright © 2000 - 2018 MantisBT Team