comparison src/Main/AIMCopy_SSI_Features_v3.cc @ 160:747ba38b4b1b

- AIMCopy v5 for just smooth NAP features - Reporting of all modules and versions
author tomwalters
date Sun, 11 Jul 2010 03:46:06 +0000
parents 41640b18c99c
children 396d04878221
comparison
equal deleted inserted replaced
159:64c3f4e25877 160:747ba38b4b1b
69 string data_file; 69 string data_file;
70 string config_file; 70 string config_file;
71 string script_file; 71 string script_file;
72 bool write_data = false; 72 bool write_data = false;
73 bool print_version = false; 73 bool print_version = false;
74 bool load_params = false;
75 74
76 string version_string( 75 string version_string(
77 " AIM-C AIMCopy\n" 76 " AIM-C AIMCopy\n"
78 " (c) 2006-2010, Thomas Walters and Willem van Engen\n" 77 " (c) 2006-2010, Thomas Walters and Willem van Engen\n"
79 " http://www.acoustiscale.org/AIMC/\n" 78 " http://www.acoustiscale.org/AIMC/\n"
106 if (++i >= argc) { 105 if (++i >= argc) {
107 aimc::LOG_ERROR(_T("Configuration file name expected after -C")); 106 aimc::LOG_ERROR(_T("Configuration file name expected after -C"));
108 return(-1); 107 return(-1);
109 } 108 }
110 config_file = argv[i]; 109 config_file = argv[i];
111 load_params = true;
112 continue; 110 continue;
113 } 111 }
114 if (strcmp(argv[i],"-S") == 0) { 112 if (strcmp(argv[i],"-S") == 0) {
115 if (++i >= argc) { 113 if (++i >= argc) {
116 aimc::LOG_ERROR(_T("Script file name expected after -S")); 114 aimc::LOG_ERROR(_T("Script file name expected after -S"));
138 if (print_version) 136 if (print_version)
139 printf("%s", version_string.c_str()); 137 printf("%s", version_string.c_str());
140 138
141 aimc::Parameters params; 139 aimc::Parameters params;
142 140
143 if (load_params) { 141 if (!params.Load(config_file.c_str())) {
144 if (!params.Load(config_file.c_str())) { 142 aimc::LOG_ERROR(_T("Couldn't load parameters from file %s"),
145 aimc::LOG_ERROR(_T("Couldn't load parameters from file %s"), 143 config_file.c_str());
146 config_file.c_str()); 144 return -1;
147 return -1;
148 }
149 } 145 }
150 146
151 vector<pair<string, string> > file_list = aimc::FileList::Load(script_file); 147 vector<pair<string, string> > file_list = aimc::FileList::Load(script_file);
152 if (file_list.size() == 0) { 148 if (file_list.size() == 0) {
153 aimc::LOG_ERROR("No data read from file %s", script_file.c_str()); 149 aimc::LOG_ERROR("No data read from file %s", script_file.c_str());
261 257
262 for (unsigned int i = 0; i < file_list.size(); ++i) { 258 for (unsigned int i = 0; i < file_list.size(); ++i) {
263 // aimc::LOG_INFO(_T("In: %s"), file_list[i].first.c_str()); 259 // aimc::LOG_INFO(_T("In: %s"), file_list[i].first.c_str());
264 aimc::LOG_INFO(_T("Out: %s"), file_list[i].second.c_str()); 260 aimc::LOG_INFO(_T("Out: %s"), file_list[i].second.c_str());
265 261
266 string filename = file_list[i].second + "slice_1_no_cutoff"; 262 string filename = file_list[i].second + ".slice_1_no_cutoff";
267 output_ssi_slice1_no_cutoff.OpenFile(filename.c_str(), 10.0f); 263 output_ssi_slice1_no_cutoff.OpenFile(filename.c_str(), 10.0f);
268 filename = file_list[i].second + "ssi_profile_no_cutoff"; 264 filename = file_list[i].second + ".ssi_profile_no_cutoff";
269 output_ssi_all_no_cutoff.OpenFile(filename.c_str(), 10.0f); 265 output_ssi_all_no_cutoff.OpenFile(filename.c_str(), 10.0f);
270 filename = file_list[i].second + "slice_1_cutoff"; 266 filename = file_list[i].second + ".slice_1_cutoff";
271 output_ssi_slice1_cutoff.OpenFile(filename.c_str(), 10.0f); 267 output_ssi_slice1_cutoff.OpenFile(filename.c_str(), 10.0f);
272 filename = file_list[i].second + "ssi_profile_cutoff"; 268 filename = file_list[i].second + ".ssi_profile_cutoff";
273 output_ssi_all_cutoff.OpenFile(filename.c_str(), 10.0f); 269 output_ssi_all_cutoff.OpenFile(filename.c_str(), 10.0f);
274 filename = file_list[i].second + "smooth_nap_profile"; 270 filename = file_list[i].second + ".smooth_nap_profile";
275 nap_out.OpenFile(filename.c_str(), 10.0f); 271 nap_out.OpenFile(filename.c_str(), 10.0f);
276 272
277 if (input.LoadFile(file_list[i].first.c_str())) { 273 if (input.LoadFile(file_list[i].first.c_str())) {
278 input.Process(); 274 input.Process();
279 } else { 275 } else {