Class ConnectedComponentImageFilter

java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.ConnectedComponentImageFilter

public class ConnectedComponentImageFilter extends ImageFilter
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. If the output background value is set to zero (the default), the final object labels start with 1 and are consecutive. If the output background is set to a non-zero value (by calling the SetBackgroundValue() routine of the filter), the final labels start at 0, and remain consecutive except for skipping the background value as needed. 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. See: ImageToImageFilter itk::simple::ConnectedComponent for the procedural interface itk::ConnectedComponentImageFilter for the Doxygen on the original ITK class. C++ includes: sitkConnectedComponentImageFilter.h
  • Constructor Details

    • ConnectedComponentImageFilter

      protected ConnectedComponentImageFilter(long cPtr, boolean cMemoryOwn)
    • ConnectedComponentImageFilter

      public ConnectedComponentImageFilter()
      itk::simple::ConnectedComponentImageFilter::ConnectedComponentImageFilter() Default Constructor that takes no arguments and initializes default parameters
  • Method Details

    • getCPtr

      protected static long getCPtr(ConnectedComponentImageFilter obj)
    • swigRelease

      protected static long swigRelease(ConnectedComponentImageFilter obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class ImageFilter
    • delete

      public void delete()
      virtual itk::simple::ConnectedComponentImageFilter::~ConnectedComponentImageFilter() Destructor
      Overrides:
      delete in class ImageFilter
    • setFullyConnected

      public void setFullyConnected(boolean FullyConnected)
      Self& itk::simple::ConnectedComponentImageFilter::SetFullyConnected(bool FullyConnected) 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.
    • fullyConnectedOn

      public void fullyConnectedOn()
      Self& itk::simple::ConnectedComponentImageFilter::FullyConnectedOn() Set the value of FullyConnected to true or false respectfully.
    • fullyConnectedOff

      public void fullyConnectedOff()
      Self& itk::simple::ConnectedComponentImageFilter::FullyConnectedOff()
    • getFullyConnected

      public boolean getFullyConnected()
      bool itk::simple::ConnectedComponentImageFilter::GetFullyConnected() const 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.
    • getObjectCount

      public long getObjectCount()
      uint32_t itk::simple::ConnectedComponentImageFilter::GetObjectCount() const This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.
    • getName

      public String getName()
      std::string itk::simple::ConnectedComponentImageFilter::GetName() const Name of this class
      Overrides:
      getName in class ProcessObject
    • toString

      public String toString()
      std::string itk::simple::ConnectedComponentImageFilter::ToString() const Print ourselves out
      Overrides:
      toString in class ProcessObject
    • execute

      public Image execute(Image image, Image maskImage)
      Image itk::simple::ConnectedComponentImageFilter::Execute(const Image &image, const Image &maskImage) Execute the filter on the input image
    • execute

      public Image execute(Image image)
      Image itk::simple::ConnectedComponentImageFilter::Execute(const Image &image, const Image &maskImage) Execute the filter on the input image