Particle Identification and Tracking
|
Top level class for holding the track boxes. More...
#include <track_shelf.h>
Public Member Functions | |
void | add_new_track (particle_track *first_part) |
Add a track to the shelf starting from a particle. More... | |
void | add_track (Track_box *track) |
adds a pointer to a track_box to the shelf. More... | |
void | remove_short_tracks (int min_length) |
Removes all tracks from the shelf that are shorter than n. More... | |
void | print () |
Print Track_shelf to stdout. More... | |
void | set_shelf () |
Sets all of the particles in shelf to their respective wrappers. More... | |
void | track_length_histogram (utilities::Histogram &in) |
Generates a histogram of the lengths of all the tracks in the Track_shelf. More... | |
void | msd (std::vector< double > &msd_vec, std::vector< int > &entry_count) const |
Generates the MSD plot for all the tarcks in this shelf. More... | |
void | msd_corrected (utilities::Counted_vector &msd) const |
Generates the corrected MSD plot for all the tarcks in this shelf. More... | |
void | msd_corrected (utilities::Counted_vector &md, utilities::Counted_vector &msd, utilities::Counted_vector &msd_sq) const |
Generates the corrected MSD, mean displacement and <|d|^4> plot for all the tarcks in this shelf. More... | |
void | disp_sq_hist (int time_step, utilities::Histogram &disp_sq_hist) const |
generates a histogram of the squared displacement of the specified time step More... | |
void | set_raw_disp_to_cell (utilities::Cell &output) const |
sets the tracks into the cell that is passed in More... | |
void | set_corrected_disp_to_cell (utilities::Cell &output) const |
sets the corrected tracks into the cell that is passed in More... | |
unsigned int | get_track_count () const |
returns the number of tracks in shelf More... | |
void | pass_fun_to_track (void(Track_box::*fun)() const) const |
Pass a function to all of the Track_box objects contained. More... | |
void | output_to_wrapper (utilities::Wrapper_out &wrapper) const |
Outputs the particles in a track-centric format. More... | |
void | output_to_wrapper (utilities::Generic_wrapper &wrapper, const utilities::Md_store *md_store) const |
This function assumes that the tracks have been renumbered, such that the pigeon hole principle applies. More... | |
void | output_link_to_wrapper (utilities::Wrapper_out &wrapper, const utilities::Tuple< float, 3 > &scale_t, const utilities::Tuple< float, 3 > &dim) const |
outputs the contents of the shelf treating each track as a single particle. More... | |
void | split_to_parts (Track_shelf &out_put_shelf) |
Splits all the tracks in the self in to sections that represent single particles when the tracking is linking between z-planes. More... | |
void | renumber () |
Renumbers the tracks sequentially. More... | |
void | init (Master_box &mb) |
Initializes the tracks in the track shelf based on read in trakid. More... | |
void | init (hash_case &hc) |
Initializes the tracks in the track shelf based on read in trakid. More... | |
void | compute_corrected_TA (Trk_accumulator &ta) const |
Shove data in to a track accumulator. More... | |
void | compute_corrected_TA_ncuts (Trk_accumulator &ta, int min_neighbors, int max_neighbors) const |
Shove data in to a track accumulator, makes cuts based on the number of neighbors a particles has. More... | |
Track_box * | get_track (unsigned int track_id) const |
Returns a pointer to track with id track_id. More... | |
Track_shelf () | |
Constructor. More... | |
~Track_shelf () | |
Destructor. Destroys all of the tracks contained in the shelf. More... | |
Protected Member Functions | |
void | remove_track_internal_ (std::list< Track_box * >::iterator it) |
internal private function to do track removal to make maintianign code simpler More... | |
Protected Attributes | |
std::list< Track_box * > | tracks_ |
list to keep track of all the created tracks. More... | |
unsigned int | track_count_ |
number of tracks in the self More... | |
Top level class for holding the track boxes.
(which are the head of the linked lists made of particle_track objects).
|
inline |
Constructor.
Track_shelf::~Track_shelf | ( | ) |
Destructor. Destroys all of the tracks contained in the shelf.
References tracks_.
void Track_shelf::add_new_track | ( | particle_track * | first_part) |
Add a track to the shelf starting from a particle.
first_part | The first particle in the track |
References track_count_, and tracks_.
Referenced by tracking::hash_case::link(), tracking::track_list::link_pairs(), and tracking::track_list::trivial_bonds().
void Track_shelf::add_track | ( | Track_box * | track) |
adds a pointer to a track_box to the shelf.
The shelf takes responsibility for deleting the track when done.
References track_count_, and tracks_.
Referenced by tracking::hash_case::init(), init(), and tracking::Track_box::split_to_parts().
void Track_shelf::compute_corrected_TA | ( | Trk_accumulator & | ta) | const |
Shove data in to a track accumulator.
References tracking::Trk_accumulator::add_disp(), tracking::particle_track::get_corrected_disp(), tracking::Trk_accumulator::max_step(), tracking::particle_track::step_forwards(), and tracks_.
Referenced by main().
void Track_shelf::compute_corrected_TA_ncuts | ( | Trk_accumulator & | ta, |
int | min_neighbors, | ||
int | max_neighbors | ||
) | const |
Shove data in to a track accumulator, makes cuts based on the number of neighbors a particles has.
References tracking::Trk_accumulator::add_disp(), tracking::particle_track::get_corrected_disp(), tracking::particle_base::get_neighborhood_size(), tracking::Trk_accumulator::max_step(), tracking::particle_track::step_forwards(), and tracks_.
Referenced by main().
void Track_shelf::disp_sq_hist | ( | int | time_step, |
utilities::Histogram & | disp_sq_hist | ||
) | const |
generates a histogram of the squared displacement of the specified time step
time_step | integer greater than zero less than maximum track length |
disp_sq_hist | histogram to be filled. Is not cleared. |
References utilities::Histogram::add_data_point(), tracking::particle_track::distancesq_corrected(), tracking::particle_track::step_forwards(), and tracks_.
Referenced by main().
Track_box * Track_shelf::get_track | ( | unsigned int | track_id) | const |
Returns a pointer to track with id track_id.
raises runtime_error of track not found
[in] | track_id | the id of the track to return |
References tracks_.
|
inline |
void Track_shelf::init | ( | Master_box & | mb) |
Initializes the tracks in the track shelf based on read in trakid.
References add_track(), utilities::D_TRACKID, tracking::Master_box::get_particle(), tracking::particle_base::get_wrapper_value(), tracking::Track_box::push_back(), tracking::Master_box::size(), track_count_, and tracks_.
Referenced by main().
void Track_shelf::init | ( | hash_case & | hc) |
Initializes the tracks in the track shelf based on read in trakid.
References add_track(), utilities::D_TRACKID, tracking::hash_case::get_num_frames(), tracking::particle_base::get_wrapper_value(), tracking::Track_box::push_back(), tracking::hash_case::return_shelf(), tracking::Hash_shelf::shelf_to_list(), track_count_, and tracks_.
void Track_shelf::msd | ( | std::vector< double > & | msd_vec, |
std::vector< int > & | entry_count | ||
) | const |
Generates the MSD plot for all the tarcks in this shelf.
References tracking::particle_base::distancesq(), tracking::particle_track::step_forwards(), and tracks_.
void Track_shelf::msd_corrected | ( | utilities::Counted_vector & | msd) | const |
Generates the corrected MSD plot for all the tarcks in this shelf.
References utilities::Counted_vector::batch_add_to_element(), tracking::particle_track::distancesq_corrected(), utilities::Counted_vector::get_length(), tracking::particle_track::step_forwards(), and tracks_.
void Track_shelf::msd_corrected | ( | utilities::Counted_vector & | md, |
utilities::Counted_vector & | msd, | ||
utilities::Counted_vector & | msd_sq | ||
) | const |
Generates the corrected MSD, mean displacement and <|d|^4> plot for all the tarcks in this shelf.
References utilities::Counted_vector::batch_add_to_element(), tracking::particle_track::distancesq_corrected(), utilities::Counted_vector::get_length(), tracking::particle_track::step_forwards(), and tracks_.
void Track_shelf::output_link_to_wrapper | ( | utilities::Wrapper_out & | wrapper, |
const utilities::Tuple< float, 3 > & | scale_t, | ||
const utilities::Tuple< float, 3 > & | dim | ||
) | const |
outputs the contents of the shelf treating each track as a single particle.
for use with 3D linking. This should be sub-classed
References utilities::Wrapper_out::add_meta_data_root(), utilities::Wrapper_out::close_group(), utilities::Wrapper_out::open_group(), utilities::Wrapper_out::set_all_values(), track_count_, and tracks_.
Referenced by main().
void Track_shelf::output_to_wrapper | ( | utilities::Wrapper_out & | wrapper) | const |
void Track_shelf::output_to_wrapper | ( | utilities::Generic_wrapper & | wrapper, |
const utilities::Md_store * | md_store | ||
) | const |
This function assumes that the tracks have been renumbered, such that the pigeon hole principle applies.
If not, it will throw an error. It also assumes that the tracks are in order in the shelf.
wrapper | where to dump the data to. |
md_store | meta data store object |
References utilities::Generic_wrapper::add_dset(), utilities::Generic_wrapper::add_meta_data(), utilities::Generic_wrapper::close_group(), utilities::Generic_wrapper::close_wrapper(), utilities::format_name(), tracking::Track_box::get_first(), tracking::particle_base::get_frame(), tracking::Track_box::get_id(), tracking::particle_base::get_ind(), tracking::Track_box::get_length(), utilities::Md_store::get_value(), utilities::Generic_wrapper::is_open(), utilities::Generic_wrapper::open_group(), utilities::Generic_wrapper::open_wrapper(), track_count_, tracks_, and utilities::V_UINT.
void Track_shelf::pass_fun_to_track | ( | void(Track_box::*)() const | fun) | const |
void Track_shelf::print | ( | ) |
void Track_shelf::remove_short_tracks | ( | int | min_length) |
Removes all tracks from the shelf that are shorter than n.
This does not clear the link information in the particle_track objects.
min_length | the minimum length of tracks left in the shelf after |
References remove_track_internal_(), and tracks_.
Referenced by main().
|
protected |
internal private function to do track removal to make maintianign code simpler
References track_count_, and tracks_.
Referenced by remove_short_tracks().
void Track_shelf::renumber | ( | ) |
void tracking::Track_shelf::set_corrected_disp_to_cell | ( | utilities::Cell & | output) | const |
sets the corrected tracks into the cell that is passed in
void tracking::Track_shelf::set_raw_disp_to_cell | ( | utilities::Cell & | output) | const |
sets the tracks into the cell that is passed in
void tracking::Track_shelf::set_shelf | ( | ) |
Sets all of the particles in shelf to their respective wrappers.
void Track_shelf::split_to_parts | ( | Track_shelf & | out_put_shelf) |
void Track_shelf::track_length_histogram | ( | utilities::Histogram & | in) |
Generates a histogram of the lengths of all the tracks in the Track_shelf.
References utilities::Histogram::add_data_point(), and tracks_.
Referenced by main().
|
protected |
number of tracks in the self
Referenced by add_new_track(), add_track(), get_track_count(), init(), output_link_to_wrapper(), output_to_wrapper(), and remove_track_internal_().
|
protected |
list to keep track of all the created tracks.
The shelf is responsible for cleaning up the tracks at the end. A list is used so that addition/removal is fast. Random access isn't important. Tracks can now be renumbered.
Referenced by add_new_track(), add_track(), compute_corrected_TA(), compute_corrected_TA_ncuts(), disp_sq_hist(), get_track(), init(), msd(), msd_corrected(), output_link_to_wrapper(), output_to_wrapper(), pass_fun_to_track(), print(), remove_short_tracks(), remove_track_internal_(), renumber(), split_to_parts(), track_length_histogram(), and ~Track_shelf().