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
3 changes: 1 addition & 2 deletions Modules/Core/Common/include/itkDerivativeOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ namespace itk
using DerivativeOperatorType = itk::DerivativeOperator<float, 2>;
DerivativeOperatorType derivativeOperator;
derivativeOperator.SetDirection(0); // X dimension
itk::Size<2> radius;
radius.Fill(1); // A radius of 1 in both dimensions is a 3x3 operator
auto radius = itk::Size<2>::Filled(1); // A radius of 1 in both dimensions is a 3x3 operator
derivativeOperator.CreateToRadius(radius);
\endcode
* and creates a kernel that looks like:
Expand Down
4 changes: 1 addition & 3 deletions Modules/Core/Common/include/itkLaplacianOperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ LaplacianOperator<TPixel, VDimension, TAllocator>::GenerateCoefficients() -> Coe

// Here we set the radius to 1's, here the
// operator is 3x3 for 2D, 3x3x3 for 3D.
SizeType r;

r.Fill(1);
auto r = SizeType::Filled(1);
this->SetRadius(r);

// Create a vector of the correct size to hold the coefficients.
Expand Down
3 changes: 1 addition & 2 deletions Modules/Core/Common/include/itkSobelOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ namespace itk
* 1) Set the direction by calling \code SetDirection \endcode
* 2) call
\code
itk::Size<2> radius;
radius.Fill(1);
auto radius = itk::Size<2>::Filled(1);
sobelOperator.CreateToRadius(radius);
\endcode
* 3) You may optionally scale the coefficients of this operator using the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ CovarianceImageFunction<TInputImage, TCoordRep>::EvaluateAtIndex(const IndexType
mean.fill(PixelComponentRealType{});

// Create an N-d neighborhood kernel, using a zeroflux boundary condition
typename InputImageType::SizeType kernelSize;
kernelSize.Fill(m_NeighborhoodRadius);
auto kernelSize = InputImageType::SizeType::Filled(m_NeighborhoodRadius);

ConstNeighborhoodIterator<InputImageType> it(
kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ ScatterMatrixImageFunction<TInputImage, TCoordRep>::EvaluateAtIndex(const IndexT
}

// Create an N-d neighborhood kernel, using a zeroflux boundary condition
typename InputImageType::SizeType kernelSize;
kernelSize.Fill(m_NeighborhoodRadius);
auto kernelSize = InputImageType::SizeType::Filled(m_NeighborhoodRadius);

ConstNeighborhoodIterator<InputImageType> it(
kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ VarianceImageFunction<TInputImage, TCoordRep>::EvaluateAtIndex(const IndexType &
}

// Create an N-d neighborhood kernel, using a zeroflux boundary condition
typename InputImageType::SizeType kernelSize;
kernelSize.Fill(m_NeighborhoodRadius);
auto kernelSize = InputImageType::SizeType::Filled(m_NeighborhoodRadius);

ConstNeighborhoodIterator<InputImageType> it(
kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ VectorMeanImageFunction<TInputImage, TCoordRep>::EvaluateAtIndex(const IndexType
}

// Create an N-d neighborhood kernel, using a zeroflux boundary condition
typename InputImageType::SizeType kernelSize;
kernelSize.Fill(m_NeighborhoodRadius);
auto kernelSize = InputImageType::SizeType::Filled(m_NeighborhoodRadius);

ConstNeighborhoodIterator<InputImageType> it(
kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ class ITK_TEMPLATE_EXPORT WindowedSincInterpolateImageFunction : public Interpol
SizeType
GetRadius() const override
{
SizeType radius;
radius.Fill(VRadius);
auto radius = SizeType::Filled(VRadius);
return radius;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ WindowedSincInterpolateImageFunction<TInputImage, VRadius, TWindowFunction, TBou
}

// Set the radius for the neighborhood
Size<ImageDimension> radius;
radius.Fill(VRadius);
auto radius = Size<ImageDimension>::Filled(VRadius);

// Initialize the neighborhood
IteratorType it(radius, image, image->GetBufferedRegion());
Expand Down Expand Up @@ -145,8 +144,7 @@ WindowedSincInterpolateImageFunction<TInputImage, VRadius, TWindowFunction, TBou
}

// Position the neighborhood at the index of interest
Size<ImageDimension> radius;
radius.Fill(VRadius);
auto radius = Size<ImageDimension>::Filled(VRadius);
IteratorType nit(radius, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());
nit.SetLocation(baseIndex);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,7 @@ BSplineDeformableTransform<TParametersValueType, VDimension, VSplineOrder>::Comp
// Zero all components of jacobian
jacobian.SetSize(SpaceDimension, this->GetNumberOfParameters());
jacobian.Fill(0.0);
SizeType supportSize;
supportSize.Fill(SplineOrder + 1);
auto supportSize = SizeType::Filled(SplineOrder + 1);

ContinuousIndexType index =
this->m_CoefficientImages[0]
Expand Down
3 changes: 1 addition & 2 deletions Modules/Core/Transform/include/itkBSplineTransform.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ BSplineTransform<TParametersValueType, VDimension, VSplineOrder>::BSplineTransfo

DirectionType meshDirection;
meshDirection.SetIdentity();
MeshSizeType meshSize;
meshSize.Fill(1);
auto meshSize = MeshSizeType::Filled(1);

this->m_FixedParameters.SetSize(VDimension * (VDimension + 3));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ BinaryDilateImageFilter<TInputImage, TOutputImage, TKernel>::GenerateData()
typename InputImageType::ConstPointer input = this->GetInput();

// Get values from superclass
InputPixelType foregroundValue = this->GetForegroundValue();
InputPixelType backgroundValue = this->GetBackgroundValue();
KernelType kernel = this->GetKernel();
InputSizeType radius;
radius.Fill(1);
InputPixelType foregroundValue = this->GetForegroundValue();
InputPixelType backgroundValue = this->GetBackgroundValue();
KernelType kernel = this->GetKernel();
auto radius = InputSizeType::Filled(1);
typename TOutputImage::RegionType outputRegion = output->GetBufferedRegion();

// compute the size of the temp image. It is needed to create the progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ BinaryErodeImageFilter<TInputImage, TOutputImage, TKernel>::GenerateData()
typename InputImageType::ConstPointer input = this->GetInput();

// Get values from superclass
InputPixelType foregroundValue = this->GetForegroundValue();
InputPixelType backgroundValue = this->GetBackgroundValue();
KernelType kernel = this->GetKernel();
InputSizeType radius;
radius.Fill(1);
InputPixelType foregroundValue = this->GetForegroundValue();
InputPixelType backgroundValue = this->GetBackgroundValue();
KernelType kernel = this->GetKernel();
auto radius = InputSizeType::Filled(1);
typename TOutputImage::RegionType outputRegion = output->GetBufferedRegion();

// compute the size of the temp image. It is needed to create the progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ BinaryMorphologyImageFilter<TInputImage, TOutputImage, TKernel>::AnalyzeKernel()
ImageRegionIteratorWithIndex<BoolImageType> kernelImageItIndex(tmpSEImage, tmpSEImage->GetRequestedRegion());

// Neighborhood iterator on SE element temp image
InputSizeType padBy;
padBy.Fill(1);
auto padBy = InputSizeType::Filled(1);
NeighborhoodIterator<BoolImageType> SEoNeighbIt(padBy, tmpSEImage, tmpSEImage->GetRequestedRegion());
SEoNeighbIt.OverrideBoundaryCondition(&cbc);
SizeValueType neighborhoodSize = SEoNeighbIt.Size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,17 +474,15 @@ PatchBasedDenoisingImageFilter<TInputImage, TOutputImage>::InitializePatchWeight

// Allocate the patch weights (mask) as an image.
// Done in physical space.
typename WeightsImageType::SizeType physicalSize;
physicalSize.Fill(physicalDiameter);
auto physicalSize = WeightsImageType::SizeType::Filled(physicalDiameter);
typename WeightsImageType::RegionType physicalRegion(physicalSize);
auto physicalWeightsImage = WeightsImageType::New();
physicalWeightsImage->SetRegions(physicalRegion);
physicalWeightsImage->SetSpacing(physicalSpacing);
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<WeightsImageType> pwIt(physicalWeightsImage, physicalRegion); !pwIt.IsAtEnd();
Expand Down Expand Up @@ -681,8 +679,7 @@ typename PatchBasedDenoisingImageFilter<TInputImage, TOutputImage>::ThreadDataSt
using FaceCalculatorType = typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>;
using FaceListType = typename FaceCalculatorType::FaceListType;

typename InputImageType::SizeType radius;
radius.Fill(1);
auto radius = InputImageType::SizeType::Filled(1);

if (m_NumIndependentComponents != 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ ContourDirectedMeanDistanceImageFilter<TInputImage1, TInputImage2>::ThreadedGene
InputImage1ConstPointer input = this->GetInput();

// Find the data-set boundary "faces"
SizeType radius;
radius.Fill(1);
auto radius = SizeType::Filled(1);

using FaceListType = typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImage1Type>::FaceListType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ FastMarchingImageFilterBase<TInput, TOutput>::FastMarchingImageFilterBase()
m_StartIndex.Fill(0);
m_LastIndex.Fill(0);

OutputSizeType outputSize;
outputSize.Fill(16);
auto outputSize = OutputSizeType::Filled(16);

NodeType outputIndex{};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ CannyEdgeDetectionImageFilter<TInputImage, TOutputImage>::ThreadedCompute2ndDeri
typename OutputImageType::Pointer input = m_GaussianFilter->GetOutput();

// Set iterator radius
Size<ImageDimension> radius;
radius.Fill(1);
auto radius = Size<ImageDimension>::Filled(1);

// Find the data-set boundary "faces"
NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<TInputImage> bC;
Expand Down Expand Up @@ -322,8 +321,7 @@ CannyEdgeDetectionImageFilter<TInputImage, TOutputImage>::FollowEdge(IndexType
ListNodeType * node;

// Assign iterator radius
Size<ImageDimension> radius;
radius.Fill(1);
auto radius = Size<ImageDimension>::Filled(1);

ConstNeighborhoodIterator<TOutputImage> oit(
radius, multiplyImageFilterOutput, multiplyImageFilterOutput->GetRequestedRegion());
Expand Down Expand Up @@ -398,8 +396,7 @@ CannyEdgeDetectionImageFilter<TInputImage, TOutputImage>::ThreadedCompute2ndDeri
typename InputImageType::Pointer output = m_UpdateBuffer1;

// Set iterator radius
Size<ImageDimension> radius;
radius.Fill(1);
auto radius = Size<ImageDimension>::Filled(1);

// Find the data-set boundary "faces"
NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<TInputImage> bC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ MaskFeaturePointSelectionFilter<TImage, TMask, TFeatures>::GenerateData()
if (m_ComputeStructureTensors)
{
// tensor calculations access points in 2 X m_BlockRadius + 1 radius
SizeType onesSize;
onesSize.Fill(1);
auto onesSize = SizeType::Filled(1);
// Define the area in which tensors are going to be computed.
const SizeType blockSize = m_BlockRadius + m_BlockRadius + onesSize;
safeIndex += blockSize;
Expand Down Expand Up @@ -231,8 +230,7 @@ MaskFeaturePointSelectionFilter<TImage, TMask, TFeatures>::GenerateData()

Matrix<SpacePrecisionType, ImageDimension, 1> gradI; // vector declared as column matrix

SizeType radius;
radius.Fill(1); // iterate over neighbourhood of a voxel
auto radius = SizeType::Filled(1); // iterate over neighbourhood of a voxel

RegionType center;
center.SetSize(radius);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ LabelMapContourOverlayImageFilter<TLabelMap, TFeatureImage, TOutputImage>::Label
m_Opacity = 0.5;
m_Type = CONTOUR;
m_Priority = HIGH_LABEL_ON_TOP;
SizeType s;
s.Fill(1);
auto s = SizeType::Filled(1);
m_ContourThickness = SizeType(s);
s.Fill(0);
m_DilationRadius = SizeType(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ BSplineControlPointImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenera
collapsedPhiLattices[i] = PointDataImageType::New();
collapsedPhiLattices[i]->CopyInformation(inputPtr);

typename PointDataImageType::SizeType size;
size.Fill(1);
auto size = PointDataImageType::SizeType::Filled(1);
for (unsigned int j = 0; j < i; ++j)
{
size[j] = inputPtr->GetLargestPossibleRegion().GetSize()[j];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>::Threade
collapsedPhiLattices[i] = PointDataImageType::New();
collapsedPhiLattices[i]->CopyInformation(this->m_PhiLattice);

typename PointDataImageType::SizeType size;
size.Fill(1);
auto size = PointDataImageType::SizeType::Filled(1);
for (unsigned int j = 0; j < i; ++j)
{
size[j] = this->m_PhiLattice->GetLargestPossibleRegion().GetSize()[j];
Expand Down Expand Up @@ -886,8 +885,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>::Threade
collapsedPhiLattices[i]->SetSpacing(this->m_PhiLattice->GetSpacing());
collapsedPhiLattices[i]->SetDirection(this->m_PhiLattice->GetDirection());

typename PointDataImageType::SizeType size;
size.Fill(1);
auto size = PointDataImageType::SizeType::Filled(1);
for (unsigned int j = 0; j < i; ++j)
{
size[j] = this->m_PhiLattice->GetLargestPossibleRegion().GetSize()[j];
Expand Down
6 changes: 2 additions & 4 deletions Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ TileImageFilter<TInputImage, TOutputImage>::GenerateOutputInformation()

// Determine the last dimension for the tile image. This dimension will
// be large enough to accommodate left-over images.
OutputSizeType outputSize;
outputSize.Fill(1);
auto outputSize = OutputSizeType::Filled(1);

if (m_Layout[OutputImageDimension - 1] == 0)
{
Expand All @@ -216,8 +215,7 @@ TileImageFilter<TInputImage, TOutputImage>::GenerateOutputInformation()
m_Layout[OutputImageDimension - 1] = outputSize[OutputImageDimension - 1];
}

OutputSizeType tileSize;
tileSize.Fill(1);
auto tileSize = OutputSizeType::Filled(1);

for (unsigned int i = 0; i < OutputImageDimension; ++i)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ class ScanlineFilterCommon

LineRegion.SetSize(PretendSize);
fakeImage->SetRegions(LineRegion);
PretendSizeType kernelRadius;
kernelRadius.Fill(1);
auto kernelRadius = PretendSizeType::Filled(1);
LineNeighborhoodType lnit(kernelRadius, fakeImage, LineRegion);

if (wholeNeighborhood)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ AutoCropLabelMapFilter<TInputImage>::GenerateOutputInformation()
}

// find the bounding box of the objects
IndexType minIdx;
minIdx.Fill(NumericTraits<typename TInputImage::IndexValueType>::max());
IndexType maxIdx;
maxIdx.Fill(NumericTraits<typename TInputImage::IndexValueType>::NonpositiveMin());
auto minIdx = IndexType::Filled(NumericTraits<typename TInputImage::IndexValueType>::max());
auto maxIdx = IndexType::Filled(NumericTraits<typename TInputImage::IndexValueType>::NonpositiveMin());

const InputImageType * inputImage = this->GetInput();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ LabelMapMaskImageFilter<TInputImage, TOutputImage>::GenerateOutputInformation()
else
{
// Compute the bounding box of all the objects which don't have that label
IndexType mins;
mins.Fill(NumericTraits<IndexValueType>::max());
IndexType maxs;
maxs.Fill(NumericTraits<IndexValueType>::NonpositiveMin());
auto mins = IndexType::Filled(NumericTraits<IndexValueType>::max());
auto maxs = IndexType::Filled(NumericTraits<IndexValueType>::NonpositiveMin());
for (typename InputImageType::ConstIterator loit(this->GetInput()); !loit.IsAtEnd(); ++loit)
{
if (loit.GetLabel() != m_Label)
Expand Down Expand Up @@ -168,10 +166,8 @@ LabelMapMaskImageFilter<TInputImage, TOutputImage>::GenerateOutputInformation()
// Just find the bounding box of the object with that label

const LabelObjectType * labelObject = input->GetLabelObject(m_Label);
IndexType mins;
mins.Fill(NumericTraits<IndexValueType>::max());
IndexType maxs;
maxs.Fill(NumericTraits<IndexValueType>::NonpositiveMin());
auto mins = IndexType::Filled(NumericTraits<IndexValueType>::max());
auto maxs = IndexType::Filled(NumericTraits<IndexValueType>::NonpositiveMin());
// Iterate over all the lines
typename LabelObjectType::ConstLineIterator lit(labelObject);
while (!lit.IsAtEnd())
Expand Down
Loading