diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx index 355a5b73ca1..f9b0ea23b97 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx @@ -482,8 +482,7 @@ PatchBasedDenoisingImageFilter::InitializePatchWeight physicalWeightsImage->Allocate(); physicalWeightsImage->FillBuffer(1.0); - typename WeightsImageType::IndexType centerIndex; - centerIndex.Fill(patchRadius); + auto centerIndex = WeightsImageType::IndexType::Filled(patchRadius); unsigned int pos = 0; for (ImageRegionIteratorWithIndex pwIt(physicalWeightsImage, physicalRegion); !pwIt.IsAtEnd(); diff --git a/Modules/Filtering/LabelMap/include/itkAutoCropLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkAutoCropLabelMapFilter.hxx index 84b0018c90d..8d2608e1f5b 100644 --- a/Modules/Filtering/LabelMap/include/itkAutoCropLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkAutoCropLabelMapFilter.hxx @@ -53,10 +53,8 @@ AutoCropLabelMapFilter::GenerateOutputInformation() } // find the bounding box of the objects - IndexType minIdx; - minIdx.Fill(NumericTraits::max()); - IndexType maxIdx; - maxIdx.Fill(NumericTraits::NonpositiveMin()); + auto minIdx = IndexType::Filled(NumericTraits::max()); + auto maxIdx = IndexType::Filled(NumericTraits::NonpositiveMin()); const InputImageType * inputImage = this->GetInput(); diff --git a/Modules/Filtering/LabelMap/include/itkLabelMapMaskImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkLabelMapMaskImageFilter.hxx index 9f2b5780da1..6d0b4107459 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelMapMaskImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelMapMaskImageFilter.hxx @@ -104,10 +104,8 @@ LabelMapMaskImageFilter::GenerateOutputInformation() else { // Compute the bounding box of all the objects which don't have that label - IndexType mins; - mins.Fill(NumericTraits::max()); - IndexType maxs; - maxs.Fill(NumericTraits::NonpositiveMin()); + auto mins = IndexType::Filled(NumericTraits::max()); + auto maxs = IndexType::Filled(NumericTraits::NonpositiveMin()); for (typename InputImageType::ConstIterator loit(this->GetInput()); !loit.IsAtEnd(); ++loit) { if (loit.GetLabel() != m_Label) @@ -168,10 +166,8 @@ LabelMapMaskImageFilter::GenerateOutputInformation() // Just find the bounding box of the object with that label const LabelObjectType * labelObject = input->GetLabelObject(m_Label); - IndexType mins; - mins.Fill(NumericTraits::max()); - IndexType maxs; - maxs.Fill(NumericTraits::NonpositiveMin()); + auto mins = IndexType::Filled(NumericTraits::max()); + auto maxs = IndexType::Filled(NumericTraits::NonpositiveMin()); // Iterate over all the lines typename LabelObjectType::ConstLineIterator lit(labelObject); while (!lit.IsAtEnd()) diff --git a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx index cf263859865..c05bbc22151 100644 --- a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx @@ -96,13 +96,11 @@ ShapeLabelMapFilter::ThreadedProcessLabelObject(LabelObject // Init the vars SizeValueType nbOfPixels = 0; ContinuousIndex centroid{}; - IndexType mins; - mins.Fill(NumericTraits::max()); - IndexType maxs; - maxs.Fill(NumericTraits::NonpositiveMin()); - SizeValueType nbOfPixelsOnBorder = 0; - double perimeterOnBorder = 0; - MatrixType centralMoments{}; + auto mins = IndexType::Filled(NumericTraits::max()); + auto maxs = IndexType::Filled(NumericTraits::NonpositiveMin()); + SizeValueType nbOfPixelsOnBorder = 0; + double perimeterOnBorder = 0; + MatrixType centralMoments{}; using LengthType = typename LabelObjectType::LengthType; diff --git a/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx index 5744bc091c3..92d2d5581cf 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx @@ -111,16 +111,14 @@ DiscreteGaussianDerivativeImageFunction::RecomputeGaussian kernelImage->AllocateInitialized(); // Initially the kernel image will be an impulse at the center - typename KernelImageType::IndexType centerIndex; - centerIndex.Fill(2 * m_OperatorArray[0].GetRadius()[0]); // include also - // boundaries + auto centerIndex = KernelImageType::IndexType::Filled(2 * m_OperatorArray[0].GetRadius()[0]); // include also + // boundaries kernelImage->SetPixel(centerIndex, itk::NumericTraits::OneValue()); // Create an image region to be used later that does not include boundaries RegionType kernelRegion; size.Fill(2 * m_OperatorArray[0].GetRadius()[0] + 1); - typename RegionType::IndexType origin; - origin.Fill(m_OperatorArray[0].GetRadius()[0]); + auto origin = RegionType::IndexType::Filled(m_OperatorArray[0].GetRadius()[0]); kernelRegion.SetSize(size); kernelRegion.SetIndex(origin); diff --git a/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx index 844a285c57d..9ffaf118760 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx @@ -124,14 +124,12 @@ DiscreteGradientMagnitudeGaussianImageFunction::RecomputeG kernelImage->AllocateInitialized(); // Initially the kernel image will be an impulse at the center - typename KernelImageType::IndexType centerIndex; - centerIndex.Fill(2 * maxRadius); // include also boundaries + auto centerIndex = KernelImageType::IndexType::Filled(2 * maxRadius); // include also boundaries // Create an image region to be used later that does not include boundaries RegionType kernelRegion; size.Fill(2 * maxRadius + 1); - typename RegionType::IndexType origin; - origin.Fill(maxRadius); + auto origin = RegionType::IndexType::Filled(maxRadius); kernelRegion.SetSize(size); kernelRegion.SetIndex(origin); diff --git a/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx index d28db342c9d..9e1bf650bef 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx @@ -117,14 +117,12 @@ DiscreteHessianGaussianImageFunction::RecomputeGaussianKer kernelImage->AllocateInitialized(); // Initially the kernel image will be an impulse at the center - typename KernelImageType::IndexType centerIndex; - centerIndex.Fill(2 * maxRadius); // include also boundaries + auto centerIndex = KernelImageType::IndexType::Filled(2 * maxRadius); // include also boundaries // Create an image region to be used later that does not include boundaries RegionType kernelRegion; size.Fill(2 * maxRadius + 1); - typename RegionType::IndexType origin; - origin.Fill(maxRadius); + auto origin = RegionType::IndexType::Filled(maxRadius); kernelRegion.SetSize(size); kernelRegion.SetIndex(origin);