29 #include <DGtal/base/Common.h>
30 #include <DGtal/io/readers/HDF5Reader.h>
31 #include <DGtal/io/writers/VolWriter.h>
32 #include <DGtal/helpers/StdDefs.h>
33 #include <DGtal/images/Image.h>
34 #include <DGtal/images/ImageContainerBySTLVector.h>
40 using namespace DGtal;
78 void missingParam ( std::string param )
80 trace.error() <<
" Parameter: "<<param<<
" is required..";
81 trace.info() <<std::endl;
86 int main(
int argc,
char**argv)
91 std::string inputFileName;
92 std::string outputFileName {
"result.vol"};
94 app.description(
"Convert a 3D 8-bit HDF5 file to vol.");
95 app.add_option(
"-i,--input,1", inputFileName,
"Input HDF5 file." )
97 ->check(CLI::ExistingFile);
98 app.add_option(
"-o,--output,2", outputFileName,
"Output vol filename.",
true );
100 app.get_formatter()->column_width(40);
101 CLI11_PARSE(app, argc, argv);
104 typedef ImageContainerBySTLVector<Z3i::Domain, unsigned char> MyImageC;
106 MyImageC imageC = HDF5Reader< MyImageC >::importHDF5_3D( inputFileName,
"/UInt8Array3D" );
107 bool res = VolWriter< MyImageC>::exportVol(outputFileName, imageC);
113 trace.error()<<
"Error while exporting the volume."<<std::endl;