32#include <DGtal/base/Common.h>
33#include "DGtal/io/readers/GenericReader.h"
34#include "DGtal/io/writers/GenericWriter.h"
36#include <DGtal/helpers/StdDefs.h>
37#include <DGtal/images/ImageContainerBySTLVector.h>
38#include <DGtal/images/ConstImageAdapter.h>
41#include "DGtal/kernel/BasicPointFunctors.h"
49int main(
int argc,
char ** argv)
57 trace.error() <<
"You need to indicate the volumetric image name and slice number as parameters." << std::endl;
58 trace.error() << std::endl;
61 std::string filename(argv[1]);
62 std::string outputFileName =
"sliceImage.pgm";
64 unsigned int numSlice = atoi(argv[2]);
66 trace.beginBlock(
"Loading file");
74 Z2i::Domain domain2D(proj(image3d.domain().lowerBound()),
75 proj(image3d.domain().upperBound()));
79 SliceImageAdapter sliceImageZ(image3d, domain2D, aSliceFunctor,
id);
83 trace.beginBlock(
"Exporting...");
84 sliceImageZ >> outputFileName;
49int main(
int argc,
char ** argv) {
…}
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
Z2i this namespace gathers the standard of types for 2D imagery.
HyperRectDomain< Space > Domain
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 >())
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)