Particle Identification and Tracking
matlab_apps/include/wrapper_o_matlab.h
Go to the documentation of this file.
00001 //Copyright 2008,2009 Thomas A Caswell
00002 //tcaswell@uchicago.edu
00003 //http://jfi.uchicago.edu/~tcaswell
00004 //
00005 //This program is free software; you can redistribute it and/or modify
00006 //it under the terms of the GNU General Public License as published by
00007 //the Free Software Foundation; either version 3 of the License, or (at
00008 //your option) any later version.
00009 //
00010 //This program is distributed in the hope that it will be useful, but
00011 //WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013 //General Public License for more details.
00014 //
00015 //You should have received a copy of the GNU General Public License
00016 //along with this program; if not, see <http://www.gnu.org/licenses>.
00017 //
00018 //Additional permission under GNU GPL version 3 section 7
00019 //
00020 //If you modify this Program, or any covered work, by linking or
00021 //combining it with MATLAB (or a modified version of that library),
00022 //containing parts covered by the terms of MATLAB User License, the
00023 //licensors of this Program grant you additional permission to convey
00024 //the resulting work.
00025 
00026 
00027 #ifndef WRAPPER_O_MATLAB
00028 #define WRAPPER_O_MATLAB
00029 #include <complex>
00030 
00031 #include "enum_utils.h"
00032 #include "wrapper_o.h"
00033 #include "data_map.h"
00034 
00035 #include "mex.h"
00036 
00037 
00038 
00039 namespace utilities{
00040 class params_matlab;
00044 class Wrapper_o_matlab:public Wrapper_out{
00045 public:  
00046 
00047   void set_value(utilities::D_TYPE type, float val);
00048   void set_value(utilities::D_TYPE type, std::complex<float> val)
00049   {
00050     throw "not implemented";
00051   }
00052   void close_particle();
00053 
00054   void open_group(int,int,int)
00055   {
00056     throw "not implemented";
00057   }
00058   void close_group(){
00059     throw "not implemented";
00060   }
00061   void finalize_wrapper();
00062   void initialize_wrapper();
00063   void reset_wrapper(params * param);
00064   void open_particle(int);
00065   
00066   Wrapper_o_matlab(params_matlab* parms);
00067   ~Wrapper_o_matlab();
00068 
00069   void print()const;
00070   void get_content_tpyes(std::set<D_TYPE>&) const ;
00071   int  num_entries()const{return 0;};
00072 
00073   
00074     
00075   void set_all_values(const tracking::particle *);
00076   void set_all_values(const tracking::Track_box *);
00077   void set_value(D_TYPE,const tracking::particle *);
00078 
00079   const std::set<D_TYPE>& get_content_tpyes() const;
00080 
00081   
00082   void add_meta_data(const std::string & key, float val,bool root_group = true){};
00083   void add_meta_data(const std::string & key, const Tuple<float,2> & val,bool root_group = true){};
00084   void add_meta_data(const std::string & key, const Tuple<float,3> & val,bool root_group = true){};
00085   
00086   
00087 
00088   void add_meta_data(const std::string & key,  const std::string & val,bool root_group = true){};
00089 
00090   void add_meta_data(const std::string & key, int val,bool root_group = true){};
00091 
00092   
00093   void add_meta_data(const std::string & key, float val,D_TYPE dset_type){};
00094   
00095   void add_meta_data(const std::string & key, const Tuple<float,2> & val,D_TYPE dset_type){};
00096   
00097   void add_meta_data(const std::string & key, const Tuple<float,3> & val,D_TYPE dset_type){};
00098   
00099   void add_meta_data(const std::string & key,  const std::string & val,D_TYPE dset_type){};
00100   
00101   void add_meta_data(const std::string & key, int val,D_TYPE dset_type){};
00102 
00103   void add_meta_data_list(const Read_config & , const std::set<D_TYPE> &){};
00104 
00105 
00106  protected:
00108   int part_count;
00109   
00112   int seq_count;
00113 
00115   bool part_open;
00116   
00118   bool wrapper_open;
00119   
00120 
00121   
00122  private:
00124   mxArray ** data_array_;
00128   int rows;
00132   int cols;
00134   double * first;
00136   int part_index;
00140   Data_map data_map_;
00141   
00142 };
00143 
00144 }
00145 #endif