Example of 2D slice 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"
{
typedef ImageSelector < Z3i::Domain, unsigned char>::Type Image3D;
typedef ImageSelector < Z2i::Domain, unsigned char>::Type Image2D;
std::string filename = examplesPath + "samples/lobster.vol";
proj(image.domain().upperBound()));
trace.
beginBlock (
"Example extract2DImagesFrom3D" );
for (unsigned int i=0; i<30; i+=10){
std::stringstream name;
name << "lobsterSliceZ_" << i << ".pgm";
SliceImageAdapter sliceImageZ(image,
domain, aSliceFunctor, idV);
}
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="")
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Export a 2D and a 3D Image using the Netpbm PGM formats (ASCII mode).
Aim: implements methods to read a "Vol" file format.
Aim: Define a simple default functor that just returns its argument.
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...
void initAddOneDim(const Dimension &newDim)