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"
67 typedef ImageContainerBySTLVector < Z2i::Domain, unsigned char> Image2D;
76 typedef ImageContainerBySTLVector < Z3i::Domain, unsigned char> Image3D;
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.
static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
static bool exportFile(const std::string &filename, const TContainer &anImage, const TFunctor &aFunctor=TFunctor())
Aim: Define a simple default functor that just returns its argument.