32 #include "DGtal/base/Common.h" 33 #include "DGtal/images/ImageContainerBySTLVector.h" 34 #include "DGtal/io/readers/GenericReader.h" 35 #include "DGtal/io/writers/GenericWriter.h" 36 #include "DGtal/helpers/StdDefs.h" 37 #include "ConfigTest.h" 42 using namespace DGtal;
53 unsigned int nbok = 0;
61 for(
unsigned int i =0; i< 5; i++){
62 for(
unsigned int j =0; j< 5; j++){
63 for(
unsigned int k =0; k< 5; k++){
69 for(
unsigned int i =0; i< 5; i++){
70 for(
unsigned int j =0; j< 5; j++){
76 std::string filenameImage1 = testPath +
"samples/cat10.pgm3d";
80 trace.
info() <<
"Testing writing PGM3D ... ";
81 bool ok1 = anImportedImage1>>
"testGenericWriter.pgm3d";
87 trace.
info() <<
"Testing writing HDF5 3D ... ";
88 okh5 = anImportedImage1 >>
"testGenericWriter.h5";
90 trace.
info() <<
"Testing writing HDF5 3D (bis) ... ";
95 trace.
info() <<
"Testing writing vol ... ";
96 bool ok2 = anImportedImage1 >>
"testGenericWriter.vol";
98 trace.
info() <<
"Testing writing raw ... ";
99 bool ok3 = anImportedImage1 >>
"testGenericWriter.raw";
101 trace.
info() <<
"Testing writing raw (bis) ... ";
105 std::string filenameImage2 = testPath +
"samples/contourS.pgm";
110 trace.
info() <<
"Testing writing pgm ... ";
111 bool ok4 = anImportedImage2 >>
"testGenericWriter.pgm";
113 trace.
info() <<
"Testing writing raw ... ";
114 bool ok5 = anImportedImage2 >>
"testGenericWriter.raw";
123 nbok += ok1 && okh5 && okh5bis && ok2 && ok3 && ok3bis && ok4 & ok5 & ok6 & ok7 ? 1 : 0;
125 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " 126 <<
"true == true" << std::endl;
135 int main(
int argc,
char** argv )
139 for (
int i = 0; i < argc; ++i )
144 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void beginBlock(const std::string &keyword="")
static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
DGtal is the top-level namespace which contains all DGtal functions and types.
static bool exportFile(const std::string &filename, const TContainer &anImage, const TFunctor &aFunctor=TFunctor())
int main(int argc, char **argv)