24 #ifndef CFORMAT_FLOAT_FLOAT
25 #define CFORMAT_FLOAT_FLOAT
45 this->class_name =
"Format : float float";
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;
101 oImage.
save_netcdf(oSequence.m_modes, ofile +
"modes", s);
104 if (!oSequence.m_correlograms.is_empty())
106 if (oImage.m_oFormat!=
"tiff")
108 oImage.
save_netcdf(oSequence.m_correlograms, ofile +
"correlograms", s);
112 sample_index.width(5);
113 sample_index.fill(
'0');
116 sample_string = ofile +
"correlograms_"+sample_index.str()+
".tiff";
117 oSequence.m_correlograms.save_tiff(sample_string.c_str());
119 sample_index.str(
"");
125 if (!oSequence.m_residues.is_empty())
127 if (oImage.m_oFormat!=
"tiff")
129 oImage.
save_netcdf(oSequence.m_residues, ofile +
"residue", s);
134 sample_index.width(5);
135 sample_index.fill(
'0');
138 sample_string = ofile +
"residue_"+sample_index.str()+
".tiff";
140 oSequence.m_residues.save_tiff(sample_string.c_str());
142 sample_index.str(
"");
147 if (!oSequence.m_deformed.is_empty())
149 if (oImage.m_oFormat!=
"tiff")
151 oImage.
save_netcdf(oSequence.m_deformed, ofile +
"deform", s);
155 sample_index.width(5);
156 sample_index.fill(
'0');
159 sample_string = ofile +
"deform_"+sample_index.str()+
".tiff";
161 oSequence.m_deformed.save_tiff(sample_string.c_str());
163 sample_index.str(
"");
167 if (!oSequence.m_fields.is_empty())
169 if (oImage.m_oFormat!=
"tiff")
171 oImage.
save_netcdf(oSequence.m_fields, ofile +
"fields", s);
175 cimglist_for(oSequence.m_fields, l)
178 sample_index.width(5);
179 sample_index.fill(
'0');
182 if(l == 0){sample_string = ofile +
"U_"+sample_index.str()+
".tiff";}
183 if(l == 1){sample_string = ofile +
"V_"+sample_index.str()+
".tiff";}
184 if(l == 2){sample_string = ofile +
"W_"+sample_index.str()+
".tiff";}
186 oSequence.m_fields[l].save_tiff(sample_string.c_str());
188 sample_index.str(
"");
196 if (!oSequence.m_node.is_empty() and s == 0)
198 if (oImage.m_oFormat!=
"tiff")
200 oImage.
save_netcdf(oSequence.m_node, ofile +
"nodes", s);
204 cimglist_for(oSequence.m_node, l)
207 if(l == 0){sample_string = ofile +
"X.tiff";}
208 if(l == 1){sample_string = ofile +
"Y.tiff";}
209 if(l == 2){sample_string = ofile +
"Z.tiff";}
211 oSequence.m_node[l].save_tiff(sample_string.c_str());
218 if (!oImage.m_mask.is_empty() and s == 0)
221 CImg<int> msk(oImage.m_mask.get_resize(oSequence.m_node[0],1));
223 if (oImage.m_oFormat!=
"tiff")
229 sample_string = ofile +
"mask_modes_"+
".tiff";
230 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