[Insight-developers] FloodFilledSpatialFunctionConditionalIterator

Brad King brad.king@kitware.com
Thu, 24 Jan 2002 09:29:47 -0500 (EST)


Damion,

The last remaining errors on the beta branch are in
FloodFilledSpatialFunctionConditionalIterator.  The problem is in the
following member template of itk::Image:

template<class TCoordRep> 
void TransformIndexToPhysicalPoint(Index<VImageDimension>& index, 
  Point<TCoordRep, VImageDimension>& point)
{
  // If no current transforms exist, build them using the origin and spacing
  if ( !m_IndexToPhysicalTransform ) { this->RebuildTransforms(); }
  
  AffineTransformType::InputPointType inputPoint;

  // Update the input index
  for (unsigned int i = 0 ; i < VImageDimension ; i++)
    { inputPoint[i] = index[i]; }

  // Transform the point
  AffineTransformType::OutputPointType outputPoint =
    m_IndexToPhysicalTransform->TransformPoint(inputPoint) ;
  
  // Update the output point
  point = outputPoint;
}

The problem is that AffineTransformType::OutputPointType and the type of
point requested by the call to this method are incompatible.  We need to
either support Point<double, 3> converting to Point<float, 3> (which will
probably have complications later), or hardcode
TransformIndexToPhysicalPoint to use AffineTransformType::OutputPointType
as the type of point it can be given.  Another option is to loop over the
dimensions and copy the point index-by-index.

Please make whatever fix you think is best.

-Brad