diff --git a/Modules/Core/Common/include/itkImageConstIterator.h b/Modules/Core/Common/include/itkImageConstIterator.h index 33776e737fe..4b1d71eb941 100644 --- a/Modules/Core/Common/include/itkImageConstIterator.h +++ b/Modules/Core/Common/include/itkImageConstIterator.h @@ -295,16 +295,24 @@ class ITK_TEMPLATE_EXPORT ImageConstIterator return (m_Buffer + m_Offset) > (it.m_Buffer + it.m_Offset); } - /** Get the index. This provides a read only reference to the index. - * This causes the index to be calculated from pointer arithmetic and is - * therefore an expensive operation. + /** Computes the index. Internally calls ImageBase::ComputeIndex, which may be a relatively expensive operation. * \sa SetIndex */ [[nodiscard]] IndexType - GetIndex() const + ComputeIndex() const { return m_Image->ComputeIndex(m_Offset); } + /** Computes and returns the index. This may be a relatively expensive operation. + * \note It is often preferable for users to call ComputeIndex() directly, to make it more clear that this function + * may be expensive. + * \sa ComputeIndex */ + [[nodiscard]] IndexType + GetIndex() const + { + return this->ComputeIndex(); + } + /** Set the index. No bounds checking is performed. * \sa GetIndex */ virtual void diff --git a/Modules/Core/Common/include/itkImageReverseConstIterator.h b/Modules/Core/Common/include/itkImageReverseConstIterator.h index 7bc832f74b9..3db8f72efa1 100644 --- a/Modules/Core/Common/include/itkImageReverseConstIterator.h +++ b/Modules/Core/Common/include/itkImageReverseConstIterator.h @@ -207,7 +207,7 @@ class ITK_TEMPLATE_EXPORT ImageReverseConstIterator { - const IndexType ind = it.GetIndex(); + const IndexType ind = it.ComputeIndex(); m_Offset = m_Image->ComputeOffset(ind); diff --git a/Modules/Core/Common/include/itkImageScanlineConstIterator.h b/Modules/Core/Common/include/itkImageScanlineConstIterator.h index d5bd870234e..99ed9eed45e 100644 --- a/Modules/Core/Common/include/itkImageScanlineConstIterator.h +++ b/Modules/Core/Common/include/itkImageScanlineConstIterator.h @@ -117,7 +117,7 @@ class ITK_TEMPLATE_EXPORT ImageScanlineConstIterator : public ImageConstIterator { this->ImageConstIterator::operator=(it); - IndexType ind = this->GetIndex(); + IndexType ind = this->ComputeIndex(); m_SpanEndOffset = this->m_Offset + static_cast(this->m_Region.GetSize()[0]) - (ind[0] - this->m_Region.GetIndex()[0]); m_SpanBeginOffset = m_SpanEndOffset - static_cast(this->m_Region.GetSize()[0]); diff --git a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx index db64ba9afca..badfa9cea1b 100644 --- a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx @@ -194,7 +194,7 @@ InvertDisplacementFieldImageFilter::DynamicThreadedGe } update = ItI.Get() + update * this->m_Epsilon; ItI.Set(update); - typename DisplacementFieldType::IndexType index = ItI.GetIndex(); + typename DisplacementFieldType::IndexType index = ItI.ComputeIndex(); if (this->m_EnforceBoundaryCondition) { for (unsigned int d = 0; d < ImageDimension; ++d) diff --git a/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx index c708f37ffab..3b10f014b91 100644 --- a/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx @@ -98,7 +98,7 @@ IterativeInverseDisplacementFieldImageFilter::Generat while (!OutputIt.IsAtEnd()) { // get the output image index - const OutputImageIndexType index = OutputIt.GetIndex(); + const OutputImageIndexType index = OutputIt.ComputeIndex(); OutputImagePointType originalPoint; outputPtr->TransformIndexToPhysicalPoint(index, originalPoint); diff --git a/Modules/Filtering/DisplacementField/include/itkTransformToDisplacementFieldFilter.hxx b/Modules/Filtering/DisplacementField/include/itkTransformToDisplacementFieldFilter.hxx index 392b008eb65..6a19073a47a 100644 --- a/Modules/Filtering/DisplacementField/include/itkTransformToDisplacementFieldFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkTransformToDisplacementFieldFilter.hxx @@ -192,7 +192,7 @@ TransformToDisplacementFieldFilter::Nonlinea while (!outIt.IsAtEndOfLine()) { // Determine the index of the current output pixel - output->TransformIndexToPhysicalPoint(outIt.GetIndex(), outputPoint); + output->TransformIndexToPhysicalPoint(outIt.ComputeIndex(), outputPoint); // Compute corresponding input pixel position transformedPoint = transform->TransformPoint(outputPoint); @@ -235,7 +235,7 @@ TransformToDisplacementFieldFilter::LinearTh // The region may be split along the fast scan-line direction, so // the computation is done for the beginning and end of the largest // possible region to improve consistent numerics. - IndexType index = outIt.GetIndex(); + IndexType index = outIt.ComputeIndex(); index[0] = largestPossibleRegion.GetIndex(0); outputPtr->TransformIndexToPhysicalPoint(index, outputPoint); @@ -247,7 +247,7 @@ TransformToDisplacementFieldFilter::LinearTh inputPoint = transformPtr->TransformPoint(outputPoint); const typename PointType::VectorType endDisplacement = inputPoint - outputPoint; - IndexValueType scanlineIndex = outIt.GetIndex()[0]; + IndexValueType scanlineIndex = outIt.ComputeIndex()[0]; while (!outIt.IsAtEndOfLine()) { diff --git a/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx index a88e5703697..c06fa6a3af0 100644 --- a/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx @@ -294,9 +294,9 @@ CannyEdgeDetectionImageFilter::HysteresisThresholding if (value > m_UpperThreshold) { node = m_NodeStore->Borrow(); - node->m_Value = oit.GetIndex(); + node->m_Value = oit.ComputeIndex(); m_NodeList->PushFront(node); - FollowEdge(oit.GetIndex(), multiplyImageFilterOutput); + FollowEdge(oit.ComputeIndex(), multiplyImageFilterOutput); } ++oit; diff --git a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx index eb8f0bc5c49..0b11c555ab5 100644 --- a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx @@ -282,8 +282,8 @@ HoughTransform2DLinesImageFilter::GetLines() // Create the line. LineType::LinePointListType list; // Insert two points per line. - const double radius = it_input.GetIndex()[0]; - const double teta = ((it_input.GetIndex()[1]) * 2 * Math::pi / this->GetAngleResolution()) - Math::pi; + const double radius = it_input.ComputeIndex()[0]; + const double teta = ((it_input.ComputeIndex()[1]) * 2 * Math::pi / this->GetAngleResolution()) - Math::pi; const double Vx = radius * std::cos(teta); const double Vy = radius * std::sin(teta); const double norm = std::sqrt(Vx * Vx + Vy * Vy); @@ -326,8 +326,8 @@ HoughTransform2DLinesImageFilter::GetLines() { for (double length = 0; length < m_DiscRadius; length += 1) { - index[0] = static_cast(it_input.GetIndex()[0] + length * std::cos(angle)); - index[1] = static_cast(it_input.GetIndex()[1] + length * std::sin(angle)); + index[0] = static_cast(it_input.ComputeIndex()[0] + length * std::cos(angle)); + index[1] = static_cast(it_input.ComputeIndex()[1] + length * std::sin(angle)); if (postProcessImage->GetBufferedRegion().IsInside(index)) { postProcessImage->SetPixel(index, 0); diff --git a/Modules/Filtering/ImageGradient/include/itkDifferenceOfGaussiansGradientImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkDifferenceOfGaussiansGradientImageFilter.hxx index 13004751c4a..021253b3c90 100644 --- a/Modules/Filtering/ImageGradient/include/itkDifferenceOfGaussiansGradientImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkDifferenceOfGaussiansGradientImageFilter.hxx @@ -76,7 +76,7 @@ DifferenceOfGaussiansGradientImageFilter::GenerateData() for (; !outIt.IsAtEnd(); ++outIt) { // determine the index of the output pixel - outputIndex = outIt.GetIndex(); + outputIndex = outIt.ComputeIndex(); // is the current index an acceptable distance from the edges // of the image? diff --git a/Modules/Filtering/ImageGrid/include/itkBinShrinkImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBinShrinkImageFilter.hxx index d1ec0f2f59d..38d7ed63f9b 100644 --- a/Modules/Filtering/ImageGrid/include/itkBinShrinkImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBinShrinkImageFilter.hxx @@ -155,7 +155,7 @@ BinShrinkImageFilter::DynamicThreadedGenerateData( for (ImageScanlineIterator outputIterator(outputPtr, outputRegionForThread); !outputIterator.IsAtEnd(); outputIterator.NextLine()) { - const OutputIndexType outputIndex = outputIterator.GetIndex(); + const OutputIndexType outputIndex = outputIterator.ComputeIndex(); auto offset = offsets.begin(); const InputIndexType startInputIndex = outputIndex * factorSize; diff --git a/Modules/Filtering/ImageGrid/include/itkExpandImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkExpandImageFilter.hxx index 54d7eaec950..60a2c1d602c 100644 --- a/Modules/Filtering/ImageGrid/include/itkExpandImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkExpandImageFilter.hxx @@ -113,7 +113,7 @@ ExpandImageFilter::DynamicThreadedGenerateData( // Walk the output region, and interpolate the input image for (ImageScanlineIterator outIt(outputPtr, outputRegionForThread); !outIt.IsAtEnd(); outIt.NextLine()) { - const typename OutputImageType::IndexType outputIndex = outIt.GetIndex(); + const typename OutputImageType::IndexType outputIndex = outIt.ComputeIndex(); // Determine the input pixel location associated with this output diff --git a/Modules/Filtering/ImageGrid/include/itkFlipImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkFlipImageFilter.hxx index fccd1b2989c..fc5d9781d84 100644 --- a/Modules/Filtering/ImageGrid/include/itkFlipImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkFlipImageFilter.hxx @@ -190,7 +190,7 @@ FlipImageFilter::DynamicThreadedGenerateData(const OutputImageRegionType for (ImageScanlineIterator outputIt(outputPtr, outputRegionForThread); !outputIt.IsAtEnd(); outputIt.NextLine()) { // Determine the index of the output line - const typename TImage::IndexType outputIndex = outputIt.GetIndex(); + const typename TImage::IndexType outputIndex = outputIt.ComputeIndex(); // Determine the input pixel location associated with the start of // the line diff --git a/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx index 1325145a2ec..676944439d7 100644 --- a/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkMirrorPadImageFilter.hxx @@ -756,7 +756,7 @@ MirrorPadImageFilter::DynamicThreadedGenerateData( InputIterator inIt(inputPtr, inputRegion); for (OutputIterator outIt(outputPtr, outputRegion); !outIt.IsAtEnd(); ++outIt, i++, ++inIt) { - OutputImageIndexType currentOutputIndex = outIt.GetIndex(); + OutputImageIndexType currentOutputIndex = outIt.ComputeIndex(); this->ConvertOutputIndexToInputIndex( currentOutputIndex, currentInputIndex, outputRegion, inputRegion, oddRegionArray, decayFactor); diff --git a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx index 3acad8a95e6..569bd410608 100644 --- a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx @@ -466,14 +466,14 @@ ResampleImageFilter::DynamicThreadedGenerateData for (inLineIt.GoToBegin(); !inLineIt.IsAtEnd(); inLineIt.NextLine(), outLineIt.NextLine()) { - SizeValueType lineId = this->IndexToLinearIndex(inLineIt.GetIndex()); + SizeValueType lineId = this->IndexToLinearIndex(inLineIt.ComputeIndex()); LineEncodingType fgLine; LineEncodingType bgLine; @@ -142,7 +142,7 @@ BinaryContourImageFilter::DynamicThreadedGenerateData { // We've hit the start of a run SizeValueType length = 0; - const IndexType thisIndex = inLineIt.GetIndex(); + const IndexType thisIndex = inLineIt.ComputeIndex(); outLineIt.Set(m_BackgroundValue); @@ -164,7 +164,7 @@ BinaryContourImageFilter::DynamicThreadedGenerateData { // We've hit the start of a run SizeValueType length = 0; - const IndexType thisIndex = inLineIt.GetIndex(); + const IndexType thisIndex = inLineIt.ComputeIndex(); outLineIt.Set(PVal); ++length; @@ -198,7 +198,7 @@ BinaryContourImageFilter::ThreadedIntegrateData(const for (ImageScanlineIterator outLineIt(output, outputRegionForThread); !outLineIt.IsAtEnd(); outLineIt.NextLine()) { - const SizeValueType thisIdx = this->IndexToLinearIndex(outLineIt.GetIndex()); + const SizeValueType thisIdx = this->IndexToLinearIndex(outLineIt.ComputeIndex()); if (!m_ForegroundLineMap[thisIdx].empty()) { for (auto I = this->m_LineOffsets.begin(); I != this->m_LineOffsets.end(); ++I) diff --git a/Modules/Filtering/ImageLabel/include/itkLabelContourImageFilter.hxx b/Modules/Filtering/ImageLabel/include/itkLabelContourImageFilter.hxx index e08ef0aeedc..318d2b5f61c 100644 --- a/Modules/Filtering/ImageLabel/include/itkLabelContourImageFilter.hxx +++ b/Modules/Filtering/ImageLabel/include/itkLabelContourImageFilter.hxx @@ -120,14 +120,14 @@ LabelContourImageFilter::DynamicThreadedGenerateData( for (inLineIt.GoToBegin(); !inLineIt.IsAtEnd(); inLineIt.NextLine(), outLineIt.NextLine()) { - const SizeValueType lineId = this->IndexToLinearIndex(inLineIt.GetIndex()); + const SizeValueType lineId = this->IndexToLinearIndex(inLineIt.ComputeIndex()); LineEncodingType thisLine; while (!inLineIt.IsAtEndOfLine()) { const InputPixelType PVal = inLineIt.Get(); SizeValueType length = 0; - const InputIndexType thisIndex = inLineIt.GetIndex(); + const InputIndexType thisIndex = inLineIt.ComputeIndex(); outLineIt.Set(m_BackgroundValue); ++length; ++inLineIt; @@ -162,7 +162,7 @@ LabelContourImageFilter::ThreadedIntegrateData( for (ImageScanlineIterator outLineIt(output, outputRegionForThread); !outLineIt.IsAtEnd(); outLineIt.NextLine()) { - const SizeValueType thisIdx = this->IndexToLinearIndex(outLineIt.GetIndex()); + const SizeValueType thisIdx = this->IndexToLinearIndex(outLineIt.ComputeIndex()); if (!m_LineMap[thisIdx].empty()) { for (auto I = this->m_LineOffsets.begin(); I != this->m_LineOffsets.end(); ++I) diff --git a/Modules/Filtering/ImageSources/include/itkGaussianImageSource.hxx b/Modules/Filtering/ImageSources/include/itkGaussianImageSource.hxx index 71af6e94b5b..d8223f39294 100644 --- a/Modules/Filtering/ImageSources/include/itkGaussianImageSource.hxx +++ b/Modules/Filtering/ImageSources/include/itkGaussianImageSource.hxx @@ -102,7 +102,7 @@ GaussianImageSource::GenerateData() // Walk the output image, evaluating the spatial function at each pixel for (OutputIterator outIt(outputPtr, outputPtr->GetRequestedRegion()); !outIt.IsAtEnd(); ++outIt) { - const typename TOutputImage::IndexType index = outIt.GetIndex(); + const typename TOutputImage::IndexType index = outIt.ComputeIndex(); // The position at which the function is evaluated typename FunctionType::InputType evalPoint; outputPtr->TransformIndexToPhysicalPoint(index, evalPoint); diff --git a/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx index 6746152b8ec..827229e3f7c 100644 --- a/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx @@ -168,7 +168,7 @@ AccumulateImageFilter::GenerateData() } while (!outputIter.IsAtEnd()) { - typename TOutputImage::IndexType OutputIndex = outputIter.GetIndex(); + typename TOutputImage::IndexType OutputIndex = outputIter.ComputeIndex(); for (unsigned int i = 0; i < InputImageDimension; ++i) { if (i != m_AccumulateDimension) diff --git a/Modules/Filtering/LabelMap/include/itkBinaryImageToLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryImageToLabelMapFilter.hxx index 822fee973f0..eb4a063a747 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryImageToLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryImageToLabelMapFilter.hxx @@ -167,7 +167,7 @@ BinaryImageToLabelMapFilter::DynamicThreadedGenerateD { // We've hit the start of a run SizeValueType length = 0; - const IndexType thisIndex = inLineIt.GetIndex(); + const IndexType thisIndex = inLineIt.ComputeIndex(); ++length; ++inLineIt; while (!inLineIt.IsAtEndOfLine() && inLineIt.Get() == this->m_InputForegroundValue) diff --git a/Modules/Filtering/MathematicalMorphology/include/itkValuedRegionalExtremaImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkValuedRegionalExtremaImageFilter.hxx index 12ec76f88c6..698f5583aa7 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkValuedRegionalExtremaImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkValuedRegionalExtremaImageFilter.hxx @@ -131,7 +131,7 @@ ValuedRegionalExtremaImageFilter(V); @@ -156,7 +156,7 @@ ValuedRegionalExtremaImageFilter::GenerateDataForLabels() for (inputIt.GoToBegin(); !inputIt.IsAtEnd(); ++inputIt) { BoundingBoxType & bbox = labelBoundingBoxes[inputIt.Get()]; - bbox.min[0] = std::min(bbox.min[0], inputIt.GetIndex()[0]); - bbox.min[1] = std::min(bbox.min[1], inputIt.GetIndex()[1]); - bbox.max[0] = std::max(bbox.max[0], inputIt.GetIndex()[0]); - bbox.max[1] = std::max(bbox.max[1], inputIt.GetIndex()[1]); + bbox.min[0] = std::min(bbox.min[0], inputIt.ComputeIndex()[0]); + bbox.min[1] = std::min(bbox.min[1], inputIt.ComputeIndex()[1]); + bbox.max[0] = std::max(bbox.max[0], inputIt.ComputeIndex()[0]); + bbox.max[1] = std::max(bbox.max[1], inputIt.ComputeIndex()[1]); } // Build the extended regions from the bounding boxes for (const InputPixelType label : allLabels) diff --git a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx index f85a482ccd0..0cb2cbbfbda 100644 --- a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx @@ -150,7 +150,7 @@ BinomialBlurImageFilter::GenerateData() while (!tempItDir.IsAtEnd()) { // determine the index of the output pixel - index = tempItDir.GetIndex(); + index = tempItDir.ComputeIndex(); if (index[dim] < (startIndex[dim] + static_cast(size[dim]) - 1)) { diff --git a/Modules/Filtering/SpatialFunction/include/itkSpatialFunctionImageEvaluatorFilter.hxx b/Modules/Filtering/SpatialFunction/include/itkSpatialFunctionImageEvaluatorFilter.hxx index 33953dcbe25..119707be95a 100644 --- a/Modules/Filtering/SpatialFunction/include/itkSpatialFunctionImageEvaluatorFilter.hxx +++ b/Modules/Filtering/SpatialFunction/include/itkSpatialFunctionImageEvaluatorFilter.hxx @@ -56,7 +56,7 @@ SpatialFunctionImageEvaluatorFilter // Walk the output image, evaluating the spatial function at each pixel for (; !outIt.IsAtEnd(); ++outIt) { - const typename TOutputImage::IndexType index = outIt.GetIndex(); + const typename TOutputImage::IndexType index = outIt.ComputeIndex(); outputPtr->TransformIndexToPhysicalPoint(index, evalPoint); value = m_PixelFunction->Evaluate(evalPoint); diff --git a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx index 3e40bef6185..d12a97c7c8d 100644 --- a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx +++ b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx @@ -1034,7 +1034,7 @@ RobustSolver::InitializeInterpolationGrid() { // Note: Iterator is guaranteed to be within image, since the // elements with BB outside are skipped before. - this->m_InterpolationGrid->TransformIndexToPhysicalPoint(iter.GetIndex(), pt); + this->m_InterpolationGrid->TransformIndexToPhysicalPoint(iter.ComputeIndex(), pt); for (FEMIndexType d = 0; d < NumberOfDimensions; ++d) { global_point[d] = pt[d]; diff --git a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx index 6df50609e79..65e8f103c21 100644 --- a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx +++ b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx @@ -711,7 +711,7 @@ FEMScatteredDataPointSetToImageFilterTransformIndexToPhysicalPoint(iter.GetIndex(), point); + output->TransformIndexToPhysicalPoint(iter.ComputeIndex(), point); for (unsigned int d = 0; d < ImageDimension; ++d) { globalPoint[d] = point[d]; diff --git a/Modules/Numerics/FEM/include/itkFEMSolver.hxx b/Modules/Numerics/FEM/include/itkFEMSolver.hxx index 55982c313ed..50a3ead573f 100644 --- a/Modules/Numerics/FEM/include/itkFEMSolver.hxx +++ b/Modules/Numerics/FEM/include/itkFEMSolver.hxx @@ -840,7 +840,7 @@ Solver::FillInterpolationGrid() { // Note: Iterator is guaranteed to be within image, since the // elements with BB outside are skipped before. - m_InterpolationGrid->TransformIndexToPhysicalPoint(iter.GetIndex(), pt); + m_InterpolationGrid->TransformIndexToPhysicalPoint(iter.ComputeIndex(), pt); for (unsigned int d = 0; d < NumberOfDimensions; ++d) { global_point[d] = pt[d]; diff --git a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.hxx b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.hxx index 587661386a2..9a2ff2f80cf 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.hxx +++ b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.hxx @@ -180,7 +180,7 @@ ConnectedComponentImageFilter::DynamicThr if (PVal != NumericTraits::ZeroValue(PVal)) { // We've hit the start of a run - const IndexType thisIndex = inLineIt.GetIndex(); + const IndexType thisIndex = inLineIt.ComputeIndex(); // std::cout << thisIndex << std::endl; SizeValueType length = 1; ++inLineIt; diff --git a/Modules/Segmentation/ConnectedComponents/include/itkHardConnectedComponentImageFilter.hxx b/Modules/Segmentation/ConnectedComponents/include/itkHardConnectedComponentImageFilter.hxx index afceb448d80..9e9b4d79184 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkHardConnectedComponentImageFilter.hxx +++ b/Modules/Segmentation/ConnectedComponents/include/itkHardConnectedComponentImageFilter.hxx @@ -69,7 +69,7 @@ HardConnectedComponentImageFilter::GenerateData() { for (unsigned int i = 0; i < ImageDimension; ++i) { - IndexType currentIndex = ot.GetIndex(); + IndexType currentIndex = ot.ComputeIndex(); currentIndex[i] = currentIndex[i] - 1; LabelType label = 0; if (currentIndex[i] >= 0) diff --git a/Modules/Segmentation/LevelSets/include/itkLevelSetNeighborhoodExtractor.hxx b/Modules/Segmentation/LevelSets/include/itkLevelSetNeighborhoodExtractor.hxx index b8ba39439dd..bd6ca3f6cb5 100644 --- a/Modules/Segmentation/LevelSets/include/itkLevelSetNeighborhoodExtractor.hxx +++ b/Modules/Segmentation/LevelSets/include/itkLevelSetNeighborhoodExtractor.hxx @@ -139,7 +139,7 @@ LevelSetNeighborhoodExtractor::GenerateDataFull() this->UpdateProgress(static_cast(i) / static_cast(totalPixels)); } - inputIndex = inIt.GetIndex(); + inputIndex = inIt.ComputeIndex(); this->CalculateDistance(inputIndex); } } diff --git a/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.hxx b/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.hxx index 7f07fc63c77..2b648e864b2 100644 --- a/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.hxx +++ b/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.hxx @@ -146,7 +146,7 @@ SLICImageFilter::BeforeThreadedGenera NumericTraits::AssignToArray(it.Get(), cluster); - const IndexType & idx = it.GetIndex(); + const IndexType & idx = it.ComputeIndex(); typename InputImageType::PointType pt; shrunkImage->TransformIndexToPhysicalPoint(idx, pt); const ContinuousIndexType cidx = @@ -228,7 +228,7 @@ SLICImageFilter::ThreadedUpdateDistan { for (size_t x = 0; x < ln; ++x) { - const IndexType & currentIdx = inputIter.GetIndex(); + const IndexType & currentIdx = inputIter.ComputeIndex(); pt = ContinuousIndexType(currentIdx); const double distance = this->Distance(cluster, inputIter.Get(), pt); @@ -272,7 +272,7 @@ SLICImageFilter::ThreadedUpdateCluste const size_t ln = updateRegionForThread.GetSize(0); for (unsigned int x = 0; x < ln; ++x) { - const IndexType & idx = itOut.GetIndex(); + const IndexType & idx = itOut.ComputeIndex(); const InputPixelType & v = itIn.Get(); const typename OutputImageType::PixelType l = itOut.Get(); @@ -534,7 +534,7 @@ SLICImageFilter::SingleThreadedConnec if (markerIter.Get() == 0) { // try relabeling the connected component to the next label id - this->RelabelConnectedRegion(markerIter.GetIndex(), outputIter.Get(), nextLabel, indexStack); + this->RelabelConnectedRegion(markerIter.ComputeIndex(), outputIter.Get(), nextLabel, indexStack); if (indexStack.size() >= minSuperSize) { diff --git a/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx b/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx index ec7378ea86d..9dff834cc90 100644 --- a/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx @@ -85,7 +85,7 @@ TobogganImageFilter::GenerateData() OutputImagePixelType LabelForRegion = CurrentLabel; bool FoundMinimum = false; - auto CurrentPositionIndex = outIt.GetIndex(); + auto CurrentPositionIndex = outIt.ComputeIndex(); IndexType MinimumNeighborIndex = CurrentPositionIndex; // This is the first pixel we've visited diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx index d776d7e388b..c3b357e4b20 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx @@ -358,13 +358,13 @@ Segmenter::CollectBoundaryInformation(flat_region_table_t & flatReg flr.bounds_min = flrt_it->second.bounds_min; flr.min_label = *(flrt_it->second.min_label_ptr); flr.value = flrt_it->second.value; - flr.offset_list.push_back(face->ComputeOffset(faceIt.GetIndex())); + flr.offset_list.push_back(face->ComputeOffset(faceIt.ComputeIndex())); flats->insert(BoundaryFlatHashValueType(labelIt.Get(), flr)); flr.offset_list.clear(); } else // YES { - flats_it->second.offset_list.push_back(face->ComputeOffset(faceIt.GetIndex())); + flats_it->second.offset_list.push_back(face->ComputeOffset(faceIt.ComputeIndex())); } } @@ -820,8 +820,8 @@ Segmenter::GradientDescent(InputImageTypePointer img, ImageRegionTy { if (it.Get() == NULL_LABEL) { - valueIt.SetLocation(it.GetIndex()); - labelIt.SetLocation(it.GetIndex()); + valueIt.SetLocation(it.ComputeIndex()); + labelIt.SetLocation(it.ComputeIndex()); IdentifierType newLabel = NULL_LABEL; // Follow the path of steep- while (newLabel == NULL_LABEL) // est descent until a label {