Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "itkComposeDisplacementFieldsImageFilter.h"
#include "itkImageDuplicator.h"
#include "itkImageRegionIterator.h"
#include "itkImageRegionIteratorWithIndex.h"
#include <mutex>
#include "itkProgressTransformer.h"

Expand Down Expand Up @@ -181,7 +182,7 @@ InvertDisplacementFieldImageFilter<TInputImage, TOutputImage>::DynamicThreadedGe

if (this->m_DoThreadedEstimateInverse)
{
ImageRegionIterator<DisplacementFieldType> ItI(this->GetOutput(), region);
ImageRegionIteratorWithIndex<DisplacementFieldType> ItI(this->GetOutput(), region);

for (ItI.GoToBegin(), ItE.GoToBegin(), ItS.GoToBegin(); !ItI.IsAtEnd(); ++ItI, ++ItE, ++ItS)
{
Expand All @@ -194,7 +195,7 @@ InvertDisplacementFieldImageFilter<TInputImage, TOutputImage>::DynamicThreadedGe
}
update = ItI.Get() + update * this->m_Epsilon;
ItI.Set(update);
typename DisplacementFieldType::IndexType index = ItI.ComputeIndex();
typename DisplacementFieldType::IndexType index = ItI.GetIndex();
if (this->m_EnforceBoundaryCondition)
{
for (unsigned int d = 0; d < ImageDimension; ++d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ class ITK_TEMPLATE_EXPORT IterativeInverseDisplacementFieldImageFilter

using InputConstIterator = ImageRegionConstIterator<InputImageType>;
using InputIterator = ImageRegionIterator<InputImageType>;
using OutputIterator = ImageRegionIterator<OutputImageType>;

#ifndef ITK_FUTURE_LEGACY_REMOVE
using OutputIterator ITK_FUTURE_DEPRECATED("Please use `itk::ImageRegionIterator<TImage>` directly!") =
ImageRegionIterator<OutputImageType>;
#endif
using VectorWarperType = WarpVectorImageFilter<TOutputImage, TInputImage, TOutputImage>;

using FieldInterpolatorType = VectorLinearInterpolateImageFunction<TInputImage, double>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef itkIterativeInverseDisplacementFieldImageFilter_hxx
#define itkIterativeInverseDisplacementFieldImageFilter_hxx

#include "itkImageRegionIteratorWithIndex.h"
#include "itkProgressReporter.h"
#include "itkMath.h"

Expand Down Expand Up @@ -87,9 +88,9 @@ IterativeInverseDisplacementFieldImageFilter<TInputImage, TOutputImage>::Generat
// calculate the inverted field
const double spacing = inputPtr->GetSpacing()[0];

ProgressReporter progress(this, 0, inputPtr->GetLargestPossibleRegion().GetNumberOfPixels());
OutputIterator OutputIt(outputPtr, outputPtr->GetRequestedRegion());
const FieldInterpolatorPointer inputFieldInterpolator = FieldInterpolatorType::New();
ProgressReporter progress(this, 0, inputPtr->GetLargestPossibleRegion().GetNumberOfPixels());
ImageRegionIteratorWithIndex<OutputImageType> OutputIt(outputPtr, outputPtr->GetRequestedRegion());
const FieldInterpolatorPointer inputFieldInterpolator = FieldInterpolatorType::New();
inputFieldInterpolator->SetInputImage(inputPtr);

double smallestError = 0;
Expand All @@ -98,7 +99,7 @@ IterativeInverseDisplacementFieldImageFilter<TInputImage, TOutputImage>::Generat
while (!OutputIt.IsAtEnd())
{
// get the output image index
const OutputImageIndexType index = OutputIt.ComputeIndex();
const OutputImageIndexType index = OutputIt.GetIndex();
OutputImagePointType originalPoint;
outputPtr->TransformIndexToPhysicalPoint(index, originalPoint);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <cmath>
#include "itkProgressReporter.h"
#include "itkImageRegionIterator.h"
#include "itkImageRegionIteratorWithIndex.h"

namespace itk
{
Expand Down Expand Up @@ -62,7 +62,7 @@ DifferenceOfGaussiansGradientImageFilter<TInputImage, TDataType>::GenerateData()
ProgressReporter progress(this, 0, outputPtr->GetRequestedRegion().GetNumberOfPixels());

// Create an iterator that will walk the output region
using OutputIterator = ImageRegionIterator<TOutputImage>;
using OutputIterator = ImageRegionIteratorWithIndex<TOutputImage>;

OutputIterator outIt(outputPtr, outputPtr->GetRequestedRegion());

Expand All @@ -76,7 +76,7 @@ DifferenceOfGaussiansGradientImageFilter<TInputImage, TDataType>::GenerateData()
for (; !outIt.IsAtEnd(); ++outIt)
{
// determine the index of the output pixel
outputIndex = outIt.ComputeIndex();
outputIndex = outIt.GetIndex();

// is the current index an acceptable distance from the edges
// of the image?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ MirrorPadImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenerateData(

// Define/declare iterators that will walk the input and output regions
// for this thread.
using OutputIterator = ImageRegionIterator<TOutputImage>;
using OutputIterator = ImageRegionIteratorWithIndex<TOutputImage>;
using InputIterator = ImageRegionConstIterator<TInputImage>;

TotalProgressReporter progress(this, this->GetOutput()->GetRequestedRegion().GetNumberOfPixels());
Expand Down Expand Up @@ -756,7 +756,7 @@ MirrorPadImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenerateData(
InputIterator inIt(inputPtr, inputRegion);
for (OutputIterator outIt(outputPtr, outputRegion); !outIt.IsAtEnd(); ++outIt, i++, ++inIt)
{
OutputImageIndexType currentOutputIndex = outIt.ComputeIndex();
OutputImageIndexType currentOutputIndex = outIt.GetIndex();

this->ConvertOutputIndexToInputIndex(
currentOutputIndex, currentInputIndex, outputRegion, inputRegion, oddRegionArray, decayFactor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define itkGaussianImageSource_hxx

#include "itkGaussianSpatialFunction.h"
#include "itkImageRegionIterator.h"
#include "itkImageRegionIteratorWithIndex.h"
#include "itkProgressReporter.h"
#include "itkObjectFactory.h"

Expand Down Expand Up @@ -96,13 +96,13 @@ GaussianImageSource<TOutputImage>::GenerateData()
gaussian->SetNormalized(m_Normalized);

// Create an iterator that will walk the output region
using OutputIterator = ImageRegionIterator<TOutputImage>;
using OutputIterator = ImageRegionIteratorWithIndex<TOutputImage>;

ProgressReporter progress(this, 0, outputPtr->GetRequestedRegion().GetNumberOfPixels());
// 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.ComputeIndex();
const typename TOutputImage::IndexType index = outIt.GetIndex();
// The position at which the function is evaluated
typename FunctionType::InputType evalPoint;
outputPtr->TransformIndexToPhysicalPoint(index, evalPoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#ifndef itkAccumulateImageFilter_hxx
#define itkAccumulateImageFilter_hxx

#include "itkImageRegionIterator.h"
#include "itkImageRegionConstIterator.h"
#include "itkImageRegionIteratorWithIndex.h"

namespace itk
{
Expand Down Expand Up @@ -149,7 +150,7 @@ AccumulateImageFilter<TInputImage, TOutputImage>::GenerateData()

// Accumulate over the Nth dimension ( = m_AccumulateDimension)
// and divide by the size of the accumulated dimension.
using outputIterType = ImageRegionIterator<TOutputImage>;
using outputIterType = ImageRegionIteratorWithIndex<TOutputImage>;
outputIterType outputIter(outputImage, outputImage->GetBufferedRegion());
using inputIterType = ImageRegionConstIterator<TInputImage>;

Expand All @@ -168,7 +169,7 @@ AccumulateImageFilter<TInputImage, TOutputImage>::GenerateData()
}
while (!outputIter.IsAtEnd())
{
typename TOutputImage::IndexType OutputIndex = outputIter.ComputeIndex();
typename TOutputImage::IndexType OutputIndex = outputIter.GetIndex();
for (unsigned int i = 0; i < InputImageDimension; ++i)
{
if (i != m_AccumulateDimension)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "itkProgressReporter.h"
#include "itkImageRegion.h"
#include "itkImageRegionConstIterator.h"
#include "itkImageRegionIteratorWithIndex.h"
#include "itkImageRegionReverseIterator.h"
#include <algorithm> // For min and max.

Expand Down Expand Up @@ -114,7 +115,7 @@ BinomialBlurImageFilter<TInputImage, TOutputImage>::GenerateData()
typename TInputImage::IndexType startIndex = inputPtr->GetRequestedRegion().GetIndex();

// Iterator Typedefs for this routine
using TempIterator = ImageRegionIterator<TTempImage>;
using TempIterator = ImageRegionIteratorWithIndex<TTempImage>;
using TempReverseIterator = ImageRegionReverseIterator<TTempImage>;
using InputIterator = ImageRegionConstIterator<TInputImage>;
using OutputIterator = ImageRegionIterator<TOutputImage>;
Expand Down Expand Up @@ -150,7 +151,7 @@ BinomialBlurImageFilter<TInputImage, TOutputImage>::GenerateData()
while (!tempItDir.IsAtEnd())
{
// determine the index of the output pixel
index = tempItDir.ComputeIndex();
index = tempItDir.GetIndex();

if (index[dim] < (startIndex[dim] + static_cast<typename TTempImage::OffsetValueType>(size[dim]) - 1))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define itkSpatialFunctionImageEvaluatorFilter_hxx

#include "itkImageRegion.h"
#include "itkImageRegionIteratorWithIndex.h"

namespace itk
{
Expand All @@ -41,7 +42,7 @@ SpatialFunctionImageEvaluatorFilter<TSpatialFunction, TInputImage, TOutputImage>
outputPtr->Allocate();

// Create an iterator that will walk the output region
using OutputIterator = ImageRegionIterator<TOutputImage>;
using OutputIterator = ImageRegionIteratorWithIndex<TOutputImage>;

OutputIterator outIt(outputPtr, outputPtr->GetRequestedRegion());

Expand All @@ -56,7 +57,7 @@ SpatialFunctionImageEvaluatorFilter<TSpatialFunction, TInputImage, TOutputImage>
// Walk the output image, evaluating the spatial function at each pixel
for (; !outIt.IsAtEnd(); ++outIt)
{
const typename TOutputImage::IndexType index = outIt.ComputeIndex();
const typename TOutputImage::IndexType index = outIt.GetIndex();
outputPtr->TransformIndexToPhysicalPoint(index, evalPoint);
value = m_PixelFunction->Evaluate(evalPoint);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GenerateData()
LabelPixelType label;

// Iterator over the label image.
ImageRegionConstIterator<TLabelImage> labelIt(this->GetInput(), this->GetInput()->GetBufferedRegion());
ImageRegionConstIteratorWithIndex<TLabelImage> labelIt(this->GetInput(), this->GetInput()->GetBufferedRegion());

using ImageIteratorWithIndexType = ImageRegionConstIteratorWithIndex<TLabelImage>;

Expand Down Expand Up @@ -212,7 +212,7 @@ LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GenerateData()
// BOUNDING BOX
// The bounding box is defined in (min, max) pairs, such as
// (xmin,xmax,ymin,ymax,zmin,zmax).
typename ImageIteratorWithIndexType::IndexType index = labelIt.ComputeIndex();
typename ImageIteratorWithIndexType::IndexType index = labelIt.GetIndex();
for (unsigned int i = 0; i < (2 * ImageDimension); i += 2)
{
// Update min
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ ScalarChanAndVeseLevelSetFunction<TInputImage, TFeatureImage, TSharedData>::Comp
this->m_SharedData->m_LevelSetDataPointerVector[fId]->m_WeightedSumOfPixelValuesOutsideLevelSet = 0;
this->m_SharedData->m_LevelSetDataPointerVector[fId]->m_BackgroundConstantValues = 0;

ConstFeatureIteratorType fIt(this->m_FeatureImage, this->m_FeatureImage->GetLargestPossibleRegion());
ImageRegionConstIteratorWithIndex<FeatureImageType> fIt(this->m_FeatureImage,
this->m_FeatureImage->GetLargestPossibleRegion());

FeaturePixelType featureVal;
FeatureIndexType globalIndex;
Expand All @@ -113,7 +114,7 @@ ScalarChanAndVeseLevelSetFunction<TInputImage, TFeatureImage, TSharedData>::Comp
while (!fIt.IsAtEnd())
{
featureVal = fIt.Get();
inputIndex = fIt.ComputeIndex();
inputIndex = fIt.GetIndex();
InputPixelType prod = 1.;

globalIndex = this->m_SharedData->m_LevelSetDataPointerVector[fId]->GetFeatureIndex(inputIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
*=========================================================================*/
#ifndef itkHardConnectedComponentImageFilter_hxx
#define itkHardConnectedComponentImageFilter_hxx
#include "itkImageRegionIterator.h"
#include "itkImageRegionConstIterator.h"
#include "itkImageRegionIteratorWithIndex.h"
#include "itkNumericTraits.h"
#include "itkProgressReporter.h"
#include "itkMath.h"
Expand All @@ -44,8 +45,8 @@ HardConnectedComponentImageFilter<TInputImage, TOutputImage>::GenerateData()
output->SetRegions(region);
output->Allocate();

ImageRegionConstIterator<TInputImage> it(input, input->GetRequestedRegion());
ImageRegionIterator<TOutputImage> ot(output, output->GetRequestedRegion());
ImageRegionConstIterator<TInputImage> it(input, input->GetRequestedRegion());
ImageRegionIteratorWithIndex<TOutputImage> ot(output, output->GetRequestedRegion());

ProgressReporter progress(this, 0, output->GetRequestedRegion().GetNumberOfPixels());
it.GoToBegin();
Expand All @@ -69,7 +70,7 @@ HardConnectedComponentImageFilter<TInputImage, TOutputImage>::GenerateData()
{
for (unsigned int i = 0; i < ImageDimension; ++i)
{
IndexType currentIndex = ot.ComputeIndex();
IndexType currentIndex = ot.GetIndex();
currentIndex[i] = currentIndex[i] - 1;
LabelType label = 0;
if (currentIndex[i] >= 0)
Expand Down
Loading