View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011699ITKITKpublic2011-01-14 11:562011-01-18 17:17
ReporterAndras Lasso 2 
Assigned ToBill Lorensen 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformWin7-64, Linux-64OSOS Version
Product VersionITK-3-18 
Target VersionFixed in Version 
Summary0011699: ImageMaskSpatialObject IsInside and ValueAt methods give inconsistent results
DescriptionImageMaskSpatialObject< TDimension >::IsInside (which determines if the point is inside or not the masked region) uses index[i] = static_cast<int>( p[i] ) to convert from continuous index to integer index.

This is inconsistent with ImageSpatialObject< TDimension, PixelType >::ValueAt (which returns the pixel value at a specified position) that uses value = static_cast<double>(DefaultConvertPixelTraits<InterpolatorOutputType>:: GetScalarValue(m_Interpolator->EvaluateAtContinuousIndex(index))) to do the conversion.

The effect is that when using a mask for registration many points are incorrectly rejected at the mask boundary during the sampling step (in ImageToImageMetric<TFixedImage,TMovingImage>::SampleFixedImageRegion). When the mask is thin (such as when the ROI is a single slice) this often leads to registration failure (e.g., "Joint PDF summed to zero").

Proposed fix: Change ImageMaskSpatialObject::IsInside to convert continuous indices to integer indices the same way (using the interpolator) as it is done in ImageSpatialObject::ValueAt. See the attached patch that implements this fix. The patch fixed the problem that we encountered during single-slice registration (was tested on Linux and Windows).
Steps To ReproduceCreate an ImageMaskSpatialObject, call IsInside and ValueAt functions near the masked/non-masked region boundary. Many times IsInside returns 1 while ValueAt returns 0.
TagsNo tags attached.
Resolution Date
Sprint
Sprint Statusbacklog
Attached Filespatch file icon itkImageMaskSpatialObject-IsInsideFix.patch [^] (602 bytes) 2011-01-14 11:56 [Show Content]
cxx file icon itkImageMaskSpatialObjectTest2.cxx [^] (8,841 bytes) 2011-01-18 17:17

 Relationships

  Notes
There are no notes attached to this issue.

 Issue History
Date Modified Username Field Change
2011-01-14 11:56 Andras Lasso 2 New Issue
2011-01-14 11:56 Andras Lasso 2 File Added: itkImageMaskSpatialObject-IsInsideFix.patch
2011-01-14 12:57 Bill Lorensen Assigned To => Bill Lorensen
2011-01-14 12:57 Bill Lorensen Status new => assigned
2011-01-18 17:17 Andras Lasso 2 File Added: itkImageMaskSpatialObjectTest2.cxx


Copyright © 2000 - 2018 MantisBT Team