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;
63 for(
unsigned int i =0; i< 5; i++){
64 for(
unsigned int j =0; j< 5; j++){
65 for(
unsigned int k =0; k< 5; k++){
71 for(
unsigned int i =0; i< 5; i++){
72 for(
unsigned int j =0; j< 5; j++){
73 for(
unsigned int k =0; k< 5; k++){
79 for(
unsigned int i =0; i< 5; i++){
80 for(
unsigned int j =0; j< 5; j++){
88 for(
unsigned int i =0; i<= 255; i++){
89 for(
unsigned int j =0; j<= 255; j++){
96 std::string filenameImage1 = testPath +
"samples/cat10.pgm3d";
100 trace.
info() <<
"Testing writing PGM3D ... ";
101 bool ok1 = anImportedImage1>>
"testGenericWriter.pgm3d";
106 trace.
info() <<
"Testing writing HDF5 3D ... ";
107 okh5 = anImportedImage1 >>
"testGenericWriter.h5";
109 trace.
info() <<
"Testing writing HDF5 3D (bis) ... ";
114 trace.
info() <<
"Testing writing vol ... ";
115 bool ok2 = anImportedImage1 >>
"testGenericWriter.vol";
117 trace.
info() <<
"Testing writing longvol ... ";
118 bool ok2bis = an64bitsImage3D >>
"testGenericWriter.longvol";
120 trace.
info() <<
"Testing writing raw ... ";
121 bool ok3 = anImportedImage1 >>
"testGenericWriter.raw";
123 trace.
info() <<
"Testing writing raw (bis) ... ";
129 trace.
info() <<
"Testing writing ITK (" << ext <<
") ... ";
130 if( ext != std::string(
"gz") )
132 okITK &= anImportedImage1 >> (std::string(
"testGenericWriter.") + ext);
136 trace.
info() <<
"Testing writing ITK (.nii.gz) ... ";
137 okITK &= anImportedImage1 >>
"testGenericWriter.nii.gz";
141 std::string filenameImage2 = testPath +
"samples/contourS.pgm";
146 trace.
info() <<
"Testing writing pgm ... ";
147 bool ok4 = anImportedImage2 >>
"testGenericWriter.pgm";
149 trace.
info() <<
"Testing writing raw ... ";
150 bool ok5 = anImportedImage2 >>
"testGenericWriter.raw";
154 trace.
info() <<
"Testing writing color image writer ... ";
158 nbok += ((ok1 && okh5 && ok2 & ok2bis && ok3 && ok3bis && ok4 && ok5 && ok6 && ok7 && ok8 && okITK) ? 1 : 0);
160 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
161 <<
"true == true" << std::endl;
170 int main(
int argc,
char** argv )
174 for (
int i = 0; i < argc; ++i )
179 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Structure representing an RGB triple with alpha component.
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
const auto ITK_IO_IMAGE_EXT
static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
static bool exportFile(const std::string &filename, const TContainer &anImage, const TFunctor &aFunctor=TFunctor())
int main(int argc, char **argv)