int
main(int argc, char * argv[])
{
if (argc < 3)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " inputImageFile outputImageFile" << std::endl;
return EXIT_FAILURE;
}
using PixelComponentType = unsigned char;
reader->SetFileName(argv[1]);
writer->SetFileName(argv[2]);
using InterpolatorType =
filter->SetInterpolator(interpolator);
filter->SetTransform(transform);
auto defaultValue = itk::MakeFilled<PixelType>(50);
filter->SetDefaultPixelValue(defaultValue);
ImageType::SpacingType spacing;
spacing[0] = .5;
spacing[1] = .5;
filter->SetOutputSpacing(spacing);
origin[0] = 30.0;
origin[1] = 40.0;
filter->SetOutputOrigin(origin);
filter->SetOutputDirection(direction);
size[0] = 300;
size[1] = 300;
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->GetOutput());
try
{
writer->Update();
}
{
std::cerr << "Exception thrown " << std::endl;
std::cerr << excp << std::endl;
}
return EXIT_SUCCESS;
}
Standard exception handling object.
Data source that reads image data from a single file.
Writes image data to a single file.
Templated n-dimensional image class.
Linearly interpolate an image at specified positions.
Represent Red, Green and Blue components for color images.
Resample an image via a coordinate transform.
ImageBaseType::DirectionType DirectionType
constexpr unsigned int Dimension
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
void SetSize(const SizeValueType val[VDimension])