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);
132 itkSetMacro(FullyConnected,
bool);
133 itkGetConstReferenceMacro(FullyConnected,
bool);
134 itkBooleanMacro(FullyConnected);
141 itkGetConstReferenceMacro(ObjectCount,
LabelType);
146 itkGetStaticConstMacro(OutputImageDimension) > ) );
164 m_FullyConnected =
false;
172 Self::AddOptionalInputName(
"MaskImage",1);
176 void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
181 void BeforeThreadedGenerateData() ITK_OVERRIDE;
183 void AfterThreadedGenerateData() ITK_OVERRIDE;
185 void ThreadedGenerateData(const RegionType & outputRegionForThread,
ThreadIdType threadId) ITK_OVERRIDE;
190 void GenerateInputRequestedRegion() ITK_OVERRIDE;
196 void EnlargeOutputRequestedRegion(
DataObject * itkNotUsed(output) ) ITK_OVERRIDE;
198 bool m_FullyConnected;
224 typedef std::vector< typename TInputImage::OffsetValueType >
OffsetVec;
237 void InsertSet(
const LabelType label);
241 void LinkLabels(
const LabelType lab1,
const LabelType lab2);
246 bool CheckNeighbors(
const OutputIndexType & A,
247 const OutputIndexType & B);
249 void CompareLines(lineEncoding & current,
const lineEncoding & Neighbour);
251 void FillOutput(
const LineMapType & LineMap,
254 void SetupLineOffsets(OffsetVec & LineOffsets);
259 if ( m_NumberOfLabels.size() > 1 )
271 #if !defined( ITK_WRAPPING_PARSER )
277 #ifndef ITK_MANUAL_INSTANTIATION
278 #if !defined( ITK_WRAPPING_PARSER )
279 #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
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
TInputImage::IndexType where
OutputImageType::PixelType OutputImagePixelType
unsigned int ThreadIdType
Implements progress tracking for a filter.
ConnectedComponentImageFilter()
TInputImage::SizeType SizeType
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.
ImageBaseType::SizeType SizeType
virtual ~ConnectedComponentImageFilter() override
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
ImageBaseType::IndexType IndexType
Label the objects in a binary image.