42 #include "ConfigExamples.h"
43 #include "DGtal/helpers/StdDefs.h"
44 #include "DGtal/base/Common.h"
47 #include "DGtal/kernel/BasicPointFunctors.h"
48 #include "DGtal/images/ConstImageAdapter.h"
51 #include "DGtal/images/ImageContainerBySTLVector.h"
53 #include "DGtal/io/readers/GenericReader.h"
54 #include "DGtal/io/writers/GenericWriter.h"
59 using namespace DGtal;
86 std::string imageFilename3D = examplesPath +
"samples/Al.100.vol";
87 std::string imageFilename2D = examplesPath +
"samples/church.pgm";
91 for (
unsigned int i=1; i<=20; i*=2){
92 std::vector<Z2i::Domain::Size> aGridSize2D;
93 aGridSize2D.push_back(i);
94 aGridSize2D.push_back(i);
104 ConstImageAdapterForSubSampling subsampledImage2D (image2D, subSampledDomain2D, subSampler2D, df);
107 stringstream outputname;
108 outputname <<
"subSampledImage"<< i<<
"x"<< i <<
".pgm" ;
112 trace.
info() <<
"Exporting 2D subsampled image by grid size :" << i <<
"x"<< i<<
" in "<< outputname.str() << std::endl;
115 for (
unsigned int i=1; i<=20; i*=2){
116 std::vector<Z3i::Domain::Size> aGridSize3D;
117 aGridSize3D.push_back(i);
118 aGridSize3D.push_back(i);
119 aGridSize3D.push_back(i);
130 ConstImageAdapterForSubSampling3D subsampledImage3D (image3D, subSampledDomain3D, subSampler3D, df);
133 stringstream outputname3D;
134 outputname3D <<
"subSampledImage3D"<< i<<
"x"<< i <<
".vol" ;
138 trace.
info() <<
"Exporting 3D subsampled image by grid size :" << i <<
"x"<< i<<
"x"<< i<<
" in "<< outputname3D.str() << std::endl;
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
void beginBlock(const std::string &keyword="")
Aim: Functor that subsamples an initial domain by given a grid size and a shift vector....
const TDomain & getSubSampledDomain()
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Provide a mechanism to load with the bestloader according to an image (2D or 3D) filename (by pa...
Aim: Provide a mechanism to save image (2D or 3D) into file with the best saver loader according to a...
Aim: Define a simple default functor that just returns its argument.
HyperRectDomain< Space > Domain