YaDICs  V04.14.a
Yet another Digital Image Correlation software: platform dedicated to 2/3D Fluid and Solid kinematics field measurements.
 All Classes Files Functions Variables Pages
Cformat_char_double.h
Go to the documentation of this file.
1 /**********************************************************************
2  * Copyright (C) 2012, The YaDICs Project Developers.
3  * See the COPYRIGHT file at the top-level directory of this distribution ./COPYRIGHT.
4  * See ./COPYING file for copying and redistribution conditions.
5  *
6  * This file is part of YaDICs.
7  * YaDICs is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * YaDICs is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with YaDICs. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Information about how to use the software are provided at http://yadic.univ-lille1.fr/
21  **********************************************************************/
22 
23 
24 #ifndef CFORMAT_CHAR_FLOAT
25 #define CFORMAT_CHAR_FLOAT
26 
35 #include "Cformat.h"
36 
38 {
39 
40 
42  {// constructor
43 
44  class_name = "Format : char double";
45 
46  }
47 
48  virtual void exec(int argc, char *argv[])
49  {
50 
51  //output name
52  std::string ofile = cimg_option("-o","./","ofile");
53 
54  //create image container object
55  Cimage_factory<char> image_factory("image_list");
56  Cimage<char>* pImage = image_factory.create(argc,argv);
57 
58  //create sequence correlation object
60  pSequence->init(argc, argv);
61 
62  for (int s=0; s<pImage->num_samples(); s++)
63  {
64 
65  frame_number = s;
66 
67  pImage->exec(argc, argv, s);//load images
68 
69  //Test if the image sequence is (A-B, B-C...) or (A-B, C-D...) as in PIV. In the last case, pSequence->m_dataField must be clear. Otherwise, the second correlation sequence will be treated with the previous field as init.
70  if (pImage->m_mode != DEPENDENT){pSequence->m_modes.clear();}
71  pSequence->exec(argc, argv, *pImage);//perform correlation sequences
72 
73  save(*pSequence, *pImage, ofile, s);
74 
75  }//end image list
76 
77  CImg<T> res(pSequence->m_meanRes.size(),1,1,1,0);
78  cimg_forX(res,step){res[step] = pSequence->m_meanRes[step];}
79  pImage->save_netcdf(res, ofile + "residue_mean", 0);
80 
81  std::cout<<"calcul done\n";
82 
83  delete pImage;
84  delete pSequence;
85 
86  }
87 
88 
89 
90 
91 };
92 
93 #endif
94 
Definition: Csequence.h:62
void save_netcdf(CImgList< T > &img, std::string name="images", const int &sample=0) const
Definition: Cimage.h:295
Definition: Cformat_char_double.h:37
Definition: Cimage.h:57
It returns a pointer toward a specific Image loader class according to a parameter.nc file. The parameter file is set by default or could be provide by command line. create function could be called using : int, string = type, CParameterNetCDF, and finally [argv,argc] !!!! The function to get parameters directly from command line doesn't work yet.
Definition: Cimage_factory.h:61