32 #include "DGtal/base/Common.h" 34 #include "DGtal/helpers/StdDefs.h" 35 #include "DGtal/topology/KhalimskySpaceND.h" 36 #include "DGtal/topology/helpers/Surfaces.h" 38 #include "DGtal/io/viewers/Viewer3D.h" 39 #include "DGtal/io/readers/VolReader.h" 40 #include "DGtal/io/DrawWithDisplay3DModifier.h" 41 #include "DGtal/images/ImageSelector.h" 42 #include "DGtal/images/imagesSetsUtils/SetFromImage.h" 43 #include "DGtal/io/Color.h" 44 #include "DGtal/io/colormaps/GradientColorMap.h" 46 #include "ConfigExamples.h" 50 using namespace DGtal;
53 int main(
int argc,
char** argv )
57 QApplication application(argc,argv);
60 std::string inputFilename = examplesPath +
"samples/cat10.vol";
67 bool space_ok = ks.
init( image.domain().lowerBound(), image.domain().upperBound(), true );
71 trace.
error() <<
"Error in the Khamisky space construction."<<std::endl;
75 std::vector<Z3i::SCell> vectBdrySCell;
76 std::vector<Z3i::SCell> vectBdrySCell2;
77 std::set<Z3i::SCell> vectBdrySCellALL;
84 trace.
info() <<
"Tracking Boundary.."<<std::endl;
87 ks,SAdj, set3d, aCell );
91 ks, *(ks.sDirs( aCell )), SAdj,
96 ks, *(++(ks.sDirs( aCell ))), SAdj,
105 trace.
info() <<
"Displaying the surfels.."<<std::endl;
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<Z3i::Space,Z3i::KSpace>::shiftSurfelVisu;
120 viewer <<
SetMode3D((*(vectBdrySCell2.begin())).className(),
"");
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 ) );
136 viewer << Viewer3D<>::shiftSurfelVisu;
139 for( std::vector<Z3i::SCell>::iterator it=vectBdrySCell.begin();
140 it!= vectBdrySCell.end(); it++){
141 Color col= cmap_grad2(d);
153 return application.exec();
virtual void setFillColor(DGtal::Color aColor)
void beginBlock(const std::string &keyword="")
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
Aim: A utility class for constructing surfaces (i.e. set of (n-1)-cells).
void addColor(const Color &color)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
bool init(const Point &lower, const Point &upper, bool isClosed)
Aim: implements methods to read a "Vol" file format.
int main(int argc, char **argv)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: Define utilities to convert a digital set into an image.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value...
ImageContainerBySTLVector< Domain, Value > Image
const Domain & domain() const
Structure representing an RGB triple with alpha component.
void green(const unsigned char aGreenValue)
void red(const unsigned char aRedValue)
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex...
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.
void blue(const unsigned char aBlueValue)