32 #include "DGtal/base/Common.h"
33 #include "DGtal/images/ImageContainerBySTLVector.h"
34 #include "DGtal/io/readers/GenericReader.h"
35 #include "DGtal/helpers/StdDefs.h"
36 #include "ConfigTest.h"
53 unsigned int nbok = 0;
71 std::string filenameImage1 = testPath +
"samples/cat10.vol";
80 nbok += (size0Img1==40 && size1Img1==40 && size2Img1==40) ? 1 : 0;
82 std::string filenameImage0 = testPath +
"samples/test.longvol";
91 nbok += (size0Img0==16 && size1Img0==16 && size2Img0==16) ? 1 : 0;
93 std::string filenameImage2 = testPath +
"samples/cat10.pgm3d";
102 nbok += (size0Img2==40 && size1Img2==40 && size2Img2==40) ? 1 : 0;
108 domain2 = anImportedImage2.domain();
112 DGtal::trace.
info()<<
"Pgm3D image read (with scale functor) : size[0]:" << size0Img2 ;
115 nbok += (size0Img2==40 && size1Img2==40 && size2Img2==40) ? 1 : 0;
120 std::string filenameImageh5 = testPath +
"samples/cat10.h5";
129 nbok += (size0Imgh5==40 && size1Imgh5==40 && size2Imgh5==40) ? 1 : 0;
132 std::string filenameImage3 = testPath +
"samples/contourS.pgm";
140 nbok += (size0Img3==185 && size1Img3==85 ) ? 1 : 0;
143 std::string filenameImage4 = testPath +
"samples/raw32bits5x5x5.raw";
153 nbok += (size0Img4==5 && size1Img4==5 && size2Img4==5 && anImportedImage4(
DGtal::Z3i::Point(2,3,4))==250000*2*3*4) ? 1 : 0;
156 std::string filenameImage5 = testPath +
"samples/raw32bits5x5.raw";
164 nbok += (size0Img5==5 && size1Img5==5 && anImportedImage5(
DGtal::Z2i::Point(2,3))==250000*2*3*4) ? 1 : 0;
168 std::string filenameImage6 = testPath +
"samples/lobsterCroped16b.mhd";
170 RescalFCT2 resc2 = RescalFCT2( 0, 65535, 0, 255 );
171 Image3D anImportedImage6 =
175 unsigned int size0Img6 =
177 unsigned int size1Img6 =
179 unsigned int size2Img6 =
186 <<
" (should be" << resc2( 60400 ) << std::endl;
188 ( size0Img6 == 51 && size1Img6 == 91 && size2Img6 == 31 &&
194 Image3D16bits anImportedImage7 =
198 <<
" (should be" << 60400 <<
" )" << std::endl;
213 int main(
int argc,
char** argv )
217 for (
int i = 0; i < argc; ++i )
const Point & lowerBound() const
const Point & upperBound() const
void beginBlock(const std::string &keyword="")
static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
static TContainer importWithValueFunctor(const std::string &filename, const TFunctor &aFunctor, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
Aim: Functor allowing to rescale a value. Values of the initial scale [initMin,initMax] are rescaled ...
int main(int argc, char **argv)