diff --git a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx index 7503e3ec92d..0080acf1383 100644 --- a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx @@ -384,24 +384,21 @@ ResampleImageFilter; - // Define a few indices that will be used to translate from an input pixel - // to an output pixel - OutputPointType outputPoint; // Coordinates of current output pixel - InputPointType inputPoint; // Coordinates of current input pixel - - ContinuousInputIndexType inputIndex; - using OutputType = typename InterpolatorType::OutputType; // Walk the output region for (OutputIterator outIt(outputPtr, outputRegionForThread); !outIt.IsAtEnd(); ++outIt) { // Determine the index of the current output pixel + + OutputPointType outputPoint; // Coordinates of current output pixel outputPtr->TransformIndexToPhysicalPoint(outIt.GetIndex(), outputPoint); // Compute corresponding input pixel position - inputPoint = transformPtr->TransformPoint(outputPoint); - const bool isInsideInput = inputPtr->TransformPhysicalPointToContinuousIndex(inputPoint, inputIndex); + const InputPointType inputPoint = transformPtr->TransformPoint(outputPoint); + + ContinuousInputIndexType inputIndex; + const bool isInsideInput = inputPtr->TransformPhysicalPointToContinuousIndex(inputPoint, inputIndex); OutputType value; // Evaluate input at right position and copy to the output