Particle Identification and Tracking
|
Wrapper class for eating data from hdf files, take 2. More...
#include <wrapper_i_hdf.h>
Public Types | |
enum | DATA_DIMS { TWO_D = 0, THREE_D } |
typedef enum utilities::Wrapper_i_hdf::DATA_DIMS | DATA_DIMS |
Public Member Functions | |
int | get_value (int &out, int ind, D_TYPE type, int frame) const |
Returns the value of the type specified from the particle selected. More... | |
float | get_value (float &out, int ind, D_TYPE type, int frame) const |
Returns the value of the type specified from the particle selected. More... | |
std::complex< float > | get_value (std::complex< float > &out, int ind, D_TYPE type, int frame) const |
Returns the value of the type specified from the particle selected. More... | |
std::set< D_TYPE > | get_data_types () const |
Returns a set of the data types. More... | |
int | get_num_entries (unsigned int frame) const |
Return the number of entries the specified frame. More... | |
int | get_num_entries () const |
Return the total number of entries in the wrapper. More... | |
int | get_num_frames () const |
Return the number of frames. More... | |
bool | contains_type (D_TYPE type) const |
Returns if the wrapper contains the specified data type. More... | |
Tuplef | get_dims () const |
Returns the dimension of each 'frame' of the data in the wrapper. More... | |
~Wrapper_i_hdf () | |
Wrapper_i_hdf () | |
Constructor. More... | |
bool | initialize (const std::string &fname, const std::set< utilities::D_TYPE > &dtypes, int comp_number, unsigned int start=0, int frames=0) |
Initialize. More... | |
bool | initialize (const std::string &fname, const std::set< utilities::D_TYPE > &dtypes, int comp_number, unsigned int start, int f_count, bool two_d_data) |
Initialize. More... | |
bool | initialize (const std::string &fname, const std::set< std::pair< utilities::D_TYPE, int > > &dtypes, unsigned int start, int f_count, bool two_d_data) |
Initialize. More... | |
bool | initialize (int f_count) |
Initialize. More... | |
float | get_xy_scale () const |
returns the scaling between pixels and microns. More... | |
unsigned int | get_start_offset () const |
Returns the starting plane. More... | |
bool | set_file_name (const std::string &fname) |
Set fname. More... | |
bool | add_dtype (utilities::D_TYPE dtype, int comp_key) |
Set a data type/comp number pair. More... | |
bool | set_twoD (bool twod_data) |
Set a data type/comp number pair. More... | |
Meta data handling functions | |
const Md_store * | get_Md_store (unsigned int j) const |
Returns a pointer to plane j's meta data store. More... | |
Md_store * | get_Md_store (unsigned int j) |
Returns a pointer to plane j's meta data store. More... | |
void | set_Md_store (unsigned int j, Md_store *in) |
Sets the Md_store for plane j. More... | |
void | set_Md_store_size (unsigned int j) |
Sets the size of the md_stores_ vector. More... | |
unsigned int | get_Md_store_size () |
Gets the size of the md_stores_ vector. More... | |
void | clear_Md_store (unsigned int j) |
Deletes plane j's Md_store. More... | |
Private Member Functions | |
void | clean_data () |
Deletes all allocated data. More... | |
bool | priv_init (int f_count=0) |
Private initialization function. More... | |
void | make_dtype_pairs (int comp_nuber) |
Turns a set of data types in to a set of pairs assuming they all have the same computation number. More... | |
void | make_dtype_set () |
Extracts the set of data types from a set of (D_TYPE,comp_num) pairs. More... | |
Static Private Member Functions | |
static std::string | format_name (int in) |
Private Attributes | |
std::string | file_name_ |
name for the data file More... | |
std::set< std::pair < utilities::D_TYPE, int > > | data_types_ |
Set of pairs of data types and the computation number to be used for that data type. More... | |
std::set< utilities::D_TYPE > | data_types_set_ |
Set of data types in the wrapper. More... | |
Data_map | d_mapi_ |
Data map for integer data. More... | |
Data_map | d_mapf_ |
Data map for float data. More... | |
Data_map | d_mapc_ |
Data map for complex<float> data. More... | |
std::vector< std::vector< int * > > | data_i_ |
Data structure for integer data. More... | |
std::vector< std::vector < float * > > | data_f_ |
Data structure for float data. More... | |
std::vector< std::vector < std::complex< float > * > > | data_c_ |
Data structure for complex<float> data. More... | |
std::vector< int > | frame_c_ |
the number of particles in each frame More... | |
unsigned int | frame_count_ |
The number of frames. More... | |
unsigned int | total_part_count_ |
The total number of particles in all frames. More... | |
bool | two_d_data_ |
If we are reading in 2D data. More... | |
std::vector< float > | frame_zdata_ |
A vector of the z-position of each frame. More... | |
unsigned int | start_ |
first frame to read in More... | |
bool | locked_ |
if the parameters are locked More... | |
Wrapper class for eating data from hdf files, take 2.
Wrapper_i_hdf::~Wrapper_i_hdf | ( | ) |
References clean_data().
Wrapper_i_hdf::Wrapper_i_hdf | ( | ) |
Constructor.
bool Wrapper_i_hdf::add_dtype | ( | utilities::D_TYPE | dtype, |
int | comp_key | ||
) |
Set a data type/comp number pair.
Returns true if successful
References data_types_, data_types_set_, and locked_.
|
private |
Deletes all allocated data.
References data_c_, data_f_, data_i_, and locked_.
Referenced by ~Wrapper_i_hdf().
|
inherited |
Deletes plane j's Md_store.
References utilities::Wrapper_in::md_stores_.
|
virtual |
Returns if the wrapper contains the specified data type.
Implements utilities::Wrapper_in.
References data_types_set_.
Referenced by get_value().
|
staticprivate |
Referenced by priv_init().
|
virtual |
Returns a set of the data types.
Use the other version
Implements utilities::Wrapper_in.
References data_types_set_.
|
virtual |
Returns the dimension of each 'frame' of the data in the wrapper.
Implements utilities::Wrapper_in.
References file_name_.
Referenced by main().
|
inherited |
Returns a pointer to plane j's meta data store.
Const version
References utilities::Wrapper_in::md_stores_.
Referenced by tracking::Master_box::get_Md_store(), and tracking::hash_case::init().
|
inherited |
Returns a pointer to plane j's meta data store.
Const version
References utilities::Wrapper_in::md_stores_.
|
inherited |
Gets the size of the md_stores_ vector.
References utilities::Wrapper_in::md_stores_.
|
virtual |
Return the number of entries the specified frame.
Implements utilities::Wrapper_in.
References frame_c_.
|
virtual |
Return the total number of entries in the wrapper.
Implements utilities::Wrapper_in.
References total_part_count_.
|
virtual |
Return the number of frames.
Implements utilities::Wrapper_in.
References frame_count_.
Referenced by main().
|
inline |
Returns the starting plane.
This may be needed to put data back into hdf files properly. Although, processing only part of the file seems like it would lead to madness and chaos.
References start_.
|
virtual |
Returns the value of the type specified from the particle selected.
out | [out] the value |
ind | [in] the index of the particle |
type | [in] the D_TYPE |
frame | [in] the frame the particle is in |
Implements utilities::Wrapper_in.
References contains_type(), d_mapi_, data_i_, utilities::DT2str_s(), utilities::V_INT, and utilities::v_type().
|
virtual |
Returns the value of the type specified from the particle selected.
out | [out] the value |
ind | [in] the index of the particle |
type | [in] the D_TYPE |
frame | [in] the frame the particle is in |
Implements utilities::Wrapper_in.
References contains_type(), d_mapf_, utilities::D_ZPOS, data_f_, utilities::DT2str_s(), frame_zdata_, two_d_data_, utilities::V_FLOAT, and utilities::v_type().
|
virtual |
Returns the value of the type specified from the particle selected.
out | [out] the value |
ind | [in] the index of the particle |
type | [in] the D_TYPE |
frame | [in] the frame the particle is in |
Implements utilities::Wrapper_in.
References contains_type(), d_mapc_, data_c_, utilities::DT2str_s(), utilities::V_COMPLEX, and utilities::v_type().
float Wrapper_i_hdf::get_xy_scale | ( | ) | const |
returns the scaling between pixels and microns.
This should be pushed up to the next level, but I am lazy.
/todo make it actually ask the hdf for the calibration,
bool Wrapper_i_hdf::initialize | ( | const std::string & | fname, |
const std::set< utilities::D_TYPE > & | dtypes, | ||
int | comp_number, | ||
unsigned int | start = 0 , |
||
int | frames = 0 |
||
) |
Initialize.
Returns true if successful
fname | [in] name of hdf file to read in |
dtypes | [in] a set of D_TYPES to extract from the hdf file |
comp_number | [in] the computation number to read |
start | [in] the first frame to read from |
frames | [in] the number of frames to read |
Referenced by main().
bool Wrapper_i_hdf::initialize | ( | const std::string & | fname, |
const std::set< utilities::D_TYPE > & | dtypes, | ||
int | comp_number, | ||
unsigned int | start, | ||
int | f_count, | ||
bool | two_d_data | ||
) |
Initialize.
Returns true if successful
fname | [in] name of hdf file to read in |
dtypes | [in] a set of D_TYPES to extract from the hdf file |
comp_number | [in] the computation number to read |
start | [in] the first frame to read from |
f_count | [in] the number of frames to read |
two_d_data | [in] if this is 2D data |
References data_types_set_, file_name_, fname, make_dtype_pairs(), priv_init(), start_, and two_d_data_.
bool Wrapper_i_hdf::initialize | ( | const std::string & | fname, |
const std::set< std::pair< utilities::D_TYPE, int > > & | dtypes, | ||
unsigned int | start, | ||
int | f_count, | ||
bool | two_d_data | ||
) |
Initialize.
Returns true if successful
fname | [in] name of hdf file to read in |
dtypes | [in] a set of (D_TYPES,comp_number) pairs to extract from the hdf file |
start | [in] the first frame to read from |
f_count | [in] the number of frames to read |
two_d_data | [in] if this is 2D data |
References data_types_, file_name_, fname, make_dtype_set(), priv_init(), start_, and two_d_data_.
bool Wrapper_i_hdf::initialize | ( | int | f_count) |
Initialize.
Assumes fname, and the data type/comp_key mapping is already set. Returns true if successful..
References priv_init().
|
private |
Turns a set of data types in to a set of pairs assuming they all have the same computation number.
References data_types_, and data_types_set_.
Referenced by initialize().
|
private |
Extracts the set of data types from a set of (D_TYPE,comp_num) pairs.
References data_types_, and data_types_set_.
Referenced by initialize().
|
private |
Private initialization function.
References utilities::Attr_list_hdf::contains_attr(), d_mapc_, d_mapf_, d_mapi_, utilities::D_ZPOS, data_c_, data_f_, data_i_, data_types_, file_name_, utilities::format_dset_name(), format_name(), frame_c_, frame_count_, frame_zdata_, utilities::Attr_list_hdf::get_value(), locked_, utilities::Data_map::set_lookup(), utilities::Wrapper_in::set_Md_store(), utilities::Wrapper_in::set_Md_store_size(), start_, total_part_count_, two_d_data_, utilities::V_BOOL, utilities::V_COMPLEX, utilities::V_ERROR, utilities::V_FLOAT, utilities::V_GUID, utilities::V_INT, utilities::V_STRING, utilities::V_TIME, utilities::v_type(), utilities::V_UINT, and utilities::VT2str_s().
Referenced by initialize().
bool Wrapper_i_hdf::set_file_name | ( | const std::string & | fname) |
|
inherited |
Sets the Md_store for plane j.
When the pointer is assigned the wrapper takes ownership of the pointer and will clean it up.
References utilities::Wrapper_in::md_stores_.
Referenced by iden::Iden::fill_wrapper(), iden::Iden::fill_wrapper_avg(), main(), priv_init(), and iden::Iden::process_frame().
|
inherited |
Sets the size of the md_stores_ vector.
References utilities::Wrapper_in::md_stores_.
Referenced by iden::Iden::fill_wrapper(), iden::Iden::fill_wrapper_avg(), main(), priv_init(), and iden::Wrapper_i_plu::Wrapper_i_plu().
bool Wrapper_i_hdf::set_twoD | ( | bool | twod_data) |
|
private |
Data map for complex<float> data.
Referenced by get_value(), and priv_init().
|
private |
Data map for float data.
Referenced by get_value(), and priv_init().
|
private |
Data map for integer data.
Referenced by get_value(), and priv_init().
|
private |
Data structure for complex<float> data.
First dimension is data type, second is frame, third in particle index
Referenced by clean_data(), get_value(), and priv_init().
|
private |
Data structure for float data.
First dimension is data type, second is frame, third in particle index
Referenced by clean_data(), get_value(), and priv_init().
|
private |
Data structure for integer data.
First dimension is data type, second is frame, third in particle index
Referenced by clean_data(), get_value(), and priv_init().
|
private |
Set of pairs of data types and the computation number to be used for that data type.
Referenced by add_dtype(), initialize(), make_dtype_pairs(), make_dtype_set(), and priv_init().
|
private |
Set of data types in the wrapper.
This is mostly redundant, but useful.
Referenced by add_dtype(), contains_type(), get_data_types(), initialize(), make_dtype_pairs(), and make_dtype_set().
|
private |
name for the data file
Referenced by get_dims(), initialize(), priv_init(), and set_file_name().
|
private |
the number of particles in each frame
Referenced by get_num_entries(), and priv_init().
|
private |
The number of frames.
Referenced by get_num_frames(), and priv_init().
|
private |
A vector of the z-position of each frame.
For 2D data this is the center of the plane, for 3D this provides if we have any drift.
Referenced by get_value(), and priv_init().
|
private |
if the parameters are locked
Referenced by add_dtype(), clean_data(), priv_init(), set_file_name(), and set_twoD().
|
private |
first frame to read in
Referenced by get_start_offset(), initialize(), and priv_init().
|
private |
The total number of particles in all frames.
Referenced by get_num_entries(), and priv_init().
|
private |
If we are reading in 2D data.
Referenced by get_value(), initialize(), priv_init(), and set_twoD().