Particle Identification and Tracking
wrapper_i_generic.h
Go to the documentation of this file.
1 //Copyright 2012 Thomas A Caswell
2 //tcaswell@uchicago.edu
3 //http://jfi.uchicago.edu/~tcaswell
4 //
5 //This program is free software; you can redistribute it and/or modify
6 //it under the terms of the GNU General Public License as published by
7 //the Free Software Foundation; either version 3 of the License, or (at
8 //your option) any later version.
9 //
10 //This program is distributed in the hope that it will be useful, but
11 //WITHOUT ANY WARRANTY; without even the implied warranty of
12 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 //General Public License for more details.
14 //
15 //You should have received a copy of the GNU General Public License
16 //along with this program; if not, see <http://www.gnu.org/licenses>.
17 //
18 //Additional permission under GNU GPL version 3 section 7
19 //
20 //If you modify this Program, or any covered work, by linking or
21 //combining it with IPP (or a modified version of that library),
22 //containing parts covered by the terms of End User License Agreement
23 //for the Intel(R) Software Development Products, the licensors of
24 //this Program grant you additional permission to convey the resulting
25 //work.
26 //
27 //If you modify this Program, or any covered work, by linking or
28 //combining it with FreeImage (or a modified version of that library),
29 //containing parts covered by the terms of End User License Agreement
30 //for FreeImage Public License, the licensors of
31 //this Program grant you additional permission to convey the resulting
32 
33 #ifndef WRAPPER_I_PYTHON
34 #define WRAPPER_I_PYTHON
35 
36 
37 
38 #include <string>
39 #include <vector>
40 #include <map>
41 
42 #include "wrapper_i.h"
43 #include "data_map.h"
44 #include "part_def.h"
45 
46 namespace utilities{
67 private:
68 
73  std::set<utilities::D_TYPE> data_types_set_;
74 
87 
92  std::vector<std::vector<int*> > data_i_;
97  std::vector<std::vector<float*> > data_f_;
102  std::vector<std::vector<std::complex<float>*> > data_c_;
103 
107  std::vector<int> frame_c_;
111  unsigned int frame_count_;
112 
116  unsigned int total_part_count_;
117 
123  std::vector<float> frame_zdata_;
124 
128  bool locked_;
129 
130 
134  std::set<utilities::D_TYPE>* frame_added_datatypes_;
143 
148 
161 
165  void clean_data();
169  bool set_dims(const Tuplef & dim) ;
170 public:
171 
172 
173  int get_value(int& out,
174  int ind,D_TYPE type, int frame) const ;
175  float get_value(float& out,
176  int ind,D_TYPE type, int frame) const ;
177  std::complex<float> get_value(std::complex<float>& out,
178  int ind,D_TYPE type, int frame) const ;
179 
180  Tuplef get_dims() const;
181 
182  std::set<D_TYPE> get_data_types() const ;
183 
184 
185 
186  int get_num_entries(unsigned int frame) const ;
187  int get_num_entries() const ;
188 
189  int get_num_frames() const ;
190 
191  bool contains_type(D_TYPE type) const ;
192 
193 
194 
195 
196 
197 
198 
200 
205 
213  bool open_wrapper();
219  bool setup(const std::set<D_TYPE> &,int N,const Tuplef & );
220 
229  bool open_frame(unsigned int frame,int N,float z);
230 
236  bool set_data_type(D_TYPE dtype);
237 
241  bool clear_data_type();
261  bool add_int_data(int * data,int N);
278  bool add_float_data(float * data,int N);
279 
283  bool set_meta_data(const Md_store & md_store);
284 
288  bool close_frame();
289 
293  bool finalize_wrapper();
294 
295  /* @}
296  */
297 
298 };
299 
300 }
301 
302 #endif