Particle Identification and Tracking
|
Wrapper class for dealing with output to matlab. More...
#include <wrapper_o_hdf.h>
Public Types | |
enum | FILE_T { APPEND_FILE =0, NEW_FILE, NEW_FILE_OVR, FILL_FILE } |
typedef enum utilities::Wrapper_o_hdf::FILE_T | FILE_T |
Public Member Functions | |
Wrapper_o_hdf (const std::string &file_name, const std::set< D_TYPE > &d_add, int comp_number, Wrapper_o_hdf::FILE_T file_type, const std::string &group_prefix="frame") | |
Constructor. More... | |
void | initialize_wrapper () |
preforms any initialization that needs to be done the logic for this is to not needlessly open and close files, or creat matlab arrays if they arn't going to be used. More... | |
void | open_group (int, int, int) |
Opens a group to put particles into. More... | |
void | set_all_values (const tracking::particle *) |
sets all of the values that the wrapper knows about by asking the particle More... | |
void | set_all_values (const tracking::Track_box *, const utilities::Tuple< float, 3 > &) |
sets all of the values that the wrapper knows about by asking the particle. More... | |
void | set_value (D_TYPE, const tracking::particle *) |
void | add_meta_store (const Md_store *md_in) |
Adds all the meta data in a Md_store object. More... | |
void | close_group () |
Closes the currently open group. More... | |
void | finalize_wrapper () |
Performs any clean up. More... | |
void | print () const |
int | num_entries () const |
const std::set< D_TYPE > & | get_content_tpyes () const |
Returns a set containing the D_TYPES that the wrapper can cope with. More... | |
void | add_meta_data (const std::string &key, float val) |
Adds a float meta-data. More... | |
void | add_meta_data (const std::string &key, const Tuple< float, 2 > &val) |
Adds a Pair meta-data. More... | |
void | add_meta_data (const std::string &key, const Tuple< float, 3 > &val) |
Adds a Triple meta-data. More... | |
void | add_meta_data (const std::string &key, const std::string &val) |
Adds a string meta-data. More... | |
void | add_meta_data (const std::string &key, int val) |
Adds an integer meta-data. More... | |
void | add_meta_data_root (const std::string &key, float val) |
Adds a float meta-data. More... | |
void | add_meta_data_root (const std::string &key, const Tuple< float, 2 > &val) |
Adds a Pair meta-data. More... | |
void | add_meta_data_root (const std::string &key, const Tuple< float, 3 > &val) |
Adds a Triple meta-data. More... | |
void | add_meta_data_root (const std::string &key, const std::string &val) |
Adds a string meta-data. More... | |
void | add_meta_data_root (const std::string &key, int val) |
Adds an integer meta-data. More... | |
void | add_meta_data_comp (const std::string &key, float val) |
Adds a float meta-data. More... | |
void | add_meta_data_comp (const std::string &key, const Tuple< float, 2 > &val) |
Adds a Pair meta-data. More... | |
void | add_meta_data_comp (const std::string &key, const Tuple< float, 3 > &val) |
Adds a Triple meta-data. More... | |
void | add_meta_data_comp (const std::string &key, const std::string &val) |
Adds a string meta-data. More... | |
void | add_meta_data_comp (const std::string &key, int val) |
Adds an integer meta-data. More... | |
void | add_meta_data (const std::string &key, float val, D_TYPE dset_type) |
Adds metadata for datasets. More... | |
void | add_meta_data (const std::string &key, const Tuple< float, 2 > &val, D_TYPE dset_type) |
Adds a Pair meta-data for a data set. More... | |
void | add_meta_data (const std::string &key, const Tuple< float, 3 > &val, D_TYPE dset_type) |
Adds a Triple meta-data for a data set. More... | |
void | add_meta_data (const std::string &key, const std::string &val, D_TYPE dset_type) |
Adds a string meta-data for a data set. More... | |
void | add_meta_data (const std::string &key, int val, D_TYPE dset_type) |
Adds an integer meta-data for a data set. More... | |
void | add_meta_data_list (const Read_config &, const std::set< D_TYPE > &) |
Adds all parameters from the Read_config object to the data sets in the set. More... | |
~Wrapper_o_hdf () | |
Private Member Functions | |
std::string | format_name_ (int in) const |
formats group names More... | |
Private Attributes | |
int | part_count_ |
Count of the number of particles that have been added. More... | |
bool | wrapper_open_ |
if the wrapper is 'open' to get additional particles More... | |
bool | group_open_ |
if there is a 'open' group More... | |
int | group_index_ |
index of current group More... | |
bool | new_indexing_ |
Parameter to control behavior of indexing. More... | |
Wrapper_o_hdf::FILE_T | file_type_ |
Parameter to control file creation and over writing. More... | |
H5::H5File * | file_ |
Pointer to hdf file. More... | |
std::string | file_name_ |
file name More... | |
std::string | group_name_ |
name of currently open group More... | |
std::set< D_TYPE > | d_types_add_ |
A set of the data types that are to be added to the file. More... | |
std::set< D_TYPE > | d_types_check_ |
A set of the data types to be checked to make sure there isn't a mismatch. More... | |
std::set< D_TYPE > | d_types_already_ |
The set of data that the file already contains. More... | |
std::string | group_prefix_ |
prefix for use in formatting the group name More... | |
Wrapper_o_hdf_group * | current_group_ |
object for current group More... | |
int | comp_number_ |
computation number More... | |
H5::Group * | dset_pram_group_ |
Static Private Attributes | |
static const int | format_padding_ = 6 |
the number if digits in the formatted group name More... | |
Wrapper class for dealing with output to matlab.
Wrapper_o_hdf::Wrapper_o_hdf | ( | const std::string & | file_name, |
const std::set< D_TYPE > & | d_add, | ||
int | comp_number, | ||
Wrapper_o_hdf::FILE_T | file_type, | ||
const std::string & | group_prefix = "frame" |
||
) |
Constructor.
file_name | full name of the file to open |
d_add | a set of the data types to add |
group_prefix | the prefix used for building group names |
file_type | Enum to control if a new file is created, indexing, etc |
comp_number | the computation number to use during name clashes |
References APPEND_FILE, file_type_, and new_indexing_.
Wrapper_o_hdf::~Wrapper_o_hdf | ( | ) |
References finalize_wrapper().
|
virtual |
Adds a float meta-data.
Implements utilities::Wrapper_out.
References current_group_, group_open_, and local_add_meta_data().
Referenced by add_meta_data_list(), and main().
|
virtual |
Adds a Pair meta-data.
Implements utilities::Wrapper_out.
References current_group_, group_open_, and local_add_meta_data().
|
virtual |
Adds a Triple meta-data.
Implements utilities::Wrapper_out.
References current_group_, group_open_, and local_add_meta_data().
|
virtual |
Adds a string meta-data.
Implements utilities::Wrapper_out.
References current_group_, group_open_, and local_add_meta_data().
|
virtual |
Adds an integer meta-data.
Implements utilities::Wrapper_out.
References current_group_, group_open_, and local_add_meta_data().
|
virtual |
Adds metadata for datasets.
Adds a float meta-data for a data set
Implements utilities::Wrapper_out.
References comp_number_, dset_pram_group_, local_add_meta(), and wrapper_open_.
|
virtual |
Adds a Pair meta-data for a data set.
Implements utilities::Wrapper_out.
References comp_number_, dset_pram_group_, local_add_meta(), and wrapper_open_.
|
virtual |
Adds a Triple meta-data for a data set.
Implements utilities::Wrapper_out.
References comp_number_, dset_pram_group_, local_add_meta(), and wrapper_open_.
|
virtual |
Adds a string meta-data for a data set.
Implements utilities::Wrapper_out.
References comp_number_, dset_pram_group_, local_add_meta(), and wrapper_open_.
|
virtual |
Adds an integer meta-data for a data set.
Implements utilities::Wrapper_out.
References comp_number_, dset_pram_group_, local_add_meta(), and wrapper_open_.
|
virtual |
Adds a float meta-data.
Implements utilities::Wrapper_out.
References comp_number_, current_group_, utilities::format_name(), group_open_, and local_add_meta_data().
|
virtual |
Adds a Pair meta-data.
Implements utilities::Wrapper_out.
References comp_number_, current_group_, utilities::format_name(), group_open_, and local_add_meta_data().
|
virtual |
Adds a Triple meta-data.
Implements utilities::Wrapper_out.
References comp_number_, current_group_, utilities::format_name(), group_open_, and local_add_meta_data().
|
virtual |
Adds a string meta-data.
Implements utilities::Wrapper_out.
References comp_number_, current_group_, utilities::format_name(), group_open_, and local_add_meta_data().
|
virtual |
Adds an integer meta-data.
Implements utilities::Wrapper_out.
References comp_number_, current_group_, utilities::format_name(), group_open_, and local_add_meta_data().
|
virtual |
Adds all parameters from the Read_config object to the data sets in the set.
Implements utilities::Wrapper_out.
References add_meta_data(), utilities::Read_config::get_key(), utilities::Read_config::get_type(), utilities::Read_config::get_value(), utilities::Read_config::size(), utilities::V_FLOAT, utilities::V_INT, utilities::V_STRING, and utilities::VT2str_s().
Referenced by main().
|
virtual |
Adds a float meta-data.
Implements utilities::Wrapper_out.
References file_, local_add_meta_data_root(), and wrapper_open_.
Referenced by initialize_wrapper().
|
virtual |
Adds a Pair meta-data.
Implements utilities::Wrapper_out.
References file_, local_add_meta_data_root(), and wrapper_open_.
|
virtual |
Adds a Triple meta-data.
Implements utilities::Wrapper_out.
References file_, local_add_meta_data_root(), and wrapper_open_.
|
virtual |
Adds a string meta-data.
Implements utilities::Wrapper_out.
References file_, local_add_meta_data_root(), and wrapper_open_.
|
virtual |
Adds an integer meta-data.
Implements utilities::Wrapper_out.
References file_, local_add_meta_data_root(), and wrapper_open_.
|
virtual |
Adds all the meta data in a Md_store object.
Implements utilities::Wrapper_out.
References utilities::Wrapper_o_hdf_group::add_meta_store(), and current_group_.
|
virtual |
Closes the currently open group.
Throws an error if there is no open group.
Implements utilities::Wrapper_out.
References current_group_, group_open_, and utilities::Wrapper_o_hdf_group::write_to_disk().
Referenced by finalize_wrapper().
|
virtual |
Performs any clean up.
that needs to be done such as closing a file
Implements utilities::Wrapper_out.
References close_group(), dset_pram_group_, file_, group_open_, and wrapper_open_.
Referenced by main(), and ~Wrapper_o_hdf().
|
private |
|
virtual |
Returns a set containing the D_TYPES that the wrapper can cope with.
Implements utilities::Wrapper_out.
References d_types_add_.
|
virtual |
preforms any initialization that needs to be done the logic for this is to not needlessly open and close files, or creat matlab arrays if they arn't going to be used.
It also allows the wrapper object to be reused (ie, do all the processing, output one subset of data to one place, and another subset to another place
Implements utilities::Wrapper_out.
References add_meta_data_root(), APPEND_FILE, comp_number_, d_types_add_, dset_pram_group_, file_, file_name_, file_type_, FILL_FILE, utilities::format_dset_name(), NEW_FILE, NEW_FILE_OVR, and wrapper_open_.
Referenced by main().
|
inline |
|
virtual |
Opens a group to put particles into.
group | the index of the group to be opened |
p_count | the number of particles to expect |
wrapper_size | the size of the group of the underlying wrapper, if <0, then set equal to p_count |
Implements utilities::Wrapper_out.
References APPEND_FILE, utilities::Wrapper_o_hdf_group::APPEND_GROUP, comp_number_, current_group_, d_types_add_, utilities::Wrapper_o_hdf_group::ERROR, file_, file_type_, FILL_FILE, utilities::Wrapper_o_hdf_group::FILL_GROUP, format_name_(), group_open_, NEW_FILE, NEW_FILE_OVR, utilities::Wrapper_o_hdf_group::NEW_GROUP, and wrapper_open_.
void Wrapper_o_hdf::print | ( | ) | const |
|
virtual |
sets all of the values that the wrapper knows about by asking the particle
Implements utilities::Wrapper_out.
|
virtual |
sets all of the values that the wrapper knows about by asking the particle.
This function is for outputting the results of 3D linking
Implements utilities::Wrapper_out.
References tracking::Track_box::average_cord(), current_group_, group_open_, and utilities::Wrapper_o_hdf_group::store_particle_pos().
void utilities::Wrapper_o_hdf::set_value | ( | D_TYPE | , |
const tracking::particle * | |||
) |
|
private |
computation number
Referenced by add_meta_data(), add_meta_data_comp(), initialize_wrapper(), and open_group().
|
private |
object for current group
Referenced by add_meta_data(), add_meta_data_comp(), add_meta_store(), close_group(), open_group(), and set_all_values().
|
private |
A set of the data types that are to be added to the file.
Referenced by get_content_tpyes(), initialize_wrapper(), and open_group().
|
private |
The set of data that the file already contains.
|
private |
A set of the data types to be checked to make sure there isn't a mismatch.
|
private |
Referenced by add_meta_data(), finalize_wrapper(), and initialize_wrapper().
|
private |
Pointer to hdf file.
Referenced by add_meta_data_root(), finalize_wrapper(), initialize_wrapper(), and open_group().
|
private |
file name
Referenced by initialize_wrapper().
|
private |
Parameter to control file creation and over writing.
Referenced by initialize_wrapper(), open_group(), and Wrapper_o_hdf().
|
staticprivate |
the number if digits in the formatted group name
Referenced by format_name_().
|
private |
index of current group
|
private |
name of currently open group
|
private |
if there is a 'open' group
Referenced by add_meta_data(), add_meta_data_comp(), close_group(), finalize_wrapper(), open_group(), and set_all_values().
|
private |
prefix for use in formatting the group name
Referenced by format_name_().
|
private |
Parameter to control behavior of indexing.
Referenced by Wrapper_o_hdf().
|
private |
Count of the number of particles that have been added.
|
private |
if the wrapper is 'open' to get additional particles
Referenced by add_meta_data(), add_meta_data_root(), finalize_wrapper(), initialize_wrapper(), and open_group().