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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Examples/DataRepresentation/Image/Image2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ main(int, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
ImageType::Pointer image = reader->GetOutput();
const ImageType::Pointer image = reader->GetOutput();
// Software Guide : EndCodeSnippet

// Software Guide : BeginLatex
Expand Down
2 changes: 1 addition & 1 deletion Examples/DataRepresentation/Image/Image3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
ImageType::PixelType pixelValue = image->GetPixel(pixelIndex);
const ImageType::PixelType pixelValue = image->GetPixel(pixelIndex);
// Software Guide : EndCodeSnippet

// Software Guide : BeginLatex
Expand Down
2 changes: 1 addition & 1 deletion Examples/DataRepresentation/Image/Image4.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ main(int, char *[])
LeftEyeIndexVector[1] = LeftEyeIndex[1];
LeftEyeIndexVector[2] = LeftEyeIndex[2];

ImageType::PointType LeftEyePointByHand =
const ImageType::PointType LeftEyePointByHand =
ImageOrigin + ImageDirectionCosines * SpacingMatrix * LeftEyeIndexVector;
// Software Guide : EndCodeSnippet

Expand Down
2 changes: 1 addition & 1 deletion Examples/DataRepresentation/Image/ImageAdaptor1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ main(int argc, char * argv[])
it.GoToBegin();
while (!it.IsAtEnd())
{
float value = it.Get();
const float value = it.Get();
sum += value;
++it;
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/DataRepresentation/Image/RGBImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ main(int, char * argv[])
reader->SetFileName(filename);
reader->Update();

ImageType::Pointer image = reader->GetOutput();
const ImageType::Pointer image = reader->GetOutput();
const ImageType::IndexType pixelIndex = { { 25, 35, 0 } };

// Software Guide : BeginLatex
Expand Down
2 changes: 1 addition & 1 deletion Examples/DataRepresentation/Image/VectorImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ main(int, char *[])

// The GetPixel method can also be used to read Vectors
// pixels from the image
ImageType::PixelType value = image->GetPixel(pixelIndex);
const ImageType::PixelType value = image->GetPixel(pixelIndex);

std::cout << value << std::endl;

Expand Down
2 changes: 1 addition & 1 deletion Examples/DataRepresentation/Mesh/AutomaticMesh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ main(int, char *[])
//
// Software Guide : EndLatex

MeshType::Pointer mesh = meshSource->GetOutput();
const MeshType::Pointer mesh = meshSource->GetOutput();
std::cout << mesh << std::endl;

// Software Guide : BeginLatex
Expand Down
8 changes: 4 additions & 4 deletions Examples/DataRepresentation/Mesh/Mesh1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
PointsIterator end = mesh->GetPoints()->End();
const PointsIterator end = mesh->GetPoints()->End();
while (pointIterator != end)
{
MeshType::PointType p = pointIterator.Value(); // access the point
std::cout << p << std::endl; // print the point
++pointIterator; // advance to next point
const MeshType::PointType p = pointIterator.Value(); // access the point
std::cout << p << std::endl; // print the point
++pointIterator; // advance to next point
}
// Software Guide : EndCodeSnippet

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

// Software Guide : BeginCodeSnippet
CellIterator cellIterator = mesh->GetCells()->Begin();
CellIterator end = mesh->GetCells()->End();
CellIterator cellIterator = mesh->GetCells()->Begin();
const CellIterator end = mesh->GetCells()->End();
// Software Guide : EndCodeSnippet


Expand Down
6 changes: 3 additions & 3 deletions Examples/DataRepresentation/Mesh/Mesh3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
CellDataIterator cellDataIterator = mesh->GetCellData()->Begin();
CellDataIterator end = mesh->GetCellData()->End();
CellDataIterator cellDataIterator = mesh->GetCellData()->Begin();
const CellDataIterator end = mesh->GetCellData()->End();
// Software Guide : EndCodeSnippet


Expand All @@ -238,7 +238,7 @@ main(int, char *[])
// Software Guide : BeginCodeSnippet
while (cellDataIterator != end)
{
PixelType cellValue = cellDataIterator.Value();
const PixelType cellValue = cellDataIterator.Value();
std::cout << cellValue << std::endl;
++cellDataIterator;
}
Expand Down
16 changes: 10 additions & 6 deletions Examples/DataRepresentation/Mesh/MeshKComplex.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ main(int, char *[])

// Software Guide : BeginCodeSnippet
using PointIterator = MeshType::PointsContainer::ConstIterator;
PointIterator pointIterator = mesh->GetPoints()->Begin();
PointIterator pointEnd = mesh->GetPoints()->End();
PointIterator pointIterator = mesh->GetPoints()->Begin();
const PointIterator pointEnd = mesh->GetPoints()->End();

while (pointIterator != pointEnd)
{
Expand Down Expand Up @@ -602,7 +602,8 @@ main(int, char *[])
for (unsigned int b0 = 0; b0 < n0; ++b0)
{
MeshType::CellIdentifier id;
bool found = mesh->GetBoundaryAssignment(dimension, cellId, b0, &id);
const bool found =
mesh->GetBoundaryAssignment(dimension, cellId, b0, &id);
if (found)
std::cout << id << std::endl;
}
Expand All @@ -613,7 +614,8 @@ main(int, char *[])
for (unsigned int b1 = 0; b1 < n1; ++b1)
{
MeshType::CellIdentifier id;
bool found = mesh->GetBoundaryAssignment(dimension, cellId, b1, &id);
const bool found =
mesh->GetBoundaryAssignment(dimension, cellId, b1, &id);
if (found)
{
std::cout << id << std::endl;
Expand All @@ -625,7 +627,8 @@ main(int, char *[])
for (unsigned int b2 = 0; b2 < n2; ++b2)
{
MeshType::CellIdentifier id;
bool found = mesh->GetBoundaryAssignment(dimension, cellId, b2, &id);
const bool found =
mesh->GetBoundaryAssignment(dimension, cellId, b2, &id);
if (found)
{
std::cout << id << std::endl;
Expand Down Expand Up @@ -657,7 +660,8 @@ main(int, char *[])
for (unsigned int b1 = 0; b1 < n1; ++b1)
{
MeshType::CellIdentifier id;
bool found = mesh->GetBoundaryAssignment(dimension, cellId, b1, &id);
const bool found =
mesh->GetBoundaryAssignment(dimension, cellId, b1, &id);
if (found)
{
std::cout << id << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions Examples/DataRepresentation/Mesh/MeshPolyLine.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ main(int, char *[])

// Software Guide : BeginCodeSnippet
using PointIterator = MeshType::PointsContainer::ConstIterator;
PointIterator pointIterator = mesh->GetPoints()->Begin();
PointIterator pointEnd = mesh->GetPoints()->End();
PointIterator pointIterator = mesh->GetPoints()->Begin();
const PointIterator pointEnd = mesh->GetPoints()->End();

while (pointIterator != pointEnd)
{
Expand Down
8 changes: 4 additions & 4 deletions Examples/DataRepresentation/Mesh/MeshTraits.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ main(int, char *[])
// Software Guide : BeginCodeSnippet
for (unsigned int cellId = 0; cellId < numberOfCells; ++cellId)
{
CellDataType value;
const CellDataType value;
mesh->SetCellData(cellId, value);
}

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

// Software Guide : BeginCodeSnippet
CellDataIterator cellDataIterator = mesh->GetCellData()->Begin();
CellDataIterator end = mesh->GetCellData()->End();
CellDataIterator cellDataIterator = mesh->GetCellData()->Begin();
const CellDataIterator end = mesh->GetCellData()->End();
// Software Guide : EndCodeSnippet


Expand All @@ -299,7 +299,7 @@ main(int, char *[])
// Software Guide : BeginCodeSnippet
while (cellDataIterator != end)
{
CellDataType cellValue = cellDataIterator.Value();
const CellDataType cellValue = cellDataIterator.Value();
std::cout << cellValue << std::endl;
++cellDataIterator;
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/DataRepresentation/Mesh/PointSet1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
PointType pp;
bool pointExists = pointsSet->GetPoint(1, &pp);
PointType pp;
const bool pointExists = pointsSet->GetPoint(1, &pp);

if (pointExists)
{
Expand Down
10 changes: 5 additions & 5 deletions Examples/DataRepresentation/Mesh/PointSet2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ main(int, char *[])


// Software Guide : BeginCodeSnippet
PointsContainer::Pointer points2 = pointSet->GetPoints();
const PointsContainer::Pointer points2 = pointSet->GetPoints();
// Software Guide : EndCodeSnippet


Expand Down Expand Up @@ -204,12 +204,12 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
PointsIterator end = points->End();
const PointsIterator end = points->End();
while (pointIterator != end)
{
PointType p = pointIterator.Value(); // access the point
std::cout << p << std::endl; // print the point
++pointIterator; // advance to next point
const PointType p = pointIterator.Value(); // access the point
std::cout << p << std::endl; // print the point
++pointIterator; // advance to next point
}
// Software Guide : EndCodeSnippet

Expand Down
14 changes: 7 additions & 7 deletions Examples/DataRepresentation/Mesh/PointSet3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ main(int, char *[])
// Software Guide : BeginCodeSnippet
unsigned int pointId = 0;

PixelType value0 = 34;
PixelType value1 = 67;
const PixelType value0 = 34;
const PixelType value1 = 67;

pointData->InsertElement(pointId++, value0);
pointData->InsertElement(pointId++, value1);
Expand Down Expand Up @@ -190,7 +190,7 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
PointDataContainer::Pointer pointData2 = pointSet->GetPointData();
const PointDataContainer::Pointer pointData2 = pointSet->GetPointData();
// Software Guide : EndCodeSnippet


Expand Down Expand Up @@ -243,12 +243,12 @@ main(int, char *[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
PointDataIterator end = pointData2->End();
const PointDataIterator end = pointData2->End();
while (pointDataIterator != end)
{
PixelType p = pointDataIterator.Value(); // access the pixel data
std::cout << p << std::endl; // print the pixel data
++pointDataIterator; // advance to next pixel/point
const PixelType p = pointDataIterator.Value(); // access the pixel data
std::cout << p << std::endl; // print the pixel data
++pointDataIterator; // advance to next pixel/point
}
// Software Guide : EndCodeSnippet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ main(int, char *[])

// Software Guide : BeginCodeSnippet
using PointDataIterator = PointSetType::PointDataContainer::ConstIterator;
PointDataIterator pixelIterator = pointSet->GetPointData()->Begin();
PointDataIterator pixelEnd = pointSet->GetPointData()->End();
PointDataIterator pixelIterator = pointSet->GetPointData()->Begin();
const PointDataIterator pixelEnd = pointSet->GetPointData()->End();

using PointIterator = PointSetType::PointsContainer::Iterator;
PointIterator pointIterator = pointSet->GetPoints()->Begin();
Expand Down
4 changes: 2 additions & 2 deletions Examples/DataRepresentation/Mesh/PointSetWithVectors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ main(int, char *[])

// Software Guide : BeginCodeSnippet
using PointDataIterator = PointSetType::PointDataContainer::ConstIterator;
PointDataIterator pixelIterator = pointSet->GetPointData()->Begin();
PointDataIterator pixelEnd = pointSet->GetPointData()->End();
PointDataIterator pixelIterator = pointSet->GetPointData()->Begin();
const PointDataIterator pixelEnd = pointSet->GetPointData()->End();

using PointIterator = PointSetType::PointsContainer::Iterator;
PointIterator pointIterator = pointSet->GetPoints()->Begin();
Expand Down
8 changes: 4 additions & 4 deletions Examples/DataRepresentation/Mesh/RGBPointSet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ main(int, char *[])

// Software Guide : BeginCodeSnippet
using PointIterator = PointSetType::PointsContainer::ConstIterator;
PointIterator pointIterator = pointSet->GetPoints()->Begin();
PointIterator pointEnd = pointSet->GetPoints()->End();
PointIterator pointIterator = pointSet->GetPoints()->Begin();
const PointIterator pointEnd = pointSet->GetPoints()->End();
while (pointIterator != pointEnd)
{
point = pointIterator.Value();
Expand Down Expand Up @@ -142,8 +142,8 @@ main(int, char *[])

// Software Guide : BeginCodeSnippet
using PointDataIterator = PointSetType::PointDataContainer::ConstIterator;
PointDataIterator pixelIterator = pointSet->GetPointData()->Begin();
PointDataIterator pixelEnd = pointSet->GetPointData()->End();
PointDataIterator pixelIterator = pointSet->GetPointData()->Begin();
const PointDataIterator pixelEnd = pointSet->GetPointData()->End();
while (pixelIterator != pixelEnd)
{
pixel = pixelIterator.Value();
Expand Down
4 changes: 2 additions & 2 deletions Examples/DataRepresentation/Path/PolyLineParametricPath1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ main(int argc, char * argv[])
}

// Software Guide : BeginCodeSnippet
ImageType::ConstPointer image = reader->GetOutput();
auto path = PathType::New();
const ImageType::ConstPointer image = reader->GetOutput();
auto path = PathType::New();

using ContinuousIndexType = PathType::ContinuousIndexType;
ContinuousIndexType cindex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,15 @@ main(int argc, char * argv[])
// DWMRI_gradient_0003:=0.110000 0.664000 0.740000
// ...
//
itk::MetaDataDictionary imgMetaDictionary = img->GetMetaDataDictionary();
const itk::MetaDataDictionary imgMetaDictionary =
img->GetMetaDataDictionary();
std::vector<std::string> imgMetaKeys = imgMetaDictionary.GetKeys();
std::vector<std::string>::const_iterator itKey = imgMetaKeys.begin();
std::string metaString;

TensorReconstructionImageFilterType::GradientDirectionType vect3d;
TensorReconstructionImageFilterType::GradientDirectionContainerType::Pointer
DiffusionVectors = TensorReconstructionImageFilterType::
const TensorReconstructionImageFilterType::GradientDirectionContainerType::
Pointer DiffusionVectors = TensorReconstructionImageFilterType::
GradientDirectionContainerType::New();


Expand Down
6 changes: 3 additions & 3 deletions Examples/Filtering/DigitallyReconstructedRadiograph1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ main(int argc, char * argv[])
const InputImageType::SpacingType spacing = image->GetSpacing();
std::cout << std::endl << "Input ";

InputImageType::RegionType region = image->GetBufferedRegion();
const InputImageType::RegionType region = image->GetBufferedRegion();
region.Print(std::cout);

std::cout << " Resolution: [";
Expand Down Expand Up @@ -540,8 +540,8 @@ main(int argc, char * argv[])
using InputImageRegionType = InputImageType::RegionType;
using InputImageSizeType = InputImageRegionType::SizeType;

InputImageRegionType imRegion = image->GetBufferedRegion();
InputImageSizeType imSize = imRegion.GetSize();
const InputImageRegionType imRegion = image->GetBufferedRegion();
InputImageSizeType imSize = imRegion.GetSize();

imOrigin[0] += imRes[0] * static_cast<double>(imSize[0]) / 2.0;
imOrigin[1] += imRes[1] * static_cast<double>(imSize[1]) / 2.0;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Filtering/GaussianBlurImageFunction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ main(int argc, char * argv[])

const ImageType * inputImage = reader->GetOutput();

ImageType::RegionType region = inputImage->GetBufferedRegion();
const ImageType::RegionType region = inputImage->GetBufferedRegion();

ConstIteratorType it(inputImage, region);

Expand Down
4 changes: 2 additions & 2 deletions Examples/Filtering/MathematicalMorphologyBinaryFilters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ main(int argc, char * argv[])
// Software Guide : BeginCodeSnippet
thresholder->SetInput(reader->GetOutput());

InputPixelType background = 0;
InputPixelType foreground = 255;
const InputPixelType background = 0;
const InputPixelType foreground = 255;

thresholder->SetOutsideValue(background);
thresholder->SetInsideValue(foreground);
Expand Down
Loading
Loading