29 #define cimg_plugin "plugins/add_fileformat.h"
30 #define cimg_use_netcdf
32 #ifdef cimg_use_netcdf
33 #include "../NetCDF.Tool/struct_parameter_NetCDF.h"
36 #define cimg_plugin2 "plugins/netcdf_file_format4CImg2.h"
37 #define cimglist_plugin2 "plugins/netcdf_file_format4CImgList2.h"
38 #include "../CImg.Tool/CImg_NetCDF.h"
43 #include "Cmesh_factory.h"
44 #include "CshapeFunction_factory.h"
50 template<
typename T,
typename Timg>
56 std::string class_name;
60 int num_dim, m_threadNB;
63 const char* m_paramPath;
71 std::vector<T> m_meanRes;
82 class_name =
"Field : mother";
86 m_threadNB = omp_get_num_threads();
98 virtual void init(CParameterNetCDF &fp) = 0;
105 if (oImage.m_storeDef){m_def.assign(oImage.cur_dim(0), oImage.cur_dim(1), oImage.cur_dim(2), oImage.cur_dim(3), 0);}
106 if (oImage.m_storeRes){m_res.assign(oImage.cur_dim(0), oImage.cur_dim(1), oImage.cur_dim(2), oImage.cur_dim(3), 0);}
107 if (oImage.m_storeField){m_field.assign(oMesh.num_var(), oImage.cur_dim(0), oImage.cur_dim(1), oImage.cur_dim(2), oImage.cur_dim(3), 0);}
111 if (!modes_prev.is_empty())
114 if (this->m_verbose){printf(
"Data projection\n");}
115 project(oMesh, oImage, modes_prev, oShape_prev, ref_prev, nodes_prev, this->m_mode);
120 if (this->m_verbose){printf(
"The data are initialized to zero\n");}
134 return m_mode.size();
138 int grid_dims(
const int &i)
143 case 0:
return m_mode[0].width();
break;
144 case 1:
return m_mode[0].height();
break;
145 case 2:
return m_mode[0].depth();
break;
146 case 3:
return m_mode[0].spectrum();
break;
149 std::cerr<<class_name<<
"::"<<__func__<<
": error: id="<<i<<
" is unknown as CImg dimensions\n"<<std::flush;
load image and mask from cdl and store fields. It also creates a resized version of data in the case ...
virtual void exec(const Cimage< Timg > &oImage, const Cmesh< T, Timg > &oMesh, CImgList< T > &modes_prev, CshapeFunction< T, Timg > &oShape_prev, const std::vector< T > &ref_prev, const CImgList< T > &nodes_prev)
Definition: Cfield.h:100
This is the mother class of shape function objets (virtual pure).
Definition: CshapeFunction.h:48
CImg< T > m_correlogram
to improve, they shouldn't be here//
Definition: Cfield.h:74