[ITK-users] [ITK] location of point in FloodFilledSpatialFunctionConditionalConstIterator

matthew mrrm at web.de
Mon Apr 14 13:02:08 EDT 2014


Hi Matt,

I am not sure, but the following code seems to be suspicious.
To my mind, the origin case is the actual center case.
The origin case is similar to the center case, but the offset needs to be
subrtacted.
I haven't looked at the rest.

I was using it with an ellipsoid inside-outside-function, and the ellipsoids
were all shifted by 0.5 along each dimension.

...
switch ( m_InclusionStrategy )
    {
    // Origin
    case 0:
      {
      // Get the physical location of this index
      this->m_Image->TransformIndexToPhysicalPoint(index, position);

      // Evaluate the function at this point
      return this->GetFunction()->Evaluate(position);
      }
      break;

    // Center
    case 1:
      {
      // The center of the pixel is the index provided in the function
      // call converted to a continuous index with an offset of 0.5
      // along each dimension
      ContinuousIndex< double, TImage::ImageDimension > contIndex;

      for ( unsigned int i = 0; i < TImage::ImageDimension; i++ )
        {
        contIndex[i] = (double)index[i] + 0.5;
        }

      // Get the physical location of this index
      this->m_Image->TransformContinuousIndexToPhysicalPoint(contIndex,
position);

      // Evaluate the function at this point
      return this->GetFunction()->Evaluate(position);
...





--
View this message in context: http://itk-users.7.n7.nabble.com/location-of-point-in-FloodFilledSpatialFunctionConditionalConstIterator-tp33728p33739.html
Sent from the ITK - Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list