Skip to content

Commit

Permalink
STYLE: Replace Pointer var; var = x with Pointer var = x in Examples
Browse files Browse the repository at this point in the history
- Follow-up to pull request InsightSoftwareConsortium#4964
commit 4926511
"STYLE: Replace `Pointer var; var = x` with `Pointer var = x`"

Triggered by a comment by Bradley Lowekamp at
InsightSoftwareConsortium#4964 (comment)
  • Loading branch information
N-Dekker committed Nov 21, 2024
1 parent ac021d0 commit e6bc01e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
4 changes: 1 addition & 3 deletions Examples/DataRepresentation/Mesh/AutomaticMesh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ main(int, char *[])
using MeshSourceType = itk::AutomaticTopologyMeshSource<MeshType>;
using IdentifierArrayType = MeshSourceType::IdentifierArrayType;

MeshSourceType::Pointer meshSource;

meshSource = MeshSourceType::New();
MeshSourceType::Pointer meshSource = MeshSourceType::New();
// Software Guide : EndCodeSnippet

// Software Guide : BeginLatex
Expand Down
16 changes: 8 additions & 8 deletions Examples/RegistrationITKv4/DeformableRegistration1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ main(int argc, char * argv[])
registrationFilter->SetMovingImage(IntensityEqualizeFilter->GetOutput());


itk::ImageFileWriter<ImageType>::Pointer writer;
writer = itk::ImageFileWriter<ImageType>::New();
itk::ImageFileWriter<ImageType>::Pointer writer =
itk::ImageFileWriter<ImageType>::New();
std::string ofn = "fixed.mha";
writer->SetFileName(ofn.c_str());
writer->SetInput(registrationFilter->GetFixedImage());
Expand All @@ -231,8 +231,8 @@ main(int argc, char * argv[])
}

ofn = "moving.mha";
itk::ImageFileWriter<ImageType>::Pointer writer2;
writer2 = itk::ImageFileWriter<ImageType>::New();
itk::ImageFileWriter<ImageType>::Pointer writer2 =
itk::ImageFileWriter<ImageType>::New();
writer2->SetFileName(ofn.c_str());
writer2->SetInput(registrationFilter->GetMovingImage());

Expand Down Expand Up @@ -261,8 +261,8 @@ main(int argc, char * argv[])

// Software Guide : BeginCodeSnippet
// Create the material properties
itk::fem::MaterialLinearElasticity::Pointer m;
m = itk::fem::MaterialLinearElasticity::New();
itk::fem::MaterialLinearElasticity::Pointer m =
itk::fem::MaterialLinearElasticity::New();
m->SetGlobalNumber(0);
// Young's modulus of the membrane
m->SetYoungsModulus(registrationFilter->GetElasticity());
Expand Down Expand Up @@ -300,8 +300,8 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
itk::ImageFileWriter<ImageType>::Pointer warpedImageWriter;
warpedImageWriter = itk::ImageFileWriter<ImageType>::New();
itk::ImageFileWriter<ImageType>::Pointer warpedImageWriter =
itk::ImageFileWriter<ImageType>::New();
warpedImageWriter->SetInput(registrationFilter->GetWarpedImage());
warpedImageWriter->SetFileName("warpedMovingImage.mha");
try
Expand Down
12 changes: 6 additions & 6 deletions Examples/RegistrationITKv4/DeformableRegistration11.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,23 @@ main(int argc, char * argv[])
registrationFilter->SetMovingImage(IntensityEqualizeFilter->GetOutput());


itk::ImageFileWriter<ImageType>::Pointer writer;
writer = itk::ImageFileWriter<ImageType>::New();
itk::ImageFileWriter<ImageType>::Pointer writer =
itk::ImageFileWriter<ImageType>::New();

writer->SetFileName("fixed.mhd");
writer->SetInput(registrationFilter->GetFixedImage());
writer->Write();

itk::ImageFileWriter<ImageType>::Pointer writer2;
writer2 = itk::ImageFileWriter<ImageType>::New();
itk::ImageFileWriter<ImageType>::Pointer writer2 =
itk::ImageFileWriter<ImageType>::New();
writer2->SetFileName("moving.mhd");
writer2->SetInput(registrationFilter->GetMovingImage());
writer2->Write();


// Create the material properties
itk::fem::MaterialLinearElasticity::Pointer m;
m = itk::fem::MaterialLinearElasticity::New();
itk::fem::MaterialLinearElasticity::Pointer m =
itk::fem::MaterialLinearElasticity::New();
m->SetGlobalNumber(0);
m->SetYoungsModulus(
registrationFilter
Expand Down
4 changes: 2 additions & 2 deletions Examples/Statistics/ImageToListSampleAdaptor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ main()
// Software Guide : BeginCodeSnippet
using FloatImage2DType = itk::Image<float, 2>;

itk::RandomImageSource<FloatImage2DType>::Pointer random;
random = itk::RandomImageSource<FloatImage2DType>::New();
itk::RandomImageSource<FloatImage2DType>::Pointer random =
itk::RandomImageSource<FloatImage2DType>::New();

random->SetMin(0.0);
random->SetMax(1000.0);
Expand Down
4 changes: 2 additions & 2 deletions Examples/Statistics/PointSetToAdaptor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ main()
// Software Guide : BeginCodeSnippet
using FloatPointSet2DType = itk::PointSet<float, 2>;

itk::RandomPointSetSource<FloatPointSet2DType>::Pointer random;
random = itk::RandomPointSetSource<FloatPointSet2DType>::New();
itk::RandomPointSetSource<FloatPointSet2DType>::Pointer random =
itk::RandomPointSetSource<FloatPointSet2DType>::New();
random->SetMin(0.0);
random->SetMax(1000.0);

Expand Down

0 comments on commit e6bc01e

Please sign in to comment.