ITK
4.9.0
Insight Segmentation and Registration Toolkit
|
#include <itkConnectedComponentImageFilter.h>
Label the objects in a binary image.
ConnectedComponentImageFilter labels the objects in a binary image (non-zero pixels are considered to be objects, zero-valued pixels are considered to be background). Each distinct object is assigned a unique label. The filter experiments with some improvements to the existing implementation, and is based on run length encoding along raster lines. The final object labels start with 1 and are consecutive. Objects that are reached earlier by a raster order scan have a lower label. This is different to the behaviour of the original connected component image filter which did not produce consecutive labels or impose any particular ordering.
After the filter is executed, ObjectCount holds the number of connected components.
Definition at line 59 of file itkConnectedComponentImageFilter.h.
Classes | |
class | runLength |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Attributes | |
bool | m_FullyConnected |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime |
bool | m_Updating |
Protected Attributes inherited from itk::LightObject | |
AtomicInt< int > | m_ReferenceCount |
Private Types | |
typedef std::vector< runLength > | lineEncoding |
typedef std::vector< lineEncoding > | LineMapType |
typedef std::vector< typename TInputImage::OffsetValueType > | OffsetVec |
typedef TOutputImage::RegionType::SizeType | OutSizeType |
typedef std::vector< LabelType > | UnionFindType |
Private Member Functions | |
bool | CheckNeighbors (const OutputIndexType &A, const OutputIndexType &B) |
void | CompareLines (lineEncoding ¤t, const lineEncoding &Neighbour) |
ConnectedComponentImageFilter (const Self &) ITK_DELETE_FUNCTION | |
SizeValueType | CreateConsecutive () |
void | FillOutput (const LineMapType &LineMap, ProgressReporter &progress) |
void | InitUnion (SizeValueType size) |
void | InsertSet (const LabelType label) |
void | LinkLabels (const LabelType lab1, const LabelType lab2) |
SizeValueType | LookupSet (const LabelType label) |
void | operator= (const Self &) ITK_DELETE_FUNCTION |
void | SetupLineOffsets (OffsetVec &LineOffsets) |
void | Wait () |
Private Attributes | |
OutputImagePixelType | m_BackgroundValue |
Barrier::Pointer | m_Barrier |
UnionFindType | m_Consecutive |
std::vector< IdentifierType > | m_FirstLineIdToJoin |
TInputImage::ConstPointer | m_Input |
LineMapType | m_LineMap |
std::vector< IdentifierType > | m_NumberOfLabels |
LabelType | m_ObjectCount |
UnionFindType | m_UnionFind |
typedef TOutputImage::PixelType | OutputPixelType |
typedef TOutputImage::InternalPixelType | OutputInternalPixelType |
typedef TInputImage::PixelType | InputPixelType |
typedef TInputImage::InternalPixelType | InputInternalPixelType |
typedef TMaskImage::PixelType | MaskPixelType |
static const unsigned int | ImageDimension = TOutputImage::ImageDimension |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
static const unsigned int | InputImageDimension = TInputImage::ImageDimension |
Additional Inherited Members | |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static const unsigned int | InputImageDimension = TInputImage::ImageDimension |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageSource< TOutputImage > | |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(OutputImageDimension), itkGetStaticConstMacro(InputImageDimension) > | InputToOutputRegionCopierType |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > | OutputToInputRegionCopierType |
Static Protected Member Functions inherited from itk::ImageSource< TOutputImage > | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_TYPE | ThreaderCallback (void *arg) |
typedef SmartPointer< const Self > itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::ConstPointer |
Definition at line 114 of file itkConnectedComponentImageFilter.h.
typedef TInputImage::IndexType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::IndexType |
Definition at line 96 of file itkConnectedComponentImageFilter.h.
typedef Superclass::InputImagePointer itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::InputImagePointer |
Types from the Superclass
Definition at line 72 of file itkConnectedComponentImageFilter.h.
typedef TInputImage itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::InputImageType |
Image typedef support
Definition at line 94 of file itkConnectedComponentImageFilter.h.
typedef TInputImage::InternalPixelType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::InputInternalPixelType |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 81 of file itkConnectedComponentImageFilter.h.
typedef TInputImage::PixelType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::InputPixelType |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 80 of file itkConnectedComponentImageFilter.h.
typedef IdentifierType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::LabelType |
Type used as identifier of the different component labels.
Definition at line 134 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 221 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 224 of file itkConnectedComponentImageFilter.h.
typedef std::list< IndexType > itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::ListType |
Definition at line 107 of file itkConnectedComponentImageFilter.h.
typedef MaskImageType::Pointer itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::MaskImagePointer |
Definition at line 108 of file itkConnectedComponentImageFilter.h.
typedef TMaskImage itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::MaskImageType |
Definition at line 95 of file itkConnectedComponentImageFilter.h.
typedef TMaskImage::PixelType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::MaskPixelType |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 82 of file itkConnectedComponentImageFilter.h.
typedef TInputImage::OffsetType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::OffsetType |
Definition at line 98 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 226 of file itkConnectedComponentImageFilter.h.
typedef TOutputImage::PixelType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::OutputImagePixelType |
Definition at line 105 of file itkConnectedComponentImageFilter.h.
typedef TOutputImage itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::OutputImageType |
Definition at line 100 of file itkConnectedComponentImageFilter.h.
typedef TOutputImage::IndexType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::OutputIndexType |
Definition at line 102 of file itkConnectedComponentImageFilter.h.
typedef TOutputImage::InternalPixelType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::OutputInternalPixelType |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 79 of file itkConnectedComponentImageFilter.h.
typedef TOutputImage::OffsetType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::OutputOffsetType |
Definition at line 104 of file itkConnectedComponentImageFilter.h.
typedef TOutputImage::PixelType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::OutputPixelType |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 78 of file itkConnectedComponentImageFilter.h.
typedef TOutputImage::SizeType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::OutputSizeType |
Definition at line 103 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 209 of file itkConnectedComponentImageFilter.h.
typedef SmartPointer< Self > itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::Pointer |
Smart pointer typedef support
Definition at line 113 of file itkConnectedComponentImageFilter.h.
typedef TOutputImage::RegionType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::RegionType |
Definition at line 101 of file itkConnectedComponentImageFilter.h.
typedef ConnectedComponentImageFilter itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::Self |
Standard "Self" & Superclass typedef.
Definition at line 66 of file itkConnectedComponentImageFilter.h.
typedef TInputImage::SizeType itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::SizeType |
Definition at line 97 of file itkConnectedComponentImageFilter.h.
typedef ImageToImageFilter< TInputImage, TOutputImage > itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::Superclass |
Definition at line 67 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 229 of file itkConnectedComponentImageFilter.h.
|
inlineprotected |
Definition at line 169 of file itkConnectedComponentImageFilter.h.
References itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::m_BackgroundValue, itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::m_FullyConnected, itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::m_ObjectCount, and itk::NumericTraits< T >::ZeroValue().
|
inlineprotectedvirtual |
Definition at line 176 of file itkConnectedComponentImageFilter.h.
|
private |
|
overrideprotectedvirtual |
If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). The execution flow in the default GenerateData() method will be: 1) Allocate the output buffer 2) Call BeforeThreadedGenerateData() 3) Spawn threads, calling ThreadedGenerateData() in each thread. 4) Call AfterThreadedGenerateData() Note that this flow of control is only available if a filter provides a ThreadedGenerateData() method and NOT a GenerateData() method.
Reimplemented from itk::ImageSource< TOutputImage >.
|
overrideprotectedvirtual |
Standard pipeline methods.
Reimplemented from itk::ImageSource< TOutputImage >.
|
private |
|
private |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
Reimplemented in itk::ScalarConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >, itk::VectorConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >, itk::ConnectedComponentFunctorImageFilter< TInputImage, TOutputImage, Functor::SimilarPixelsFunctor< TInputImage::ValueType >, TMaskImage >, and itk::ConnectedComponentFunctorImageFilter< TInputImage, TOutputImage, Functor::SimilarVectorsFunctor< TInputImage::ValueType >, TMaskImage >.
|
private |
|
overrideprotectedvirtual |
ConnectedComponentImageFilter will produce all of the output. Therefore it must provide an implementation of EnlargeOutputRequestedRegion().
Reimplemented from itk::ProcessObject.
|
private |
|
virtual |
Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn.
|
virtual |
Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn.
|
overrideprotectedvirtual |
ConnectedComponentImageFilter needs the entire input. Therefore it must provide an implementation GenerateInputRequestedRegion().
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set the pixel intensity to be used for background (non-object) regions of the image in the output. Note that this does NOT set the background value to be used in the input image.
|
virtual |
Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn.
|
inline |
Definition at line 154 of file itkConnectedComponentImageFilter.h.
References itk::ProcessObject::GetInput().
|
virtual |
Run-time type information (and related methods)
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Reimplemented in itk::ScalarConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >, itk::VectorConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >, itk::ConnectedComponentFunctorImageFilter< TInputImage, TOutputImage, TFunctor, TMaskImage >, itk::ConnectedComponentFunctorImageFilter< TInputImage, TOutputImage, Functor::SimilarPixelsFunctor< TInputImage::ValueType >, TMaskImage >, and itk::ConnectedComponentFunctorImageFilter< TInputImage, TOutputImage, Functor::SimilarVectorsFunctor< TInputImage::ValueType >, TMaskImage >.
|
virtual |
|
inlineprivate |
Definition at line 234 of file itkConnectedComponentImageFilter.h.
References itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::m_UnionFind.
|
private |
|
private |
|
private |
|
static |
Method for creation through the object factory.
|
private |
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set the pixel intensity to be used for background (non-object) regions of the image in the output. Note that this does NOT set the background value to be used in the input image.
|
virtual |
Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn.
|
inline |
Definition at line 149 of file itkConnectedComponentImageFilter.h.
References itk::ProcessObject::SetNthInput().
|
private |
|
overrideprotected |
itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::typedef | ( | Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > | ) |
This class requires SameDimension in the form of ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > )
itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::typedef | ( | Concept::IsInteger< OutputImagePixelType > | ) |
This class requires OutputImagePixelTypeIsInteger in the form of ( Concept::IsInteger< OutputImagePixelType > )
|
inlineprivate |
|
static |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 84 of file itkConnectedComponentImageFilter.h.
|
static |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 88 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 206 of file itkConnectedComponentImageFilter.h.
Referenced by itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::ConnectedComponentImageFilter().
|
private |
Definition at line 270 of file itkConnectedComponentImageFilter.h.
Referenced by itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::Wait().
|
private |
Definition at line 231 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 268 of file itkConnectedComponentImageFilter.h.
|
protected |
Definition at line 199 of file itkConnectedComponentImageFilter.h.
Referenced by itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::ConnectedComponentImageFilter().
|
private |
Definition at line 272 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 274 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 267 of file itkConnectedComponentImageFilter.h.
Referenced by itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::Wait().
|
private |
Definition at line 205 of file itkConnectedComponentImageFilter.h.
Referenced by itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::ConnectedComponentImageFilter().
|
private |
Definition at line 230 of file itkConnectedComponentImageFilter.h.
Referenced by itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::InitUnion().
|
static |
Extract some information from the image types. Dimensionality of the two images is assumed to be the same.
Definition at line 86 of file itkConnectedComponentImageFilter.h.