#include <iostream>
#include <DGtal/base/Common.h>
#include "DGtal/io/readers/GenericReader.h"
#include "DGtal/io/writers/GenericWriter.h"
#include <DGtal/helpers/StdDefs.h>
#include <DGtal/images/ImageContainerBySTLVector.h>
#include <DGtal/images/ConstImageAdapter.h>
#include "DGtal/kernel/BasicPointFunctors.h"
int main(
int argc,
char ** argv)
{
if(argc < 3)
{
trace.error() <<
"You need to indicate the volumetric image name and slice number as parameters." << std::endl;
trace.error() << std::endl;
return 1;
}
std::string filename(argv[1]);
std::string outputFileName = "sliceImage.pgm";
unsigned int numSlice = atoi(argv[2]);
trace.beginBlock(
"Loading file");
Z2i::Domain domain2D(proj(image3d.domain().lowerBound()),
proj(image3d.domain().upperBound()));
SliceImageAdapter sliceImageZ(image3d, domain2D, aSliceFunctor, id);
trace.beginBlock(
"Exporting...");
sliceImageZ >> outputFileName;
return 0;
}
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)