dip::Feature::LineBased class

The pure virtual base class for all line-based measurement features.

Contents

Base classes

class dip::Feature::Base abstract
The pure virtual base class for all measurement features.

Functions

void ScanLine(dip::LineIterator label, dip::LineIterator grey, dip::UnsignedArray coordinates, dip::uint dimension, dip::ObjectIdToIndexMap const& objectIndices) pure virtual
Called once for each image line, to accumulate information about each object. This function is not called in parallel, and hence does not need to be thread-safe.
void Finish(dip::uint objectIndex, dip::Measurement::ValueIterator output) pure virtual
Called once for each object, to finalize the measurement.

Function documentation

void ScanLine(dip::LineIterator label, dip::LineIterator grey, dip::UnsignedArray coordinates, dip::uint dimension, dip::ObjectIdToIndexMap const& objectIndices) pure virtual

Called once for each image line, to accumulate information about each object. This function is not called in parallel, and hence does not need to be thread-safe.

The two line iterators can always be incremented exactly the same number of times. label is non-zero where there is an object pixel. Look up the label value in objectIndices to obtain the index for the object. Object indices are always between 0 and number of objects - 1. The dip::Feature::Base::Initialize function should allocate an array with nObjects elements, where measurements are accumulated. The dip::Feature::LineBased::Finish function is called after the whole image has been scanned, and should provide the final measurement result for one object given its index (not object ID).

coordinates contains the coordinates of the first pixel on the line, and is passed by copy, so it can be modified. dimension indicates along which dimension to run. Increment coordinates[ dimension ] at the same time as the line iterators if coordinate information is required by the algorithm.