Medical Imaging Interaction Toolkit
2024.06.99-e7b2963f
Medical Imaging Interaction Toolkit
|
Computes a list of PolyLineParametricPath objects from the contours in a 2D image. More...
#include <itkContourExtractor2DImageFilter.h>
Public Types | |
typedef TInputImage | InputImageType |
typedef PolyLineParametricPath< 2 > | OutputPathType |
typedef ContourExtractor2DImageFilter | Self |
typedef ImageToPathFilter< InputImageType, OutputPathType > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
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 Types inherited from itk::ImageToPathFilter< TInputImage, PolyLineParametricPath< 2 > > | |
typedef ImageToPathFilter | Self |
typedef PathSource< PolyLineParametricPath< 2 > > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef TInputImage | InputImageType |
typedef InputImageType::Pointer | InputImagePointer |
typedef InputImageType::ConstPointer | InputImageConstPointer |
typedef InputImageType::RegionType | InputImageRegionType |
typedef InputImageType::PixelType | InputImagePixelType |
Public Member Functions | |
itkStaticConstMacro (InputImageDimension, unsigned int, TInputImage::ImageDimension) | |
Pointer | Clone () const |
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 InputRegionType & | GetRequestedRegion () |
void | ClearRequestedRegion () |
virtual void | SetContourValue (InputRealType _arg) |
virtual const InputRealType & | GetContourValue () |
Public Member Functions inherited from itk::ImageToPathFilter< TInputImage, PolyLineParametricPath< 2 > > | |
virtual const char * | GetClassName () const |
itkStaticConstMacro (InputImageDimension, unsigned int, TInputImage::ImageDimension) | |
virtual void | SetInput (const InputImageType *image) |
virtual void | SetInput (unsigned int, const TInputImage *image) |
const InputImageType * | GetInput (void) |
const InputImageType * | GetInput (unsigned int idx) |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
ContourExtractor2DImageFilter () | |
~ContourExtractor2DImageFilter () override | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
void | GenerateData () override |
void | GenerateInputRequestedRegion () override |
Protected Member Functions inherited from itk::ImageToPathFilter< TInputImage, PolyLineParametricPath< 2 > > | |
ImageToPathFilter () | |
~ImageToPathFilter () override | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
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).
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.
Definition at line 91 of file itkContourExtractor2DImageFilter.h.
typedef SmartPointer<const Self> itk::ContourExtractor2DImageFilter< TInputImage >::ConstPointer |
Definition at line 105 of file itkContourExtractor2DImageFilter.h.
typedef InputImageType::Pointer itk::ContourExtractor2DImageFilter< TInputImage >::InputImagePointer |
Image and path typedef support.
Definition at line 112 of file itkContourExtractor2DImageFilter.h.
typedef TInputImage itk::ContourExtractor2DImageFilter< TInputImage >::InputImageType |
Convenient typedefs for simplifying declarations.
Definition at line 98 of file itkContourExtractor2DImageFilter.h.
typedef InputImageType::IndexType itk::ContourExtractor2DImageFilter< TInputImage >::InputIndexType |
Definition at line 117 of file itkContourExtractor2DImageFilter.h.
typedef InputImageType::OffsetType itk::ContourExtractor2DImageFilter< TInputImage >::InputOffsetType |
Definition at line 118 of file itkContourExtractor2DImageFilter.h.
typedef InputImageType::PixelType itk::ContourExtractor2DImageFilter< TInputImage >::InputPixelType |
Definition at line 116 of file itkContourExtractor2DImageFilter.h.
typedef NumericTraits<InputPixelType>::RealType itk::ContourExtractor2DImageFilter< TInputImage >::InputRealType |
Real type associated to the input pixel type.
Definition at line 125 of file itkContourExtractor2DImageFilter.h.
typedef InputImageType::RegionType itk::ContourExtractor2DImageFilter< TInputImage >::InputRegionType |
Definition at line 119 of file itkContourExtractor2DImageFilter.h.
typedef OutputPathType::Pointer itk::ContourExtractor2DImageFilter< TInputImage >::OutputPathPointer |
Definition at line 120 of file itkContourExtractor2DImageFilter.h.
typedef PolyLineParametricPath<2> itk::ContourExtractor2DImageFilter< TInputImage >::OutputPathType |
Definition at line 99 of file itkContourExtractor2DImageFilter.h.
typedef SmartPointer<Self> itk::ContourExtractor2DImageFilter< TInputImage >::Pointer |
Definition at line 104 of file itkContourExtractor2DImageFilter.h.
typedef ContourExtractor2DImageFilter itk::ContourExtractor2DImageFilter< TInputImage >::Self |
Standard class typedefs.
Definition at line 102 of file itkContourExtractor2DImageFilter.h.
typedef ImageToPathFilter<InputImageType, OutputPathType> itk::ContourExtractor2DImageFilter< TInputImage >::Superclass |
Definition at line 103 of file itkContourExtractor2DImageFilter.h.
typedef VertexListType::ConstPointer itk::ContourExtractor2DImageFilter< TInputImage >::VertexListConstPointer |
Definition at line 127 of file itkContourExtractor2DImageFilter.h.
typedef OutputPathType::VertexListType itk::ContourExtractor2DImageFilter< TInputImage >::VertexListType |
Definition at line 122 of file itkContourExtractor2DImageFilter.h.
typedef OutputPathType::VertexType itk::ContourExtractor2DImageFilter< TInputImage >::VertexType |
Definition at line 121 of file itkContourExtractor2DImageFilter.h.
|
protected |
|
overrideprotected |
void itk::ContourExtractor2DImageFilter< TInputImage >::ClearRequestedRegion | ( | ) |
Pointer itk::ContourExtractor2DImageFilter< TInputImage >::Clone | ( | ) | const |
|
overrideprotected |
|
overrideprotected |
ContourExtractor2DImageFilter manually controls the input requested region via SetRequestedRegion and ClearRequestedRegion, so it must override the superclass method.
|
virtual |
Run-time type information (and related methods).
|
virtual |
|
virtual |
|
virtual |
|
virtual |
itk::ContourExtractor2DImageFilter< TInputImage >::itkStaticConstMacro | ( | InputImageDimension | , |
unsigned int | , | ||
TInputImage::ImageDimension | |||
) |
Extract dimension from input and output image.
|
static |
Method for creation through the object factory.
|
overrideprotected |
|
virtual |
|
virtual |
|
virtual |
Set/Get the image intensity value that the contours should follow. This is the equivalent of an iso-value in Marching Squares.
void itk::ContourExtractor2DImageFilter< TInputImage >::SetRequestedRegion | ( | const InputRegionType | region | ) |
Control whether the largest possible input region is used, or if a custom requested region is to be used.
|
virtual |
Control the orientation of the contours with reference to the image gradient. (See class documentation.)
|
virtual |
Control whether high- or low-valued pixels are vertex-connected. Default is for low-valued pixels to be vertex-connected. (See class documentation.)
|
virtual |
|
virtual |