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
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
#include <fstream>
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkTestingMacros.h"


int
itkSymmetricSecondRankTensorImageReadTest(int ac, char * av[])
itkSymmetricSecondRankTensorImageReadTest(int argc, char * argv[])
{
if (ac < 1)
if (argc < 1)
{
std::cerr << "Usage: " << av[0] << " Input\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " Input\n";
return EXIT_FAILURE;
}

Expand Down Expand Up @@ -84,8 +85,8 @@ itkSymmetricSecondRankTensorImageReadTest(int ac, char * av[])

try
{
itk::WriteImage(matrixImage, av[1]);
const TensorImageType::ConstPointer tensorImage = itk::ReadImage<TensorImageType>(av[1]);
itk::WriteImage(matrixImage, argv[1]);
const TensorImageType::ConstPointer tensorImage = itk::ReadImage<TensorImageType>(argv[1]);

// Compare the read values to the original values
const float tolerance = 1e-5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
#include <fstream>
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkTestingMacros.h"


// Write a 2D SymmetricSecondRankTensor image to file and read it back again.
int
itkSymmetricSecondRankTensorImageWriteReadTest(int ac, char * av[])
itkSymmetricSecondRankTensorImageWriteReadTest(int argc, char * argv[])
{
if (ac < 1)
if (argc < 1)
{
std::cerr << "Usage: " << av[0] << " Input\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " Input\n";
return EXIT_FAILURE;
}

Expand Down Expand Up @@ -69,8 +70,8 @@ itkSymmetricSecondRankTensorImageWriteReadTest(int ac, char * av[])

try
{
itk::WriteImage(tensorImageInput, av[1]);
const TensorImageType::ConstPointer tensorImageOutput = itk::ReadImage<TensorImageType>(av[1]);
itk::WriteImage(tensorImageInput, argv[1]);
const TensorImageType::ConstPointer tensorImageOutput = itk::ReadImage<TensorImageType>(argv[1]);

// Compare the read values to the original values
const float tolerance = 1e-5;
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Mesh/test/itkVTKPolyDataReaderTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*=========================================================================*/

#include "itkVTKPolyDataReader.h"
#include "itkTestingMacros.h"

#include <iostream>

Expand All @@ -25,7 +26,7 @@ itkVTKPolyDataReaderTest(int argc, char * argv[])
{
if (argc != 2)
{
std::cerr << "Usage: itkVTKPolyDataReaderTest inputFilename" << std::endl;
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " inputFilename" << std::endl;
return EXIT_FAILURE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "itkQuadEdgeMesh.h"
#include "itkVTKPolyDataReader.h"
#include "itkVTKPolyDataWriter.h"
#include "itkTestingMacros.h"

#include <iostream>

Expand All @@ -35,7 +36,7 @@ itkVTKPolyDataIOQuadEdgeMeshTest(int argc, char * argv[])

if (argc != 3)
{
std::cerr << "Usage: itkVTKPolyDataReaderTest inputFilename outputFilename" << std::endl;
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " inputFilename outputFilename" << std::endl;
return EXIT_FAILURE;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "itkQuadEdgeMesh.h"
#include "itkVTKPolyDataReader.h"
#include "itkTestingMacros.h"

#include <iostream>

Expand All @@ -26,7 +27,7 @@ itkVTKPolyDataReaderQuadEdgeMeshTest(int argc, char * argv[])
{
if (argc != 2)
{
std::cerr << "Usage: itkVTKPolyDataReaderTest inputFilename" << std::endl;
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " inputFilename" << std::endl;
return EXIT_FAILURE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "itkImageFileWriter.h"
#include "itkChangeInformationImageFilter.h"
#include "itkTestingComparisonImageFilter.h"
#include "itkTestingMacros.h"
#include <fstream>

using PixelType = float;
Expand Down Expand Up @@ -68,7 +69,7 @@ itkGradientAnisotropicDiffusionImageFilterTest2(int ac, char * av[])
{
if (ac < 3)
{
std::cerr << "Usage: " << av[0] << " InputImage OutputImage\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(av) << " InputImage OutputImage\n";
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkSimpleFilterWatcher.h"
#include "itkTestingMacros.h"

int
itkNormalizedCorrelationImageFilterTest(int ac, char * av[])
itkNormalizedCorrelationImageFilterTest(int argc, char * argv[])
{
if (ac < 4)
if (argc < 4)
{
std::cerr << "Usage: " << av[0] << " InputImage MaskImage OutputImage\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " InputImage MaskImage OutputImage\n";
return -1;
}

Expand All @@ -43,7 +44,7 @@ itkNormalizedCorrelationImageFilterTest(int ac, char * av[])
using CorrelationImageType = itk::Image<CorrelationPixelType, Dimension>;

itk::ImageFileReader<InputImageType>::Pointer input = itk::ImageFileReader<InputImageType>::New();
input->SetFileName(av[1]);
input->SetFileName(argv[1]);
input->Update();

// define an operator
Expand All @@ -57,7 +58,7 @@ itkNormalizedCorrelationImageFilterTest(int ac, char * av[])

// create a mask
itk::ImageFileReader<InputImageType>::Pointer mask = itk::ImageFileReader<InputImageType>::New();
mask->SetFileName(av[2]);
mask->SetFileName(argv[2]);

// resample the mask to be the size of the input
using InterpolatorType = itk::NearestNeighborInterpolateImageFunction<InputImageType>;
Expand Down Expand Up @@ -96,7 +97,7 @@ itkNormalizedCorrelationImageFilterTest(int ac, char * av[])
itk::ImageFileWriter<InputImageType>::Pointer writer;
writer = itk::ImageFileWriter<InputImageType>::New();
writer->SetInput(threshold->GetOutput());
writer->SetFileName(av[3]);
writer->SetFileName(argv[3]);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkSimpleFilterWatcher.h"
#include "itkTestingMacros.h"

int
itkBilateralImageFilterTest2(int ac, char * av[])
{
if (ac < 3)
{
std::cerr << "Usage: " << av[0] << " InputImage OutputImage\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(av) << " InputImage OutputImage\n";
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
#include "itkBilateralImageFilter.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkTestingMacros.h"


int
itkBilateralImageFilterTest3(int ac, char * av[])
{
if (ac < 3)
{
std::cerr << "Usage: " << av[0] << " InputImage BaselineImage\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(av) << " InputImage BaselineImage\n";
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
#include "itkTestingMacros.h"

int
itkMaskNeighborhoodOperatorImageFilterTest(int ac, char * av[])
itkMaskNeighborhoodOperatorImageFilterTest(int argc, char * argv[])
{
if (ac < 3)
if (argc < 3)
{
std::cerr << "Usage: " << av[0] << " InputImage OutputImage\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " InputImage OutputImage\n";
return -1;
}

Expand All @@ -41,7 +41,7 @@ itkMaskNeighborhoodOperatorImageFilterTest(int ac, char * av[])
using OutputImageType = itk::Image<OutputPixelType, Dimension>;

itk::ImageFileReader<InputImageType>::Pointer input = itk::ImageFileReader<InputImageType>::New();
input->SetFileName(av[1]);
input->SetFileName(argv[1]);
input->Update();

// create a mask the size of the input file
Expand Down Expand Up @@ -126,7 +126,7 @@ itkMaskNeighborhoodOperatorImageFilterTest(int ac, char * av[])
// Generate test image
itk::ImageFileWriter<OutputImageType>::Pointer writer = itk::ImageFileWriter<OutputImageType>::New();
writer->SetInput(rescaler->GetOutput());
writer->SetFileName(av[2]);
writer->SetFileName(argv[2]);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ itkVectorGradientMagnitudeImageFilterTest2(int ac, char * av[])

if (ac < 5)
{
std::cerr << "Usage: " << av[0] << " InputImage OutputImage Mode SliceToExtract\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(av) << " InputImage OutputImage Mode SliceToExtract\n";
return EXIT_FAILURE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ itkVectorGradientMagnitudeImageFilterTest3(int ac, char * av[])

if (ac < 4)
{
std::cerr << "Usage: " << av[0] << " InputImage OutputImage Mode\n";
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(av) << " InputImage OutputImage Mode\n";
return EXIT_FAILURE;
}

Expand Down
15 changes: 8 additions & 7 deletions Modules/Filtering/ImageGrid/test/itkOrientedImage2DTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@

#include "itkImageFileReader.h"
#include "itkCentralDifferenceImageFunction.h"
#include "itkTestingMacros.h"

int
itkOrientedImage2DTest(int ac, char * av[])
itkOrientedImage2DTest(int argc, char * argv[])
{

if (ac < 12)
if (argc < 12)
{
std::cerr << "Usage: " << av[0] << " InputImage "
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " InputImage "
<< "corner1x corner1y "
<< "corner2x corner2y "
<< "corner3x corner3y "
Expand All @@ -46,7 +47,7 @@ itkOrientedImage2DTest(int ac, char * av[])

auto reader = ReaderType::New();

reader->SetFileName(av[1]);
reader->SetFileName(argv[1]);

try
{
Expand Down Expand Up @@ -97,7 +98,7 @@ itkOrientedImage2DTest(int ac, char * av[])

for (unsigned int dim = 0; dim < Dimension; ++dim)
{
const double expectedValue = std::stod(av[element++]);
const double expectedValue = std::stod(argv[element++]);
const double currentValue = physicalPoint[dim];
const double difference = currentValue - expectedValue;
if (itk::Math::abs(difference) > tolerance)
Expand Down Expand Up @@ -140,7 +141,7 @@ itkOrientedImage2DTest(int ac, char * av[])

for (unsigned int dim = 0; dim < Dimension; ++dim)
{
const double expectedValue = std::stod(av[element++]);
const double expectedValue = std::stod(argv[element++]);
const double currentValue = gradient1a[dim];
const double difference = currentValue - expectedValue;
if (itk::Math::abs(difference) > tolerance)
Expand All @@ -165,7 +166,7 @@ itkOrientedImage2DTest(int ac, char * av[])

for (unsigned int dim = 0; dim < Dimension; ++dim)
{
const double expectedValue = std::stod(av[element++]);
const double expectedValue = std::stod(argv[element++]);
const double currentValue = gradient1b[dim];
const double difference = currentValue - expectedValue;
if (itk::Math::abs(difference) > tolerance)
Expand Down
15 changes: 8 additions & 7 deletions Modules/Filtering/ImageGrid/test/itkOrientedImage3DTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@

#include "itkImageFileReader.h"
#include "itkCentralDifferenceImageFunction.h"
#include "itkTestingMacros.h"

int
itkOrientedImage3DTest(int ac, char * av[])
itkOrientedImage3DTest(int argc, char * argv[])
{

if (ac < 20)
if (argc < 20)
{
std::cerr << "Usage: " << av[0] << " InputImage "
std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << " InputImage "
<< "corner1x corner1y corner1z "
<< "corner2x corner2y corner2z "
<< "corner3x corner3y corner3z "
Expand All @@ -46,7 +47,7 @@ itkOrientedImage3DTest(int ac, char * av[])

auto reader = ReaderType::New();

reader->SetFileName(av[1]);
reader->SetFileName(argv[1]);

try
{
Expand Down Expand Up @@ -105,7 +106,7 @@ itkOrientedImage3DTest(int ac, char * av[])

for (unsigned int dim = 0; dim < Dimension; ++dim)
{
const double expectedValue = std::stod(av[element++]);
const double expectedValue = std::stod(argv[element++]);
const double currentValue = physicalPoint[dim];
const double difference = currentValue - expectedValue;
if (itk::Math::abs(difference) > tolerance)
Expand Down Expand Up @@ -148,7 +149,7 @@ itkOrientedImage3DTest(int ac, char * av[])

for (unsigned int dim = 0; dim < Dimension; ++dim)
{
const double expectedValue = std::stod(av[element++]);
const double expectedValue = std::stod(argv[element++]);
const double currentValue = gradient1a[dim];
const double difference = currentValue - expectedValue;
if (itk::Math::abs(difference) > tolerance)
Expand All @@ -173,7 +174,7 @@ itkOrientedImage3DTest(int ac, char * av[])

for (unsigned int dim = 0; dim < Dimension; ++dim)
{
const double expectedValue = std::stod(av[element++]);
const double expectedValue = std::stod(argv[element++]);
const double currentValue = gradient1b[dim];
const double difference = currentValue - expectedValue;
if (itk::Math::abs(difference) > tolerance)
Expand Down
Loading