35#include "DGtal/base/Common.h"
36#include "ConfigTest.h"
37#include "DGtal/helpers/StdDefs.h"
38#include "DGtal/io/readers/PointListReader.h"
39#include "DGtal/geometry/curves/Naive3DDSSComputer.h"
40#include "DGtal/geometry/curves/estimation/LambdaMST3D.h"
41#include "DGtal/geometry/curves/estimation/FunctorsLambdaMST.h"
42#include "DGtal/geometry/curves/SaturatedSegmentation.h"
59 typedef std::vector < Point >
Range;
73 inputStream.open ( (testPath +
"samples/sinus3D.dat").c_str(), std::ios::in );
78 trace.error() <<
"Size is null." << endl;
84 LambdaMST3D < Segmentation > lmst64;
85 lmst64.
attach ( segmenter );
94 LambdaMST3D < Segmentation > lmst64;
95 lmst64.
attach ( segmenter );
97 vector < RealVector > tangent;
98 lmst64.
eval < back_insert_iterator< vector < RealVector > > > (
curve.begin(),
curve.end(), back_insert_iterator< vector < RealVector > > ( tangent ) );
105 LambdaMST3D < Segmentation, Lambda64Function, DSSLengthLessEqualFilter < SegmentComputer > > lmst64;
106 lmst64.
attach ( segmenter );
117 LambdaMST3D < Segmentation, LambdaSinFromPiFunction > lmst;
118 lmst.
attach ( segmenter );
128 LambdaMST3D < Segmentation, LambdaSinFromPiFunction > lmst;
129 lmst.
attach ( segmenter );
131 vector < RealVector > tangent;
132 lmst.
eval < back_insert_iterator< vector < RealVector > > > (
curve.begin(),
curve.end(), back_insert_iterator< vector < RealVector > > ( tangent ) );
139 LambdaMST3D < Segmentation, LambdaExponentialFunction > lmst;
140 lmst.
attach ( segmenter );
150 LambdaMST3D < Segmentation, LambdaExponentialFunction > lmst;
151 lmst.
attach ( segmenter );
153 vector < RealVector > tangent;
154 lmst.
eval < back_insert_iterator< vector < RealVector > > > (
curve.begin(),
curve.end(), back_insert_iterator< vector < RealVector > > ( tangent ) );
167 trace.beginBlock (
"Testing LambdaMST3D" );
168 trace.beginBlock (
"Testing point only calculation" );
174 trace.beginBlock (
"Testing calculation for whole curve" );
180 trace.emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void attach(Alias< TSegmentation > segmentComputer)
RealVector eval(const Point &p)
void init(ConstIterator itb, ConstIterator ite)
DSSFilter & getDSSFilter()
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
DGtal::Z2i::Point Point2D
Range2D::const_iterator ConstIterator2D
SaturatedSegmentation< SegmentComputer > Segmentation
Range::const_iterator ConstIterator
Naive3DDSSComputer< ConstIterator, int, 8 > SegmentComputer
std::list< Point2D > Range2D
SaturatedSegmentation< SegmentComputer2D > Segmentation2D
ArithmeticalDSSComputer< ConstIterator2D, int, 8 > SegmentComputer2D
std::vector< Point > Range
Z3i this namespace gathers the standard of types for 3D imagery.
functors namespace gathers all DGtal functors.
DGtal is the top-level namespace which contains all DGtal functions and types.
static std::vector< TPoint > getPointsFromInputStream(std::istream &in, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >())