def components( options = {} )
      if shape.any? { |x| x <= 1 }
        raise "Every dimension must be greater than 1 (shape was #{shape})"
      end
      options = { :target => UINT, :default => typecode.default }.merge options
      target = options[ :target ]
      default = options[ :default ]
      default = typecode.new default unless default.matched?
      left = Hornetseye::MultiArray(target, dimension).new *shape
      labels = Sequence.new target, size; labels[0] = 0
      rank = Sequence.uint size; rank[0] = 0
      n = Hornetseye::Pointer( INT ).new; n.store INT.new( 0 )
      block = Components.new left, self, default, target.new(0),
                             labels, rank, n
      if block.compilable?
        Hornetseye::GCCFunction.run block
      else
        block.demand
      end
      labels = labels[0 .. n.demand.get]
      left.lut labels.lut(labels.histogram(labels.size, :weight => target.new(1)).
                          minor(1).integral - 1)
    end
def components( options = {} )
      if shape.any? { |x| x <= 1 }
        raise "Every dimension must be greater than 1 (shape was #{shape})"
      end
      options = { :target => UINT, :default => typecode.default }.merge options
      target = options[ :target ]
      default = options[ :default ]
      default = typecode.new default unless default.matched?
      left = Hornetseye::MultiArray(target, dimension).new *shape
      labels = Sequence.new target, size; labels[0] = 0
      rank = Sequence.uint size; rank[0] = 0
      n = Hornetseye::Pointer( INT ).new; n.store INT.new( 0 )
      block = Components.new left, self, default, target.new(0),
                             labels, rank, n
      if block.compilable?
        Hornetseye::GCCFunction.run block
      else
        block.demand
      end
      labels = labels[0 .. n.demand.get]
      left.lut labels.lut(labels.histogram(labels.size, :weight => target.new(1)).
                          minor(1).integral - 1)
    end
Perform connected component labeling

 @option options [Object] :default (typecode.default) Value of background elements.
 @option options [Class] :target (UINT) Typecode of labels.

 @return [Node] Array with labels of connected components.