File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
geometry/curves/exampleArithDSS3d.cpp

This example outputs a greedy segmentation of an open and 6-connected 3d digital curve into DSSs.

$ ./examples/geometry/curves/exampleArithDSS3d
Greedy segmentation of a 3d digital curve into DSSs
See also
Analysis of one-dimensional discrete structures
#include <iostream>
#include "DGtal/io/viewers/PolyscopeViewer.h"
#include "DGtal/io/readers/PointListReader.h"
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
#include "DGtal/geometry/curves/StandardDSS6Computer.h"
#include "DGtal/geometry/curves/GreedySegmentation.h"
using namespace std;
using namespace DGtal;
using namespace Z3i;
// Standard services - public :
int main( int argc, char** argv )
{
typedef std::vector<Point>::iterator Iterator;
typedef GreedySegmentation<SegmentComputer> Decomposition;
string inputFilename = examplesPath + "samples/sinus.dat";
vector<Point> sequence = PointListReader<Point>::getPointsFromFile(inputFilename);
Decomposition theDecomposition(sequence.begin(), sequence.end(), algo);
//display
Point p;
#ifdef DGTAL_WITH_POLYSCOPE
PolyscopeViewer viewer;
viewer.allowReuseList = true; // groups segments
viewer.drawAsGrid();
#endif
unsigned int c = 0;
Decomposition::SegmentComputerIterator i = theDecomposition.begin();
for ( ; i != theDecomposition.end(); ++i) {
SegmentComputer currentSegmentComputer(*i);
#ifdef DGTAL_WITH_POLYSCOPE
viewer.drawAsBalls();
viewer << currentSegmentComputer;
viewer.defaultStyle();
viewer << currentSegmentComputer;
#endif
c++;
}
#ifdef DGTAL_WITH_POLYSCOPE
viewer.show();
#endif
}
void drawAsGrid(bool toggle=true)
Aim: Computes the greedy segmentation of a range given by a pair of ConstIterators....
Aim: Implements basic operations that will be used in Point and Vector classes.
void show() override
Starts the event loop and display of elements.
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
STL namespace.
static std::vector< TPoint > getPointsFromFile(const std::string &filename, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >())
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer
int main()
Definition testBits.cpp:56
MyPointD Point