32 #include "DGtal/base/Common.h"
34 #include "ConfigExamples.h"
37 #include "DGtal/images/ImageContainerBySTLVector.h"
38 #include "DGtal/images/ImageContainerBySTLMap.h"
39 #include "DGtal/base/BasicFunctors.h"
40 #include "DGtal/kernel/BasicPointPredicates.h"
43 #include "DGtal/io/readers/VolReader.h"
44 #include "DGtal/io/writers/VolWriter.h"
47 #include "DGtal/topology/SurfelAdjacency.h"
48 #include "DGtal/topology/helpers/FrontierPredicate.h"
49 #include "DGtal/topology/LightExplicitDigitalSurface.h"
52 #include "DGtal/geometry/volumes/distance/FMM.h"
57 using namespace DGtal;
64 int main(
int argc,
char** argv )
68 for (
int i = 0; i < argc; ++i )
75 string imageFileName = examplesPath +
"samples/cat10.vol";
76 trace.
info() << imageFileName <<std::endl;
95 trace.
info() <<
"starting bel: " << bel << std::endl;
98 trace.
emphase() <<
"starting bel not found" << std::endl;
112 std::pair<Point,Point> bpair = toIncidentPoints( bel );
113 SurfelPredicate surfelPredicate( ks, binaryImage,
114 binaryImage( bpair.first ),
115 binaryImage( bpair.second ) );
116 Frontier frontier( ks, surfelPredicate,
122 const double maximalDistance = 3.0;
133 DistanceImage imageDistance(
domain, 0.0 );
134 AcceptedPointSet pointSet( imageDistance );
136 for (Frontier::SurfelConstIterator it = frontier.begin(), itEnd = frontier.end();
139 pointSet.insert( toInnerPoint(*it) );
140 imageDistance.setValue( toInnerPoint(*it), 0.5 );
145 FMM fmm( imageDistance, pointSet, binaryImage,
154 trace.
info() <<
"Erosion of radius: " << maximalDistance << std::endl;
160 binaryImage.setValue(*it, 0);
169 string outputFileName =
"eroded.vol";
170 trace.
info() <<
"to " << outputFileName << std::endl;
int main(int argc, char **argv)
Aim: An adapter for viewing an associative image container like ImageContainerBySTLMap as a simple di...
Aim: Fast Marching Method (FMM) for nd distance transforms.
const Point & lowerBound() const
const Point & upperBound() 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.
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels....
Aim: A utility class for constructing surfaces (i.e. set of (n-1)-cells).
void beginBlock(const std::string &keyword="")
Aim: The predicate on surfels that represents the frontier between two regions in an image....
Aim: transforms a signed cell c into a pair of points corresponding to the signed cells of greater di...
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Aim: implements methods to read a "Vol" file format.
Aim: Export a 3D Image using the Vol formats.