32 #include "DGtal/base/Common.h"
34 #include "DGtal/helpers/StdDefs.h"
35 #include <QtGui/qapplication.h>
36 #include "DGtal/topology/KhalimskySpaceND.h"
37 #include "DGtal/topology/helpers/Surfaces.h"
39 #include "DGtal/io/viewers/Viewer3D.h"
40 #include "DGtal/io/readers/VolReader.h"
41 #include "DGtal/io/DrawWithDisplay3DModifier.h"
42 #include "DGtal/images/ImageSelector.h"
43 #include "DGtal/images/imagesSetsUtils/SetFromImage.h"
44 #include "DGtal/io/Color.h"
45 #include "DGtal/io/colormaps/GradientColorMap.h"
47 #include "ConfigExamples.h"
51 using namespace DGtal;
54 int main(
int argc,
char** argv )
58 QApplication application(argc,argv);
61 std::string inputFilename = examplesPath +
"samples/cat10.vol";
72 bool space_ok = ks.
init( image.domain().lowerBound(), image.domain().upperBound(), true );
76 trace.
error() <<
"Error in the Khamisky space construction."<<std::endl;
80 std::vector<Z3i::SCell> vectBdrySCell;
81 std::vector<Z3i::SCell> vectBdrySCell2;
82 std::set<Z3i::SCell> vectBdrySCellALL;
92 ks,SAdj, set3dPredicate, aCell );
96 ks, *(ks.
sDirs( aCell )), SAdj,
97 set3dPredicate, aCell );
101 ks, *(++(ks.
sDirs( aCell ))), SAdj,
102 set3dPredicate, aCell );
106 viewer <<
SetMode3D((*(vectBdrySCellALL.begin())).className(),
"Transparent");
107 for( std::set<Z3i::SCell>::iterator it=vectBdrySCellALL.begin();
108 it!= vectBdrySCellALL.end(); it++){
115 cmap_grad.addColor(
Color( 255, 0, 0 ) );
116 cmap_grad.addColor(
Color( 255, 255, 10 ) );
119 viewer << Viewer3D::shiftSurfelVisu;
120 viewer <<
SetMode3D((*(vectBdrySCell2.begin())).className(),
"");
121 viewer.setFillColor(
Color(180, 200, 25, 255));
124 for( std::vector<Z3i::SCell>::iterator it=vectBdrySCell2.begin();
125 it!= vectBdrySCell2.end(); it++){
126 Color col= cmap_grad(d);
134 cmap_grad2.addColor(
Color( 255, 0, 0 ) );
135 cmap_grad2.addColor(
Color( 255, 255, 10 ) );
138 for( std::vector<Z3i::SCell>::iterator it=vectBdrySCell.begin();
139 it!= vectBdrySCell.end(); it++){
140 Color col= cmap_grad2(d);
147 viewer << Viewer3D::shiftSurfelVisu;
148 viewer.setFillColor(
Color(18, 200, 25, 255));
150 viewer << Viewer3D::updateDisplay;
152 return application.exec();