Data Structure for Piece-Wise Linear Curve#

Synopsis#

A data structure for a piece-wise linear curve.

Results#

Output:

[0, 0]
[0, 1]
[0, 2]
[0, 3]
[0, 4]
[0, 5]
[0, 6]
[0, 7]
[0, 8]
[0, 9]
[0, 10]
[0, 11]
[0, 12]
[0, 13]
[0, 14]
[0, 15]
[0, 16]
[0, 17]
[0, 18]
[0, 19]

Code#

C++#

#include "itkPolyLineParametricPath.h"

int
main()
{
  using PathType = itk::PolyLineParametricPath<2>;

  auto path = PathType::New();
  path->Initialize();

  using ContinuousIndexType = PathType::ContinuousIndexType;

  // Create a line
  for (unsigned int i = 0; i < 20; ++i)
  {
    ContinuousIndexType cindex;
    cindex[0] = 0;
    cindex[1] = i;
    path->AddVertex(cindex);
  }

  const PathType::VertexListType * vertexList = path->GetVertexList();

  for (unsigned int i = 0; i < vertexList->Size(); ++i)
  {
    std::cout << vertexList->GetElement(i) << std::endl;
  }

  return EXIT_SUCCESS;
}

Classes demonstrated#

template<unsigned int VDimension>
class PolyLineParametricPath : public itk::ParametricPath<VDimension>

Represent a path of line segments through ND Space.

This class is intended to represent parametric paths through an image, where the paths are composed of line segments. Each line segment traverses one unit of input. A classic application of this class is the representation of contours in 2D images, especially when the contours only need to be approximately correct. Another use of a path is to guide the movement of an iterator through an image.

See

EllipseParametricPath

See

FourierSeriesPath

See

OrthogonallyCorrectedParametricPath

See

ParametricPath

See

ChainCodePath

See

Path

See

ContinuousIndex

See

Index

See

Offset

See

Vector

ITK Sphinx Examples:

See itk::PolyLineParametricPath for additional documentation.