|
static constexpr unsigned int | InputImageDimension { TInputImage::ImageDimension } |
|
static constexpr unsigned int | InputImageDimension |
|
using | LabelsContainer = std::vector< InputPixelType > |
|
using | LabelsConstIterator = typename LabelsContainer::const_iterator |
|
using | LabelsIterator = typename LabelsContainer::iterator |
|
using | ContourConstIterator = typename ContourType::const_iterator |
|
using | ContourContainerType = std::list< ContourType > |
|
using | ContourContainerIterator = typename ContourContainerType::iterator |
|
using | ContourContainerConstIterator = typename ContourContainerType::const_iterator |
|
using | VertexToContourContainerIteratorMap = std::unordered_map< VertexType, ContourContainerIterator, VertexHash > |
|
using | VertexToContourContainerIteratorMapIterator = typename VertexToContourContainerIteratorMap::iterator |
|
using | VertexToContourContainerIteratorMapConstIterator = typename VertexToContourContainerIteratorMap::const_iterator |
|
using | VertexToContourContainerIteratorMapKeyValuePair = typename VertexToContourContainerIteratorMap::value_type |
|
InputRealType | m_ContourValue |
|
bool | m_ReverseContourOrientation |
|
bool | m_VertexConnectHighPixels |
|
bool | m_LabelContours |
|
bool | m_UseCustomRegion |
|
InputRegionType | m_RequestedRegion |
|
InputPixelType | m_UnusedLabel |
|
virtual void | SetReverseContourOrientation (bool _arg) |
|
virtual const bool & | GetReverseContourOrientation () const |
|
virtual void | ReverseContourOrientationOn () |
|
virtual void | ReverseContourOrientationOff () |
|
virtual void | SetVertexConnectHighPixels (bool _arg) |
|
virtual const bool & | GetVertexConnectHighPixels () const |
|
virtual void | VertexConnectHighPixelsOn () |
|
virtual void | VertexConnectHighPixelsOff () |
|
virtual void | SetLabelContours (bool _arg) |
|
virtual const bool & | GetLabelContours () const |
|
virtual void | LabelContoursOn () |
|
virtual void | LabelContoursOff () |
|
void | SetRequestedRegion (const InputRegionType region) |
|
virtual const InputRegionType & | GetRequestedRegion () const |
|
void | ClearRequestedRegion () |
|
virtual void | SetContourValue (InputRealType _arg) |
|
virtual const InputRealType & | GetContourValue () const |
|
| ContourExtractor2DImageFilter () |
|
| ~ContourExtractor2DImageFilter () override=default |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
void | GenerateData () override |
|
void | GenerateInputRequestedRegion () override |
|
void | CreateSingleContour (InputPixelType label, const InputImageType *input, const InputRegionType extendedRegion, SizeValueType totalNumberOfPixels, ContourContainerType &contoursOutput) |
|
void | GenerateDataForLabels () |
|
VertexType | InterpolateContourPosition (InputPixelType fromValue, InputPixelType toValue, InputIndexType fromIndex, InputOffsetType toOffset) |
|
void | AddSegment (const VertexType from, const VertexType to, ContourData &contourData) |
|
void | FillOutputs (const std::vector< InputPixelType > &allLabels, std::unordered_map< InputPixelType, ContourContainerType > &labelsContoursOutput) |
|
|
| ImageToPathFilter () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ~ImageToPathFilter () override=default |
|
| PathSource () |
|
| ~PathSource () override=default |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ProcessObject () |
|
| ~ProcessObject () override |
|
DataObject * | GetInput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetInput (const DataObjectIdentifierType &key) const |
|
DataObject * | GetInput (DataObjectPointerArraySizeType idx) |
|
const DataObject * | GetInput (DataObjectPointerArraySizeType idx) const |
|
virtual void | SetInput (const DataObjectIdentifierType &key, DataObject *input) |
|
virtual void | SetNthInput (DataObjectPointerArraySizeType idx, DataObject *input) |
|
virtual void | AddInput (DataObject *input) |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PopBackInput () |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | PopFrontInput () |
|
virtual void | RemoveInput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveInput (DataObjectPointerArraySizeType) |
|
DataObject * | GetPrimaryInput () |
|
const DataObject * | GetPrimaryInput () const |
|
virtual void | SetPrimaryInputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryInputName () const |
|
virtual void | SetPrimaryInput (DataObject *object) |
|
void | SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num) |
|
virtual void | SetNumberOfRequiredInputs (DataObjectPointerArraySizeType) |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredInputs () const |
|
bool | RemoveRequiredInputName (const DataObjectIdentifierType &) |
|
bool | IsRequiredInputName (const DataObjectIdentifierType &) const |
|
void | SetRequiredInputNames (const NameArray &) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
DataObject * | GetOutput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetOutput (const DataObjectIdentifierType &key) const |
|
virtual void | SetPrimaryOutputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryOutputName () const |
|
DataObject * | GetOutput (DataObjectPointerArraySizeType i) |
|
const DataObject * | GetOutput (DataObjectPointerArraySizeType i) const |
|
virtual void | SetOutput (const DataObjectIdentifierType &name, DataObject *output) |
|
virtual void | RemoveOutput (const DataObjectIdentifierType &key) |
|
DataObject * | GetPrimaryOutput () |
|
const DataObject * | GetPrimaryOutput () const |
|
virtual void | SetPrimaryOutput (DataObject *object) |
|
virtual void | SetNthOutput (DataObjectPointerArraySizeType idx, DataObject *output) |
|
virtual void | AddOutput (DataObject *output) |
|
virtual void | RemoveOutput (DataObjectPointerArraySizeType idx) |
|
virtual void | SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg) |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredOutputs () const |
|
void | SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num) |
|
DataObjectIdentifierType | MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const |
|
DataObjectIdentifierType | MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const |
|
DataObjectPointerArraySizeType | MakeIndexFromInputName (const DataObjectIdentifierType &name) const |
|
DataObjectPointerArraySizeType | MakeIndexFromOutputName (const DataObjectIdentifierType &name) const |
|
bool | IsIndexedInputName (const DataObjectIdentifierType &) const |
|
bool | IsIndexedOutputName (const DataObjectIdentifierType &) const |
|
virtual void | VerifyPreconditions () ITKv5_CONST |
|
virtual void | VerifyInputInformation () ITKv5_CONST |
|
virtual void | GenerateOutputRequestedRegion (DataObject *output) |
|
virtual void | GenerateOutputInformation () |
|
virtual void | PropagateResetPipeline () |
|
virtual void | ReleaseInputs () |
|
virtual void | CacheInputReleaseDataFlags () |
|
virtual void | RestoreInputReleaseDataFlags () |
|
virtual bool | GetThreaderUpdateProgress () const |
|
virtual void | ThreaderUpdateProgressOn () |
|
virtual void | ThreaderUpdateProgressOff () |
|
virtual void | SetThreaderUpdateProgress (bool arg) |
|
| Object () |
|
| ~Object () override |
|
bool | PrintObservers (std::ostream &os, Indent indent) const |
|
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
|
virtual LightObject::Pointer | InternalClone () const |
|
| LightObject () |
|
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
|
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
|
virtual | ~LightObject () |
|
static constexpr float | progressFixedToFloat (uint32_t fixed) |
|
static uint32_t | progressFloatToFixed (float f) |
|
bool | m_Updating |
|
TimeStamp | m_OutputInformationMTime |
|
std::atomic< int > | m_ReferenceCount |
|
template<typename TInputImage>
class itk::ContourExtractor2DImageFilter< 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 GetNumberOfIndexedOutputs() 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://users.polytech.unice.fr/~lingrand/MarchingCubes/algo.html
There is an 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. (Note that high-valued and low-valued are with respect to the contour value sought when LabelContours is false. When LabelContours is true, high-valued means the label being traced and low-valued means any other label.) In this case, the default behavior is that the low-valued pixels are connected into the same contour via an isthmus that separates the high-valued pixels into separate contours. To reverse this, call VertexConnectHighPixelsOn(). Note that when LabelContours is true, the default behavior will leave all four pixels in separate contours. In this case, VertexConnectHighPixels equal to true can instead create contours that are crossing barbells.
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 closedness 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 greater 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 values are interpreted as intensities relative to a contour value. First calling LabelContoursOn() changes this behavior to instead interpret each value as a label. Boundaries are computed for each label separately and all are returned. The value of LabelContours affects the interpretation of VertexConnectHighPixels; see above.
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. https://www.insight-journal.org/browse/publication/72
- See also
- Image
-
Path
-
PolyLineParametricPath
- ITK Sphinx Examples:
-
- Examples
- SphinxExamples/src/Filtering/Path/ExtractContoursFromImage/Code.cxx.
Definition at line 108 of file itkContourExtractor2DImageFilter.h.