Particle Identification and Tracking
track_box.h
Go to the documentation of this file.
1 //Copyright 2008,2009 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 MATLAB (or a modified version of that library),
22 //containing parts covered by the terms of MATLAB User License, the
23 //licensors of this Program grant you additional permission to convey
24 //the resulting work.
25 
26 
27 
28 #ifndef TRACK_BOX
29 #define TRACK_BOX
30 #include <vector>
31 #include "tuple.h"
32 namespace utilities{
33 
34 class Wrapper_out;
35 
36 
37 }
38 
39 namespace tracking{
40 // forward declaration
41 class particle_track;
42 class Track_shelf;
43 
44 
49 class Track_box{
50 public:
53  const particle_track * at(int n) const;
54 
59  return t_first_;
60  }
61 
66  return t_last_;
67  }
68 
69 
70 
71 
75  void extract_raw_pos(std::vector<float> & output,std::vector<unsigned int> & dims) const;
79  void extract_corrected_pos(std::vector<float> & output,std::vector<unsigned int> & dims) const;
80 
84  void extract_raw_disp(std::vector<float> & output,std::vector<unsigned int> & dims) const;
88  void extract_corrected_disp(std::vector<float> & output,std::vector<unsigned int> & dims) const;
89 
91  Track_box(particle_track * first);
92  // empty constructor
93  Track_box();
94 
96  virtual void print();
98  void push_back(particle_track* next);
99 
103  unsigned int get_id() const
104  {
105  return id_;
106  }
107 
111  virtual ~Track_box();
112 
116  int get_length()const
117  {
118  return length_;
119  };
123  void output_to_wrapper(utilities::Wrapper_out & wrapper) const;
124 
129  void split_to_parts(Track_shelf & shelf);
130 
135  void average_cord(utilities::Tuple<float,3> & pos,float & I) const ;
136 
140  void set_track_id(unsigned int in)
141  {
142  id_ = in;
143  }
144 
145 
146 protected:
149  //pointer to last particle in track
152  int length_;
154  static int running_count_;
156  unsigned int id_;
157 
158 
162  particle_track * at(int n) ;
163 
164 
165 
166 
171  Track_box * split_track(int indx);
172 
180  void trim_track(int ind_start, int length);
181 
182 
183 
184 };
185 }
186 
187 
188 #endif