18 #ifndef itkConnectedComponentImageFilter_h
19 #define itkConnectedComponentImageFilter_h
58 template<
typename TInputImage,
typename TOutputImage,
typename TMaskImage = TInputImage >
83 itkStaticConstMacro(ImageDimension,
unsigned int,
84 TOutputImage::ImageDimension);
85 itkStaticConstMacro(OutputImageDimension,
unsigned int,
86 TOutputImage::ImageDimension);
87 itkStaticConstMacro(InputImageDimension,
unsigned int,
88 TInputImage::ImageDimension);
97 typedef typename TInputImage::SizeType
SizeType;
132 itkSetMacro(FullyConnected,
bool);
133 itkGetConstReferenceMacro(FullyConnected,
bool);
134 itkBooleanMacro(FullyConnected);
141 itkGetConstReferenceMacro(ObjectCount,
LabelType);
146 itkGetStaticConstMacro(OutputImageDimension) > ) );
151 this->SetNthInput( 1, const_cast< TMaskImage * >( mask ) );
164 itkSetMacro(BackgroundValue, OutputImagePixelType);
165 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
171 m_FullyConnected =
false;
177 void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
182 void BeforeThreadedGenerateData() ITK_OVERRIDE;
184 void AfterThreadedGenerateData() ITK_OVERRIDE;
186 void ThreadedGenerateData(const RegionType & outputRegionForThread,
ThreadIdType threadId) ITK_OVERRIDE;
191 void GenerateInputRequestedRegion() ITK_OVERRIDE;
197 void EnlargeOutputRequestedRegion(
DataObject * itkNotUsed(output) ) ITK_OVERRIDE;
199 bool m_FullyConnected;
216 typename TInputImage::IndexType
where;
225 typedef std::vector< typename TInputImage::OffsetValueType >
OffsetVec;
238 void InsertSet(
const LabelType label);
242 void LinkLabels(
const LabelType lab1,
const LabelType lab2);
247 bool CheckNeighbors(
const OutputIndexType & A,
248 const OutputIndexType & B);
250 void CompareLines(lineEncoding & current,
const lineEncoding & Neighbour);
252 void FillOutput(
const LineMapType & LineMap,
255 void SetupLineOffsets(OffsetVec & LineOffsets);
260 if ( m_NumberOfLabels.size() > 1 )
272 #if !defined( ITK_WRAPPING_PARSER )
278 #ifndef ITK_MANUAL_INSTANTIATION
279 #if !defined( ITK_WRAPPING_PARSER )
280 #include "itkConnectedComponentImageFilter.hxx"
std::vector< runLength > lineEncoding
TOutputImage OutputImageType
signed long OffsetValueType
std::vector< typename TInputImage::OffsetValueType > OffsetVec
TInputImage::ConstPointer m_Input
ImageToImageFilter< TInputImage, TOutputImage > Superclass
TInputImage InputImageType
MaskImageType::Pointer MaskImagePointer
TInputImage::PixelType InputPixelType
UnionFindType m_UnionFind
TInputImage::OffsetType OffsetType
TMaskImage::PixelType MaskPixelType
void SetMaskImage(TMaskImage *mask)
TOutputImage::RegionType::SizeType OutSizeType
TInputImage::InternalPixelType InputInternalPixelType
Base class for all process objects that output image data.
std::list< IndexType > ListType
TInputImage::OffsetValueType length
Superclass::InputImagePointer InputImagePointer
unsigned long SizeValueType
TOutputImage::PixelType OutputImagePixelType
std::vector< lineEncoding > LineMapType
std::vector< LabelType > UnionFindType
TOutputImage::OffsetType OutputOffsetType
SizeValueType IdentifierType
SmartPointer< Self > Pointer
TOutputImage::IndexType OutputIndexType
SmartPointer< const Self > ConstPointer
TOutputImage::InternalPixelType OutputInternalPixelType
void InitUnion(SizeValueType size)
TOutputImage::SizeType OutputSizeType
const TMaskImage * GetMaskImage() const
TInputImage::IndexType where
OutputImageType::PixelType OutputImagePixelType
unsigned int ThreadIdType
Implements progress tracking for a filter.
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
ConnectedComponentImageFilter()
TInputImage::SizeType SizeType
virtual ~ConnectedComponentImageFilter()
Base class for filters that take an image as input and produce an image as output.
TInputImage::IndexType IndexType
Barrier::Pointer m_Barrier
Control indentation during Print() invocation.
std::vector< IdentifierType > m_NumberOfLabels
UnionFindType m_Consecutive
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.
ConnectedComponentImageFilter Self
TOutputImage::RegionType RegionType
TOutputImage::PixelType OutputPixelType
std::vector< IdentifierType > m_FirstLineIdToJoin
Label the objects in a binary image.