A simple example illustrating the extraction of 3d connected set of KhalimskyCell. This program outputs these images:
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/base/Common.h"
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
#include "DGtal/io/viewers/Viewer3D.h"
#include "DGtal/io/Color.h"
#include "DGtal/images/ImageSelector.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
#include "DGtal/io/Color.h"
#include "DGtal/io/colormaps/GradientColorMap.h"
#include "DGtal/topology/KhalimskySpaceND.h"
#include "DGtal/topology/helpers/Surfaces.h"
using namespace std;
using namespace Z3i;
int main(
int argc,
char** argv )
{
unsigned int nbSeeds = 35;
vector<Point> vCenters;
vector<uint> vRad;
for(unsigned int i=0;i<nbSeeds; i++){
vCenters.push_back(
Point(rand()%p2[0], rand()%p2[1],
rand()%p2[2]));
vRad.push_back(rand()%7);
}
for(unsigned int i=0;i<nbSeeds; i++){
if ( (*it - vCenters.at(i) ).norm1() <= vRad.at(i) &&
domain.
isInside(*it) &&
break;
}
}
}
vector<vector<SCell> > vectConnectedSCell;
QApplication application(argc,argv);
for(unsigned int i=0; i< vectConnectedSCell.size();i++){
for(unsigned int j=0; j< vectConnectedSCell.at(i).size();j++){
viewer << vectConnectedSCell.at(i).at(j);
}
}
viewer << diamond_set;
viewer << Viewer3D<>::updateDisplay;
return application.exec();
}