int
main(int argc, char * argv[])
{
if (argc < 2)
{
std::cerr << "Missing arguments" << std::endl;
std::cerr << "Usage: PolyLineParametricPath inputImageFileName"
<< std::endl;
return EXIT_FAILURE;
}
reader->SetFileName(argv[1]);
try
{
reader->Update();
}
{
std::cout << "Problem reading the input image " << std::endl;
std::cout << excp << std::endl;
return EXIT_FAILURE;
}
using ContinuousIndexType = PathType::ContinuousIndexType;
ContinuousIndexType cindex;
ImagePointType origin = image->GetOrigin();
ImageType::SpacingType spacing = image->GetSpacing();
point[0] = origin[0] + spacing[0] * size[0];
point[1] = origin[1] + spacing[1] * size[1];
using ContinuousIndexValueType = ContinuousIndexType::ValueType;
cindex =
image->TransformPhysicalPointToContinuousIndex<ContinuousIndexValueType>(
origin);
path->AddVertex(cindex);
cindex =
image->TransformPhysicalPointToContinuousIndex<ContinuousIndexValueType>(
path->AddVertex(cindex);
return EXIT_SUCCESS;
}
Standard exception handling object.
Data source that reads image data from a single file.
Templated n-dimensional image class.
Represent a path of line segments through ND Space.
SmartPointer< const Self > ConstPointer
constexpr unsigned int Dimension
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
const SizeValueType * GetSize() const