ITK
4.13.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 |
Public Types | |
typedef SmartPointer< const Self > | ConstPointer |
typedef TInputImage::IndexType | IndexType |
typedef Superclass::InputImagePointer | InputImagePointer |
typedef TInputImage | InputImageType |
typedef IdentifierType | LabelType |
typedef std::list< IndexType > | ListType |
typedef MaskImageType::Pointer | MaskImagePointer |
typedef TMaskImage | MaskImageType |
typedef TInputImage::OffsetType | OffsetType |
typedef TOutputImage::PixelType | OutputImagePixelType |
typedef TOutputImage | OutputImageType |
typedef TOutputImage::IndexType | OutputIndexType |
typedef TOutputImage::OffsetType | OutputOffsetType |
typedef TOutputImage::SizeType | OutputSizeType |
typedef SmartPointer< Self > | Pointer |
typedef TOutputImage::RegionType | RegionType |
typedef ConnectedComponentImageFilter | Self |
typedef TInputImage::SizeType | SizeType |
typedef ImageToImageFilter < TInputImage, TOutputImage > | Superclass |
Public Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
typedef SmartPointer< const Self > | ConstPointer |
typedef InputImageType::ConstPointer | InputImageConstPointer |
typedef InputImageType::PixelType | InputImagePixelType |
typedef InputImageType::Pointer | InputImagePointer |
typedef InputImageType::RegionType | InputImageRegionType |
typedef TInputImage | InputImageType |
typedef Superclass::OutputImagePixelType | OutputImagePixelType |
typedef Superclass::OutputImageRegionType | OutputImageRegionType |
typedef SmartPointer< Self > | Pointer |
typedef ImageToImageFilter | Self |
typedef ImageSource< TOutputImage > | Superclass |
Public Types inherited from itk::ImageSource< TOutputImage > | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::DataObjectIdentifierType | DataObjectIdentifierType |
typedef DataObject::Pointer | DataObjectPointer |
typedef Superclass::DataObjectPointerArraySizeType | DataObjectPointerArraySizeType |
typedef OutputImageType::PixelType | OutputImagePixelType |
typedef OutputImageType::Pointer | OutputImagePointer |
typedef OutputImageType::RegionType | OutputImageRegionType |
typedef TOutputImage | OutputImageType |
typedef SmartPointer< Self > | Pointer |
typedef ImageSource | Self |
typedef ProcessObject | Superclass |
Public Types inherited from itk::ProcessObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef DataObject::DataObjectIdentifierType | DataObjectIdentifierType |
typedef DataObject::Pointer | DataObjectPointer |
typedef std::vector < DataObjectPointer > | DataObjectPointerArray |
typedef DataObjectPointerArray::size_type | DataObjectPointerArraySizeType |
typedef MultiThreader | MultiThreaderType |
typedef std::vector < DataObjectIdentifierType > | NameArray |
typedef SmartPointer< Self > | Pointer |
typedef ProcessObject | Self |
typedef Object | Superclass |
Public Types inherited from itk::Object | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef Object | Self |
typedef LightObject | Superclass |
Public Types inherited from itk::LightObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef LightObject | Self |
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) |
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 | 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 219 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 222 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 224 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 207 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 227 of file itkConnectedComponentImageFilter.h.
|
inlineprotected |
Definition at line 162 of file itkConnectedComponentImageFilter.h.
References itk::NumericTraits< T >::ZeroValue().
|
inlineoverrideprotectedvirtual |
Definition at line 175 of file itkConnectedComponentImageFilter.h.
|
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.
|
virtual |
|
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 232 of file itkConnectedComponentImageFilter.h.
|
private |
|
private |
|
private |
|
static |
Method for creation through the object factory.
|
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.
|
virtual |
|
private |
|
overrideprotected |
|
inlineprivate |
Definition at line 256 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 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 204 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 268 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 229 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 266 of file itkConnectedComponentImageFilter.h.
|
protected |
Definition at line 198 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 270 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 272 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 265 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 201 of file itkConnectedComponentImageFilter.h.
|
private |
Definition at line 228 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 86 of file itkConnectedComponentImageFilter.h.