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
6 changes: 2 additions & 4 deletions Examples/DataRepresentation/Image/Image4.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ main(int, char *[])

// Software Guide : BeginCodeSnippet
// coordinates of the center of the first pixel in N-D
ImageType::PointType newOrigin;
newOrigin.Fill(0.0);
ImageType::PointType newOrigin{};
image->SetOrigin(newOrigin);
// Software Guide : EndCodeSnippet

Expand Down Expand Up @@ -443,8 +442,7 @@ main(int, char *[])
// Software Guide : BeginCodeSnippet
using MatrixType =
itk::Matrix<itk::SpacePrecisionType, Dimension, Dimension>;
MatrixType SpacingMatrix;
SpacingMatrix.Fill(0.0F);
auto SpacingMatrix = itk::MakeFilled<MatrixType>(0.0F);

const ImageType::SpacingType & ImageSpacing = image->GetSpacing();
SpacingMatrix(0, 0) = ImageSpacing[0];
Expand Down
3 changes: 1 addition & 2 deletions Examples/DataRepresentation/Image/Image5.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ main(int argc, char * argv[])
size[1] = 200; // size along Y
size[2] = 200; // size along Z

ImportFilterType::IndexType start;
start.Fill(0);
ImportFilterType::IndexType start{};

ImportFilterType::RegionType region;
region.SetIndex(start);
Expand Down
3 changes: 1 addition & 2 deletions Examples/Filtering/GaussianBlurImageFunction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ main(int argc, char * argv[])
auto gaussianFunction = GFunctionType::New();
gaussianFunction->SetInputImage(inputImage);

GFunctionType::ErrorArrayType setError;
setError.Fill(0.01);
auto setError = itk::MakeFilled<GFunctionType::ErrorArrayType>(0.01);
gaussianFunction->SetMaximumError(setError);
gaussianFunction->SetSigma(std::stod(argv[3]));
gaussianFunction->SetMaximumKernelWidth(std::stoi(argv[4]));
Expand Down
3 changes: 1 addition & 2 deletions Examples/Filtering/ResampleImageFilter6.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ main(int argc, char * argv[])


// Software Guide : BeginCodeSnippet
PixelType defaultValue;
defaultValue.Fill(50);
auto defaultValue = itk::MakeFilled<PixelType>(50);

filter->SetDefaultPixelValue(defaultValue);
// Software Guide : EndCodeSnippet
Expand Down
3 changes: 1 addition & 2 deletions Examples/Filtering/ResampleImageFilter9.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ main(int argc, char * argv[])
linearFilter->SetTransform(transform);

// Software Guide : BeginCodeSnippet
PixelType defaultValue;
defaultValue.Fill(50);
auto defaultValue = itk::MakeFilled<PixelType>(50);
nearestFilter->SetDefaultPixelValue(defaultValue);
linearFilter->SetDefaultPixelValue(defaultValue);
// Software Guide : EndCodeSnippet
Expand Down
12 changes: 5 additions & 7 deletions Examples/IO/TransformReadWrite.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ main(int argc, char * argv[])
auto composite = CompositeTransformType::New();

using AffineTransformType = itk::AffineTransform<ScalarType, Dimension>;
auto affine = AffineTransformType::New();
AffineTransformType::InputPointType cor;
cor.Fill(12);
auto affine = AffineTransformType::New();
auto cor = itk::MakeFilled<AffineTransformType::InputPointType>(12);
affine->SetCenter(cor);

composite->AddTransform(affine);
Expand All @@ -76,10 +75,9 @@ main(int argc, char * argv[])

auto bspline = BSplineTransformType::New();

BSplineTransformType::OriginType origin;
origin.Fill(100);
BSplineTransformType::PhysicalDimensionsType dimensions;
dimensions.Fill(1.5 * 9.0);
auto origin = itk::MakeFilled<BSplineTransformType::OriginType>(100);
auto dimensions =
itk::MakeFilled<BSplineTransformType::PhysicalDimensionsType>(1.5 * 9.0);

bspline->SetTransformDomainOrigin(origin);
bspline->SetTransformDomainPhysicalDimensions(dimensions);
Expand Down
3 changes: 1 addition & 2 deletions Examples/Iterators/NeighborhoodIterators1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ main(int argc, char ** argv)
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
NeighborhoodIteratorType::RadiusType radius;
radius.Fill(1);
auto radius = itk::MakeFilled<NeighborhoodIteratorType::RadiusType>(1);
NeighborhoodIteratorType it(
radius, reader->GetOutput(), reader->GetOutput()->GetRequestedRegion());
// Software Guide : EndCodeSnippet
Expand Down
4 changes: 2 additions & 2 deletions Examples/Iterators/NeighborhoodIterators5.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ main(int argc, char ** argv)
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
NeighborhoodIteratorType::RadiusType radius;
radius.Fill(gaussianOperator.GetRadius()[0]);
auto radius = itk::MakeFilled<NeighborhoodIteratorType::RadiusType>(
gaussianOperator.GetRadius()[0]);
// Software Guide EndCodeSnippet

// Software Guide : BeginLatex
Expand Down
6 changes: 2 additions & 4 deletions Examples/Iterators/NeighborhoodIterators6.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ main(int argc, char ** argv)
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
NeighborhoodIteratorType::RadiusType radius;
radius.Fill(1);
auto radius = itk::MakeFilled<NeighborhoodIteratorType::RadiusType>(1);
NeighborhoodIteratorType it(radius, input, input->GetRequestedRegion());

it.SetLocation(index);
Expand All @@ -164,8 +163,7 @@ main(int argc, char ** argv)
bool flag = true;
while (flag == true)
{
NeighborhoodIteratorType::OffsetType nextMove;
nextMove.Fill(0);
NeighborhoodIteratorType::OffsetType nextMove{};

flag = false;

Expand Down
4 changes: 2 additions & 2 deletions Examples/Iterators/ShapedNeighborhoodIterators1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ main(int argc, char ** argv)

// Software Guide : BeginCodeSnippet
unsigned int element_radius = std::stoi(argv[3]);
ShapedNeighborhoodIteratorType::RadiusType radius;
radius.Fill(element_radius);
auto radius = itk::MakeFilled<ShapedNeighborhoodIteratorType::RadiusType>(
element_radius);
// Software Guide : EndCodeSnippet

// Software Guide : BeginLatex
Expand Down
4 changes: 2 additions & 2 deletions Examples/Iterators/ShapedNeighborhoodIterators2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ main(int argc, char ** argv)
FaceCalculatorType::FaceListType faceList;
FaceCalculatorType::FaceListType::iterator fit;

ShapedNeighborhoodIteratorType::RadiusType radius;
radius.Fill(element_radius);
auto radius = itk::MakeFilled<ShapedNeighborhoodIteratorType::RadiusType>(
element_radius);

faceList =
faceCalculator(reader->GetOutput(), output->GetRequestedRegion(), radius);
Expand Down
4 changes: 2 additions & 2 deletions Examples/RegistrationITKv4/DeformableRegistration4.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ main(int argc, char * argv[])

unsigned int numberOfGridNodesInOneDimension = 8;

TransformType::MeshSizeType meshSize;
meshSize.Fill(numberOfGridNodesInOneDimension - SplineOrder);
auto meshSize = itk::MakeFilled<TransformType::MeshSizeType>(
numberOfGridNodesInOneDimension - SplineOrder);

transformInitializer->SetTransform(transform);
transformInitializer->SetImage(fixedImage);
Expand Down
4 changes: 2 additions & 2 deletions Examples/RegistrationITKv4/DeformableRegistration6.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ main(int argc, char * argv[])

unsigned int numberOfGridNodesInOneDimension = 8;

TransformType::MeshSizeType meshSize;
meshSize.Fill(numberOfGridNodesInOneDimension - SplineOrder);
auto meshSize = itk::MakeFilled<TransformType::MeshSizeType>(
numberOfGridNodesInOneDimension - SplineOrder);

transformInitializer->SetTransform(outputBSplineTransform);
transformInitializer->SetImage(fixedImage);
Expand Down
4 changes: 2 additions & 2 deletions Examples/RegistrationITKv4/DeformableRegistration7.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ main(int argc, char * argv[])

unsigned int numberOfGridNodesInOneDimension = 8;

TransformType::MeshSizeType meshSize;
meshSize.Fill(numberOfGridNodesInOneDimension - SplineOrder);
auto meshSize = itk::MakeFilled<TransformType::MeshSizeType>(
numberOfGridNodesInOneDimension - SplineOrder);

transformInitializer->SetTransform(outputBSplineTransform);
transformInitializer->SetImage(fixedImage);
Expand Down
4 changes: 2 additions & 2 deletions Examples/RegistrationITKv4/DeformableRegistration8.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ main(int argc, char * argv[])

auto transformInitializer = InitializerType::New();

TransformType::MeshSizeType meshSize;
meshSize.Fill(numberOfGridNodesInOneDimension - SplineOrder);
auto meshSize = itk::MakeFilled<TransformType::MeshSizeType>(
numberOfGridNodesInOneDimension - SplineOrder);

transformInitializer->SetTransform(transform);
transformInitializer->SetImage(fixedImage);
Expand Down
6 changes: 2 additions & 4 deletions Examples/RegistrationITKv4/IterativeClosestPoint3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,9 @@ main(int argc, char * argv[])

pointsToImageFilter->SetInput(fixedPointSet);

BinaryImageType::SpacingType spacing;
spacing.Fill(1.0);
auto spacing = itk::MakeFilled<BinaryImageType::SpacingType>(1.0);

BinaryImageType::PointType origin;
origin.Fill(0.0);
BinaryImageType::PointType origin{};
// Software Guide : EndCodeSnippet

// Software Guide : BeginLatex
Expand Down
3 changes: 1 addition & 2 deletions Examples/Segmentation/GibbsPriorImageFilter1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ main(int argc, char * argv[])
using VecImagePixelType = VecImageType::PixelType;
VecImageType::SizeType vecImgSize = { { 181, 217, 1 } };

VecImageType::IndexType index;
index.Fill(0);
VecImageType::IndexType index{};

VecImageType::RegionType region;

Expand Down
6 changes: 2 additions & 4 deletions Examples/SpatialObjects/ArrowSpatialObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
ArrowType::PointType pos;
pos.Fill(1);
auto pos = itk::MakeFilled<ArrowType::PointType>(1);
myArrow->SetPositionInObjectSpace(pos);
// Software Guide : EndCodeSnippet

Expand Down Expand Up @@ -83,8 +82,7 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
ArrowType::VectorType direction;
direction.Fill(0);
ArrowType::VectorType direction{};
direction[1] = 1.0;
myArrow->SetDirectionInObjectSpace(direction);
// Software Guide : EndCodeSnippet
Expand Down
6 changes: 2 additions & 4 deletions Examples/SpatialObjects/EllipseSpatialObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,14 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
itk::Point<double, 3> insidePoint;
insidePoint.Fill(1.0);
auto insidePoint = itk::MakeFilled<itk::Point<double, 3>>(1.0);
if (myEllipse->IsInsideInWorldSpace(insidePoint))
{
std::cout << "The point " << insidePoint;
std::cout << " is really inside the ellipse" << std::endl;
}

itk::Point<double, 3> outsidePoint;
outsidePoint.Fill(3.0);
auto outsidePoint = itk::MakeFilled<itk::Point<double, 3>>(3.0);
if (!myEllipse->IsInsideInWorldSpace(outsidePoint))
{
std::cout << "The point " << outsidePoint;
Expand Down
6 changes: 2 additions & 4 deletions Examples/SpatialObjects/GroupSpatialObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
GroupType::VectorType offset;
offset.Fill(10);
auto offset = itk::MakeFilled<GroupType::VectorType>(10);
myGroup->GetModifiableObjectToParentTransform()->SetOffset(offset);
myGroup->Update();
// Software Guide : EndCodeSnippet
Expand All @@ -88,8 +87,7 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
GroupType::PointType point;
point.Fill(10);
auto point = itk::MakeFilled<GroupType::PointType>(10);
std::cout << "Is my point " << point
<< " inside?: " << myGroup->IsInsideInWorldSpace(point, 2)
<< std::endl;
Expand Down
6 changes: 2 additions & 4 deletions Examples/SpatialObjects/ImageMaskSpatialObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,10 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
ImageMaskSpatialObject::PointType inside;
inside.Fill(20);
auto inside = itk::MakeFilled<ImageMaskSpatialObject::PointType>(20);
std::cout << "Is my point " << inside << " inside my mask? "
<< maskSO->IsInsideInWorldSpace(inside) << std::endl;
ImageMaskSpatialObject::PointType outside;
outside.Fill(45);
auto outside = itk::MakeFilled<ImageMaskSpatialObject::PointType>(45);
std::cout << "Is my point " << outside << " outside my mask? "
<< !maskSO->IsInsideInWorldSpace(outside) << std::endl;
// Software Guide : EndCodeSnippet
Expand Down
3 changes: 1 addition & 2 deletions Examples/SpatialObjects/ImageSpatialObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ main(int, char *[])

// Software Guide : BeginCodeSnippet
using Point = itk::Point<double, 2>;
Point insidePoint;
insidePoint.Fill(9);
auto insidePoint = itk::MakeFilled<Point>(9);

if (imageSO->IsInsideInWorldSpace(insidePoint))
{
Expand Down
3 changes: 1 addition & 2 deletions Examples/SpatialObjects/MeshSpatialObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ main(int, char *[])
<< "Mesh bounds : "
<< myMeshSpatialObject->GetMyBoundingBoxInWorldSpace()->GetBounds()
<< std::endl;
MeshSpatialObjectType::PointType myPhysicalPoint;
myPhysicalPoint.Fill(1);
auto myPhysicalPoint = itk::MakeFilled<MeshSpatialObjectType::PointType>(1);
std::cout << "Is my physical point inside? : "
<< myMeshSpatialObject->IsInsideInWorldSpace(myPhysicalPoint)
<< std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ main(int, char *[])
using EllipseType = itk::EllipseSpatialObject<2>;
auto ellipse = EllipseType::New();
ellipse->SetRadiusInObjectSpace(2);
EllipseType::PointType offset;
offset.Fill(5);
auto offset = itk::MakeFilled<EllipseType::PointType>(5);
ellipse->SetCenterInObjectSpace(offset);
ellipse->Update();
// Software Guide : EndCodeSnippet
Expand Down
3 changes: 1 addition & 2 deletions Examples/Statistics/GaussianMembershipFunction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ main(int, char *[])
densityFunction->SetMean(mean);
densityFunction->SetCovariance(cov);

MeasurementVectorType mv;
mv.Fill(0);
MeasurementVectorType mv{};

std::cout << densityFunction->Evaluate(mv) << std::endl;
// Software Guide : EndCodeSnippet
Expand Down
Loading
Loading