33#include "DGtal/io/readers/VolReader.h"
34#include "DGtal/io/Color.h"
35#include "DGtal/io/colormaps/HueShadeColorMap.h"
36#include "DGtal/io/viewers/PolyscopeViewer.h"
37#include "DGtal/images/ImageSelector.h"
38#include "DGtal/images/imagesSetsUtils/SetFromImage.h"
39#include "DGtal/shapes/Shapes.h"
40#include "DGtal/helpers/StdDefs.h"
41#include "DGtal/topology/DigitalSurface.h"
42#include "DGtal/topology/LightImplicitDigitalSurface.h"
56 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <fileName.vol> <minT> <maxT>" << std::endl;
57 std::cerr <<
"\t - displays the boundary of the shape stored in vol file <fileName.vol>." << std::endl;
58 std::cerr <<
"\t - voxel v belongs to the shape iff its value I(v) follows minT <= I(v) <= maxT." << std::endl;
61int main(
int argc,
char** argv )
68 std::string inputFilename = argv[ 1 ];
69 unsigned int minThreshold = atoi( argv[ 2 ] );
70 unsigned int maxThreshold = atoi( argv[ 3 ] );
78 minThreshold, maxThreshold);
84 trace.
beginBlock(
"Construct the Khalimsky space from the image domain." );
90 trace.
error() <<
"Error in the Khamisky space construction."<<std::endl;
98 MySurfelAdjacency surfAdj(
true );
114 trace.
beginBlock(
"Extracting boundary by tracking from an initial bel." );
116 typedef MyBreadthFirstVisitor::Node MyNode;
117 typedef MyBreadthFirstVisitor::Size MySize;
118 MyBreadthFirstVisitor visitor( digSurf, bel );
119 unsigned long nbSurfels = 0;
121 while ( ! visitor.finished() )
123 node = visitor.current();
127 MySize maxDist = node.second;
134 MyBreadthFirstVisitor visitor2( digSurf, bel );
138 while ( ! visitor2.finished() )
140 node = visitor2.current();
144 trace.
info() <<
"nb surfels = " << nbSurfels << std::endl;
Aim: This class is useful to perform a breadth-first exploration of a graph given a starting point or...
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
Aim: implements association bewteen points lying in a digital domain and values.
const Domain & domain() const
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
Cell unsigns(const SCell &p) const
Creates an unsigned cell from a signed one.
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as the boundary of an impl...
void show() override
Starts the event loop and display of elements.
static SCell findABel(const KSpace &K, const PointPredicate &pp, unsigned int nbtries=1000)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
void beginBlock(const std::string &keyword="")
DigitalSurface< MyDigitalSurfaceContainer > MyDigitalSurface
DigitalSetBoundary< KSpace, DigitalSet > MyDigitalSurfaceContainer
DGtal is the top-level namespace which contains all DGtal functions and types.
ImageContainerBySTLVector< Domain, Value > Type
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.
static ImageContainer importVol(const std::string &filename, const Functor &aFunctor=Functor())
Attach a property to an element.