31 #include "DGtal/base/Common.h"
32 #include "DGtal/helpers/StdDefs.h"
34 #include "DGtal/io/readers/GenericReader.h"
35 #include "DGtal/io/writers/GenericWriter.h"
40 using namespace DGtal;
77 int main(
int argc,
char** argv )
79 typedef ImageContainerBySTLVector < Z3i::Domain, unsigned char> Image3D;
83 std::string inputFileName;
84 std::string outputFileName {
"result.vol"};
86 app.description(
"Convert volumetric file into volumetric file from different formats (pgm3d, vol, longvol)\n ");
87 app.add_option(
"-i,--input,1", inputFileName,
"volumetric file (.pgm3d, .vol, .longvol)." )
89 ->check(CLI::ExistingFile);
90 app.add_option(
"-o,--output,2", outputFileName,
"volumetric file (.pgm3d, .vol, .longvol)",
true);
92 app.get_formatter()->column_width(40);
93 CLI11_PARSE(app, argc, argv);
96 trace.info() <<
"Reading input file " << inputFileName ;
97 Image3D inputImage = DGtal::GenericReader<Image3D>::import(inputFileName);
98 trace.info() <<
" [done] " << std::endl ;
99 trace.info() <<
"Writing output file " << outputFileName ;
100 DGtal::GenericWriter<Image3D>::exportFile(outputFileName, inputImage);
101 trace.info() <<
" [done] " << std::endl ;