24 #ifndef CFORMAT_DOUBLE_DOUBLE
25 #define CFORMAT_DOUBLE_DOUBLE
45 this->class_name =
"Format : double double";
49 virtual void exec(
int argc,
char *argv[])
53 std::string ofile = cimg_option(
"-o",
"./",
"ofile");
61 pSequence->init(argc, argv);
63 for (
int s=0; s<pImage->num_samples(); s++)
68 pImage->exec(argc, argv, s);
71 if (pImage->m_mode != DEPENDENT){pSequence->m_modes.clear();}
72 pSequence->exec(argc, argv, *pImage);
74 this->
save(*pSequence, *pImage, ofile, frame_number);
78 CImg<T> res(pSequence->m_meanRes.size(),1,1,1,0);
79 cimg_forX(res,step){res[step] = pSequence->m_meanRes[step];}
80 pImage->
save_netcdf(res, ofile +
"residue_mean", 0);
82 std::cout<<
"calcul done\n";
92 std::cout<<
"-------------------------------\n";
93 std::cout<<
"\n\nData saving\n\n";
94 std::cout<<
"-------------------------------\n";
97 std::string sample_string;
98 std::ostringstream sample_index;
100 oImage.
save_netcdf(oSequence.m_modes, ofile +
"modes", s);
103 if (!oSequence.m_correlograms.is_empty())
105 if (oImage.m_oFormat!=
"tiff")
107 oImage.
save_netcdf(oSequence.m_correlograms, ofile +
"correlograms", s);
111 sample_index.width(5);
112 sample_index.fill(
'0');
115 sample_string = ofile +
"correlograms_"+sample_index.str()+
".tiff";
116 oSequence.m_correlograms.save_tiff(sample_string.c_str());
118 sample_index.str(
"");
124 if (!oSequence.m_residues.is_empty())
126 if (oImage.m_oFormat!=
"tiff")
128 oImage.
save_netcdf(oSequence.m_residues, ofile +
"residue", s);
133 sample_index.width(5);
134 sample_index.fill(
'0');
137 sample_string = ofile +
"residue_"+sample_index.str()+
".tiff";
139 oSequence.m_residues.save_tiff(sample_string.c_str());
141 sample_index.str(
"");
146 if (!oSequence.m_deformed.is_empty())
148 if (oImage.m_oFormat!=
"tiff")
150 oImage.
save_netcdf(oSequence.m_deformed, ofile +
"deform", s);
154 sample_index.width(5);
155 sample_index.fill(
'0');
158 sample_string = ofile +
"deform_"+sample_index.str()+
".tiff";
160 oSequence.m_deformed.save_tiff(sample_string.c_str());
162 sample_index.str(
"");
166 if (!oSequence.m_fields.is_empty())
168 if (oImage.m_oFormat!=
"tiff")
170 oImage.
save_netcdf(oSequence.m_fields, ofile +
"fields", s);
174 cimglist_for(oSequence.m_fields, l)
177 sample_index.width(5);
178 sample_index.fill(
'0');
181 if(l == 0){sample_string = ofile +
"U_"+sample_index.str()+
".tiff";}
182 if(l == 1){sample_string = ofile +
"V_"+sample_index.str()+
".tiff";}
183 if(l == 2){sample_string = ofile +
"W_"+sample_index.str()+
".tiff";}
185 oSequence.m_fields[l].save_tiff(sample_string.c_str());
187 sample_index.str(
"");
195 if (!oSequence.m_node.is_empty() and s == 0)
197 if (oImage.m_oFormat!=
"tiff")
199 oImage.
save_netcdf(oSequence.m_node, ofile +
"nodes", s);
203 cimglist_for(oSequence.m_node, l)
206 if(l == 0){sample_string = ofile +
"X.tiff";}
207 if(l == 1){sample_string = ofile +
"Y.tiff";}
208 if(l == 2){sample_string = ofile +
"Z.tiff";}
210 oSequence.m_node[l].save_tiff(sample_string.c_str());
217 if (!oImage.m_mask.is_empty() and s == 0)
220 CImg<int> msk(oImage.m_mask.get_resize(oSequence.m_node[0],1));
222 if (oImage.m_oFormat!=
"tiff")
228 sample_string = ofile +
"mask_modes_"+
".tiff";
229 msk.save_tiff(sample_string.c_str());
Definition: Csequence.h:62
void save_netcdf(CImgList< T > &img, std::string name="images", const int &sample=0) const
Definition: Cimage.h:295
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