ITK  5.2.0
Insight Toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
itk::ScanlineFilterCommon< TInputImage, TOutputImage > Class Template Reference

#include <itkScanlineFilterCommon.h>

+ Inheritance diagram for itk::ScanlineFilterCommon< TInputImage, TOutputImage >:
+ Collaboration diagram for itk::ScanlineFilterCommon< TInputImage, TOutputImage >:

Classes

struct  RunLength
 
struct  WorkUnitData
 

Public Types

using ConstPointer = SmartPointer< const Self >
 
using EnclosingFilter = ImageToImageFilter< TInputImage, TOutputImage >
 
using IndexType = typename TInputImage::IndexType
 
using InputImageConstPointer = typename InputImageType::ConstPointer
 
using InputImagePointer = typename InputImageType::Pointer
 
using InputImageType = TInputImage
 
using InputPixelType = typename TInputImage::PixelType
 
using OffsetType = typename TInputImage::OffsetType
 
using OutputImagePixelType = typename TOutputImage::PixelType
 
using OutputImagePointer = typename OutputImageType::Pointer
 
using OutputImageType = TOutputImage
 
using OutputIndexType = typename TOutputImage::IndexType
 
using OutputOffsetType = typename TOutputImage::OffsetType
 
using OutputPixelType = typename TOutputImage::PixelType
 
using OutputRegionType = typename TOutputImage::RegionType
 
using OutputSizeType = typename TOutputImage::SizeType
 
using Pointer = SmartPointer< Self >
 
using RegionType = OutputRegionType
 
using Self = ScanlineFilterCommon
 
using SizeType = typename TInputImage::SizeType
 

Public Member Functions

void Register () const
 
 ScanlineFilterCommon (EnclosingFilter *enclosingFilter)
 
void UnRegister () const noexcept
 
 ~ScanlineFilterCommon ()=default
 

Static Public Member Functions

static Pointer New ()
 

Static Public Attributes

static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension
 
static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension
 
static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension
 

Protected Types

using CompareLinesCallback = std::function< void(const LineEncodingConstIterator &currentRun, const LineEncodingConstIterator &neighborRun, OffsetValueType oStart, OffsetValueType oLast)>
 
using ConsecutiveVectorType = std::vector< OutputPixelType >
 
using InternalLabelType = SizeValueType
 
using LineEncodingConstIterator = typename LineEncodingType::const_iterator
 
using LineEncodingIterator = typename LineEncodingType::iterator
 
using LineEncodingType = std::vector< RunLength >
 
using LineMapType = std::vector< LineEncodingType >
 
using OffsetVectorConstIterator = typename OffsetVectorType::const_iterator
 
using OffsetVectorType = std::vector< OffsetValueType >
 
using OutSizeType = typename TOutputImage::RegionType::SizeType
 
using UnionFindType = std::vector< InternalLabelType >
 

Protected Member Functions

bool CheckNeighbors (const OutputIndexType &A, const OutputIndexType &B) const
 
void CompareLines (const LineEncodingType &current, const LineEncodingType &Neighbour, bool sameLineOffset, bool labelCompare, OutputPixelType background, CompareLinesCallback callback)
 
void ComputeEquivalence (const SizeValueType workUnitResultsIndex, bool strictlyLess)
 
SizeValueType CreateConsecutive (OutputPixelType backgroundValue)
 
WorkUnitData CreateWorkUnitData (const RegionType &outputRegionForThread)
 
SizeValueType IndexToLinearIndex (const IndexType &index) const
 
void InitUnion (InternalLabelType numberOfLabels)
 
void LinkLabels (const InternalLabelType label1, const InternalLabelType label2)
 
InternalLabelType LookupSet (const InternalLabelType label)
 
void SetupLineOffsets (bool wholeNeighborhood)
 

Protected Attributes

ConsecutiveVectorType m_Consecutive
 
WeakPointer< EnclosingFilterm_EnclosingFilter
 
bool m_FullyConnected
 
LineMapType m_LineMap
 
OffsetVectorType m_LineOffsets
 
std::mutex m_Mutex
 
std::atomic< SizeValueTypem_NumberOfLabels
 
UnionFindType m_UnionFind
 
std::deque< WorkUnitDatam_WorkUnitResults
 

Detailed Description

template<typename TInputImage, typename TOutputImage>
class itk::ScanlineFilterCommon< TInputImage, TOutputImage >

Helper class for a group of filters which operate on scan-lines.

This implementation was taken from the Insight Journal paper: https://www.insight-journal.org/browse/publication/176

Definition at line 41 of file itkScanlineFilterCommon.h.

Member Typedef Documentation

◆ CompareLinesCallback

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::CompareLinesCallback = std::function<void(const LineEncodingConstIterator & currentRun, const LineEncodingConstIterator & neighborRun, OffsetValueType oStart, OffsetValueType oLast)>
protected

Definition at line 259 of file itkScanlineFilterCommon.h.

◆ ConsecutiveVectorType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::ConsecutiveVectorType = std::vector<OutputPixelType>
protected

Definition at line 137 of file itkScanlineFilterCommon.h.

◆ ConstPointer

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::ConstPointer = SmartPointer<const Self>

Definition at line 48 of file itkScanlineFilterCommon.h.

◆ EnclosingFilter

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::EnclosingFilter = ImageToImageFilter<TInputImage, TOutputImage>

Definition at line 102 of file itkScanlineFilterCommon.h.

◆ IndexType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::IndexType = typename TInputImage::IndexType

Definition at line 85 of file itkScanlineFilterCommon.h.

◆ InputImageConstPointer

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::InputImageConstPointer = typename InputImageType::ConstPointer

Definition at line 84 of file itkScanlineFilterCommon.h.

◆ InputImagePointer

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::InputImagePointer = typename InputImageType::Pointer

Definition at line 83 of file itkScanlineFilterCommon.h.

◆ InputImageType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::InputImageType = TInputImage

Definition at line 82 of file itkScanlineFilterCommon.h.

◆ InputPixelType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::InputPixelType = typename TInputImage::PixelType

Definition at line 78 of file itkScanlineFilterCommon.h.

◆ InternalLabelType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::InternalLabelType = SizeValueType
protected

Definition at line 111 of file itkScanlineFilterCommon.h.

◆ LineEncodingConstIterator

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::LineEncodingConstIterator = typename LineEncodingType::const_iterator
protected

Definition at line 129 of file itkScanlineFilterCommon.h.

◆ LineEncodingIterator

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::LineEncodingIterator = typename LineEncodingType::iterator
protected

Definition at line 128 of file itkScanlineFilterCommon.h.

◆ LineEncodingType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::LineEncodingType = std::vector<RunLength>
protected

Definition at line 127 of file itkScanlineFilterCommon.h.

◆ LineMapType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::LineMapType = std::vector<LineEncodingType>
protected

Definition at line 134 of file itkScanlineFilterCommon.h.

◆ OffsetType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OffsetType = typename TInputImage::OffsetType

Definition at line 87 of file itkScanlineFilterCommon.h.

◆ OffsetVectorConstIterator

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OffsetVectorConstIterator = typename OffsetVectorType::const_iterator
protected

Definition at line 132 of file itkScanlineFilterCommon.h.

◆ OffsetVectorType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OffsetVectorType = std::vector<OffsetValueType>
protected

Definition at line 131 of file itkScanlineFilterCommon.h.

◆ OutputImagePixelType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputImagePixelType = typename TOutputImage::PixelType

Definition at line 95 of file itkScanlineFilterCommon.h.

◆ OutputImagePointer

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputImagePointer = typename OutputImageType::Pointer

Definition at line 89 of file itkScanlineFilterCommon.h.

◆ OutputImageType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputImageType = TOutputImage

Definition at line 88 of file itkScanlineFilterCommon.h.

◆ OutputIndexType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputIndexType = typename TOutputImage::IndexType

Definition at line 92 of file itkScanlineFilterCommon.h.

◆ OutputOffsetType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputOffsetType = typename TOutputImage::OffsetType

Definition at line 94 of file itkScanlineFilterCommon.h.

◆ OutputPixelType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputPixelType = typename TOutputImage::PixelType

Extract some information from the image types. Dimensionality of the two images is assumed to be the same.

Definition at line 77 of file itkScanlineFilterCommon.h.

◆ OutputRegionType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputRegionType = typename TOutputImage::RegionType

Definition at line 90 of file itkScanlineFilterCommon.h.

◆ OutputSizeType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputSizeType = typename TOutputImage::SizeType

Definition at line 93 of file itkScanlineFilterCommon.h.

◆ OutSizeType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutSizeType = typename TOutputImage::RegionType::SizeType
protected

Definition at line 112 of file itkScanlineFilterCommon.h.

◆ Pointer

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::Pointer = SmartPointer<Self>

Definition at line 47 of file itkScanlineFilterCommon.h.

◆ RegionType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::RegionType = OutputRegionType

Definition at line 91 of file itkScanlineFilterCommon.h.

◆ Self

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::Self = ScanlineFilterCommon

Definition at line 46 of file itkScanlineFilterCommon.h.

◆ SizeType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::SizeType = typename TInputImage::SizeType

Definition at line 86 of file itkScanlineFilterCommon.h.

◆ UnionFindType

template<typename TInputImage , typename TOutputImage >
using itk::ScanlineFilterCommon< TInputImage, TOutputImage >::UnionFindType = std::vector<InternalLabelType>
protected

Definition at line 136 of file itkScanlineFilterCommon.h.

Constructor & Destructor Documentation

◆ ScanlineFilterCommon()

template<typename TInputImage , typename TOutputImage >
itk::ScanlineFilterCommon< TInputImage, TOutputImage >::ScanlineFilterCommon ( EnclosingFilter enclosingFilter)
inline

Definition at line 104 of file itkScanlineFilterCommon.h.

◆ ~ScanlineFilterCommon()

template<typename TInputImage , typename TOutputImage >
itk::ScanlineFilterCommon< TInputImage, TOutputImage >::~ScanlineFilterCommon ( )
default

Member Function Documentation

◆ CheckNeighbors()

template<typename TInputImage , typename TOutputImage >
bool itk::ScanlineFilterCommon< TInputImage, TOutputImage >::CheckNeighbors ( const OutputIndexType A,
const OutputIndexType B 
) const
inlineprotected

◆ CompareLines()

template<typename TInputImage , typename TOutputImage >
void itk::ScanlineFilterCommon< TInputImage, TOutputImage >::CompareLines ( const LineEncodingType current,
const LineEncodingType Neighbour,
bool  sameLineOffset,
bool  labelCompare,
OutputPixelType  background,
CompareLinesCallback  callback 
)
inlineprotected

◆ ComputeEquivalence()

template<typename TInputImage , typename TOutputImage >
void itk::ScanlineFilterCommon< TInputImage, TOutputImage >::ComputeEquivalence ( const SizeValueType  workUnitResultsIndex,
bool  strictlyLess 
)
inlineprotected

◆ CreateConsecutive()

template<typename TInputImage , typename TOutputImage >
SizeValueType itk::ScanlineFilterCommon< TInputImage, TOutputImage >::CreateConsecutive ( OutputPixelType  backgroundValue)
inlineprotected

◆ CreateWorkUnitData()

template<typename TInputImage , typename TOutputImage >
WorkUnitData itk::ScanlineFilterCommon< TInputImage, TOutputImage >::CreateWorkUnitData ( const RegionType outputRegionForThread)
inlineprotected

◆ IndexToLinearIndex()

template<typename TInputImage , typename TOutputImage >
SizeValueType itk::ScanlineFilterCommon< TInputImage, TOutputImage >::IndexToLinearIndex ( const IndexType index) const
inlineprotected

◆ InitUnion()

template<typename TInputImage , typename TOutputImage >
void itk::ScanlineFilterCommon< TInputImage, TOutputImage >::InitUnion ( InternalLabelType  numberOfLabels)
inlineprotected

◆ LinkLabels()

template<typename TInputImage , typename TOutputImage >
void itk::ScanlineFilterCommon< TInputImage, TOutputImage >::LinkLabels ( const InternalLabelType  label1,
const InternalLabelType  label2 
)
inlineprotected

◆ LookupSet()

template<typename TInputImage , typename TOutputImage >
InternalLabelType itk::ScanlineFilterCommon< TInputImage, TOutputImage >::LookupSet ( const InternalLabelType  label)
inlineprotected

◆ New()

template<typename TInputImage , typename TOutputImage >
static Pointer itk::ScanlineFilterCommon< TInputImage, TOutputImage >::New ( )
inlinestatic

◆ Register()

template<typename TInputImage , typename TOutputImage >
void itk::ScanlineFilterCommon< TInputImage, TOutputImage >::Register ( ) const
inline

◆ SetupLineOffsets()

template<typename TInputImage , typename TOutputImage >
void itk::ScanlineFilterCommon< TInputImage, TOutputImage >::SetupLineOffsets ( bool  wholeNeighborhood)
inlineprotected

◆ UnRegister()

template<typename TInputImage , typename TOutputImage >
void itk::ScanlineFilterCommon< TInputImage, TOutputImage >::UnRegister ( ) const
inlinenoexcept

Member Data Documentation

◆ ImageDimension

template<typename TInputImage , typename TOutputImage >
constexpr unsigned int itk::ScanlineFilterCommon< TInputImage, TOutputImage >::ImageDimension = TOutputImage::ImageDimension
staticconstexpr

◆ InputImageDimension

template<typename TInputImage , typename TOutputImage >
constexpr unsigned int itk::ScanlineFilterCommon< TInputImage, TOutputImage >::InputImageDimension = TInputImage::ImageDimension
staticconstexpr

Definition at line 81 of file itkScanlineFilterCommon.h.

◆ m_Consecutive

template<typename TInputImage , typename TOutputImage >
ConsecutiveVectorType itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_Consecutive
protected

◆ m_EnclosingFilter

template<typename TInputImage , typename TOutputImage >
WeakPointer<EnclosingFilter> itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_EnclosingFilter
protected

◆ m_FullyConnected

template<typename TInputImage , typename TOutputImage >
bool itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_FullyConnected
protected

◆ m_LineMap

template<typename TInputImage , typename TOutputImage >
LineMapType itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_LineMap
protected

◆ m_LineOffsets

template<typename TInputImage , typename TOutputImage >
OffsetVectorType itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_LineOffsets
protected

◆ m_Mutex

template<typename TInputImage , typename TOutputImage >
std::mutex itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_Mutex
protected

◆ m_NumberOfLabels

template<typename TInputImage , typename TOutputImage >
std::atomic<SizeValueType> itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_NumberOfLabels
protected

Definition at line 522 of file itkScanlineFilterCommon.h.

◆ m_UnionFind

template<typename TInputImage , typename TOutputImage >
UnionFindType itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_UnionFind
protected

◆ m_WorkUnitResults

template<typename TInputImage , typename TOutputImage >
std::deque<WorkUnitData> itk::ScanlineFilterCommon< TInputImage, TOutputImage >::m_WorkUnitResults
protected

◆ OutputImageDimension

template<typename TInputImage , typename TOutputImage >
constexpr unsigned int itk::ScanlineFilterCommon< TInputImage, TOutputImage >::OutputImageDimension = TOutputImage::ImageDimension
staticconstexpr

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