NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
itk::OrthogonalContourExtractor2DImageFilter< TInputImage > Class Template Reference

Computes a list of PolyLineParametricPath objects from the contours in a 2D image. More...

Inheritance diagram for itk::OrthogonalContourExtractor2DImageFilter< TInputImage >:
Inheritance graph
[legend]
Collaboration diagram for itk::OrthogonalContourExtractor2DImageFilter< TInputImage >:
Collaboration graph
[legend]

Public Types

typedef TInputImage InputImageType
 
typedef PolyLineParametricPath< 2 > OutputPathType
 
typedef
OrthogonalContourExtractor2DImageFilter 
Self
 
typedef ImageToPathFilter
< InputImageType,
OutputPathType
Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef InputImageType::Pointer InputImagePointer
 
typedef InputImageType::PixelType InputPixelType
 
typedef InputImageType::IndexType InputIndexType
 
typedef InputImageType::OffsetType InputOffsetType
 
typedef InputImageType::RegionType InputRegionType
 
typedef OutputPathType::Pointer OutputPathPointer
 
typedef OutputPathType::VertexType VertexType
 
typedef
OutputPathType::VertexListType 
VertexListType
 
typedef NumericTraits
< InputPixelType >::RealType 
InputRealType
 
typedef
VertexListType::ConstPointer 
VertexListConstPointer
 

Public Member Functions

 itkStaticConstMacro (InputImageDimension, unsigned int, TInputImage::ImageDimension)
 
virtual const char * GetClassName () const
 
virtual void SetReverseContourOrientation (bool _arg)
 
virtual const bool & GetReverseContourOrientation ()
 
virtual void ReverseContourOrientationOn ()
 
virtual void ReverseContourOrientationOff ()
 
virtual void SetVertexConnectHighPixels (bool _arg)
 
virtual const bool & GetVertexConnectHighPixels ()
 
virtual void VertexConnectHighPixelsOn ()
 
virtual void VertexConnectHighPixelsOff ()
 
void SetRequestedRegion (const InputRegionType region)
 
virtual const InputRegionTypeGetRequestedRegion ()
 
void ClearRequestedRegion ()
 
virtual void SetContourValue (InputRealType _arg)
 
virtual const InputRealTypeGetContourValue ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 OrthogonalContourExtractor2DImageFilter ()
 
virtual ~OrthogonalContourExtractor2DImageFilter ()
 
void PrintSelf (std::ostream &os, Indent indent) const
 
void GenerateData ()
 
virtual void GenerateInputRequestedRegion () throw (InvalidRequestedRegionError)
 

Detailed Description

template<class TInputImage>
class itk::OrthogonalContourExtractor2DImageFilter< TInputImage >

Computes a list of PolyLineParametricPath objects from the contours in a 2D image.

Uses the "marching squares" method to compute a the iso-valued contours of the input 2D image for a given intensity value. Multiple outputs may be produced because an image can have multiple contours at a given level, so it is advised to call GetNumberOfOutputs() and GetOutput(n) to retrieve all of the contours. The contour value to be extracted can be set with SetContourValue(). Image intensities will be linearly interpolated to provide sub-pixel resolution for the output contours.

The marching squares algorithm is a special case of the marching cubes algorithm (Lorensen, William and Harvey E. Cline. Marching Cubes: A High Resolution 3D Surface Construction Algorithm. Computer Graphics (SIGGRAPH 87 Proceedings) 21(4) July 1987, p. 163-170). A simple explanation is available here: http://www.essi.fr/~lingrand/MarchingCubes/algo.html

There is a single ambiguous case in the marching squares algorithm: if a given 2x2-pixel square has two high-valued and two low-valued pixels, each pair diagonally adjacent. (Where high- and low-valued is with respect to the contour value sought.) In this case, either the high-valued pixels can be connected into the same "object" (where groups of pixels encircled by a given contour are considered an object), or the low-valued pixels can be connected. This is the "face connected" versus "face + vertex connected" (or 4- versus 4-connected) distinction: high-valued pixels most be treated as one, and low-valued as the other. By default, high-valued pixels are treated as "face-connected" and low-valued pixels are treated as "face + vertex" connected. To reverse this, call VertexConnectHighPixelsOn();

Outputs are not guaranteed to be closed paths: contours which intersect the image edge will be left open. All other paths will be closed. (The closed-ness of a path can be tested by checking whether the beginning point is the same as the end point.)

Produced paths are oriented. Following the path from beginning to end, image intensity values lower than the contour value are to the left of the path and intensity values grater than the contour value are to the right. In other words, the image gradient at a path segment is (approximately) in the direct of that segment rotated right by 90 degrees, because the image intensity values increase from left-to-right across the segment. This means that the generated contours will circle clockwise around "hills" of above-contour-value intensity, and counter-clockwise around "depressions" of below-contour-value intensity. This convention can be reversed by calling ReverseContourOrientationOn().

By default the input image's largest possible region will be processed; call SetRequestedRegion() to process a different region, or ClearRequestedRegion() to revert to the default value. Note that the requested regions are usually set on the output; however since paths have no notion of a "region", this must be set at the filter level.

This class was contributed to the Insight Journal by Zachary Pincus. http://insight-journal.org/midas/handle.php?handle=1926/165

See also
Image
Path
PolyLineParametricPath

Member Typedef Documentation

template<class TInputImage >
typedef SmartPointer<const Self> itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::ConstPointer
template<class TInputImage >
typedef InputImageType::Pointer itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::InputImagePointer

Image and path typedef support.

template<class TInputImage >
typedef TInputImage itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::InputImageType

Convenient typedefs for simplifying declarations.

template<class TInputImage >
typedef InputImageType::IndexType itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::InputIndexType
template<class TInputImage >
typedef InputImageType::OffsetType itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::InputOffsetType
template<class TInputImage >
typedef InputImageType::PixelType itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::InputPixelType
template<class TInputImage >
typedef NumericTraits<InputPixelType>::RealType itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::InputRealType

Real type associated to the input pixel type.

template<class TInputImage >
typedef InputImageType::RegionType itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::InputRegionType
template<class TInputImage >
typedef OutputPathType::Pointer itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::OutputPathPointer
template<class TInputImage >
typedef PolyLineParametricPath<2> itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::OutputPathType
template<class TInputImage >
typedef SmartPointer<Self> itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::Pointer

Standard class typedefs.

template<class TInputImage >
typedef ImageToPathFilter<InputImageType, OutputPathType> itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::Superclass
template<class TInputImage >
typedef VertexListType::ConstPointer itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::VertexListConstPointer
template<class TInputImage >
typedef OutputPathType::VertexListType itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::VertexListType
template<class TInputImage >
typedef OutputPathType::VertexType itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::VertexType

Constructor & Destructor Documentation

template<class TInputImage >
itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::OrthogonalContourExtractor2DImageFilter ( )
protected
template<class TInputImage >
virtual itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::~OrthogonalContourExtractor2DImageFilter ( )
protectedvirtual

Member Function Documentation

template<class TInputImage >
void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::ClearRequestedRegion ( )
template<class TInputImage >
void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::GenerateData ( )
protected
template<class TInputImage >
virtual void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::GenerateInputRequestedRegion ( )
throw (InvalidRequestedRegionError
)
protectedvirtual

OrthogonalContourExtractor2DImageFilter manually controls the input requested region via SetRequestedRegion and ClearRequestedRegion, so it must override the superclass method.

template<class TInputImage >
virtual const char* itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

template<class TInputImage >
virtual const InputRealType& itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::GetContourValue ( )
virtual
template<class TInputImage >
virtual const InputRegionType& itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::GetRequestedRegion ( )
virtual
template<class TInputImage >
virtual const bool& itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::GetReverseContourOrientation ( )
virtual
template<class TInputImage >
virtual const bool& itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::GetVertexConnectHighPixels ( )
virtual
template<class TInputImage >
itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::itkStaticConstMacro ( InputImageDimension  ,
unsigned  int,
TInputImage::ImageDimension   
)

Extract dimension from input and output image.

template<class TInputImage >
static Pointer itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::New ( )
static

Method for creation through the object factory.

template<class TInputImage >
void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protected
template<class TInputImage >
virtual void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::ReverseContourOrientationOff ( )
virtual
template<class TInputImage >
virtual void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::ReverseContourOrientationOn ( )
virtual
template<class TInputImage >
virtual void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::SetContourValue ( InputRealType  _arg)
virtual

Set/Get the image intensity value that the contours should follow. This is the equivalent of an iso-value in Marching Squares.

template<class TInputImage >
void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::SetRequestedRegion ( const InputRegionType  region)

Control whether the largest possible input region is used, or if a custom requested region is to be used.

template<class TInputImage >
virtual void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::SetReverseContourOrientation ( bool  _arg)
virtual

Control the orientation of the contours with reference to the image gradient. (See class documentation.)

template<class TInputImage >
virtual void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::SetVertexConnectHighPixels ( bool  _arg)
virtual

Control whether high- or low-valued pixels are vertex-connected. Default is for low-valued pixels to be vertex-connected. (See class documentation.)

template<class TInputImage >
virtual void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::VertexConnectHighPixelsOff ( )
virtual
template<class TInputImage >
virtual void itk::OrthogonalContourExtractor2DImageFilter< TInputImage >::VertexConnectHighPixelsOn ( )
virtual

The documentation for this class was generated from the following file: