Example of 2D images extraction from 3D images.
#include <iostream>
#include <sstream>
#include "DGtal/kernel/BasicPointFunctors.h"
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/io/writers/PGMWriter.h"
#include "DGtal/images/ImageSelector.h"
#include "DGtal/images/ConstImageAdapter.h"
#include "ConfigExamples.h"
using namespace std;
{
typedef ImageSelector < Z3i::Domain, unsigned char>::Type Image3D;
static_cast<int>((ptUpper2-origin).norm())));
std::string filename = examplesPath + "samples/lobster.vol";
Image3D image = VolReader<Image3D>::importVol( filename );
for (unsigned int i=0; i<30; i+=10){
std::stringstream name;
name << "lobsterExtracted_" << i << ".pgm";
std::stringstream name2;
name2 << "lobsterExtracted_" << i << "V2.pgm";
ImageAdapterExtractor extractedImage(image, domainImage2D, embedder, idV);
ImageAdapterExtractor extractedImage2(image, domainImage2D2, embedder2, idV);
PGMWriter< ImageAdapterExtractor>::exportPGM(name.str(), extractedImage);
PGMWriter< ImageAdapterExtractor>::exportPGM(name2.str(), extractedImage2);
}
return 0;
}
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 embeds a 2D point into a 3D space from two axis vectors and an origin point given i...
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Define a simple default functor that just returns its argument.
int main(int argc, char **argv)