Stimfit 0.12.7
|
Represents the data within a file. More...
#include <recording.h>
Public Member Functions | |
Recording () | |
Default constuctor. | |
Recording (const Channel &c_Channel) | |
Constructor. | |
Recording (const std::vector< Channel > &ChannelList) | |
Constructor. | |
Recording (std::size_t c_n_channels, std::size_t c_n_sections=0, std::size_t c_n_points=0) | |
Constructor. | |
virtual | ~Recording () |
Destructor. | |
std::size_t | GetChannelSize (std::size_t n_channel) const |
Retrieves the number of sections in a channel. | |
const std::vector< Channel > & | get () const |
Retrieves the channels (read-only). | |
std::vector< Channel > & | get () |
Retrieves the channels (read and write). | |
const std::string & | GetFileDescription () const |
Retrieves the file description. | |
const std::string & | GetGlobalSectionDescription () const |
Retrieves the common section description. | |
const std::string & | GetScaling () const |
Retrieves the scaling as a string. | |
const std::string & | GetTime () const |
Retrieves the time of recording as a string. | |
const std::string & | GetDate () const |
Retrieves the date of recording as a string. | |
const std::string & | GetComment () const |
Retrieves a comment string. | |
const std::string & | GetXUnits () const |
Retrieves the x units. | |
std::size_t | size () const |
Retrieves the size of the channel array. | |
double | GetXScale () const |
Retrieves the x scaling (sampling interval). | |
double | GetSR () const |
Retrieves the sampling rate ( 1 / x-scale ) | |
const Channel & | at (std::size_t n_c) const |
Range-checked access to a channel (read-only). | |
Channel & | at (std::size_t n_c) |
Range-checked access to a channel (read and write). | |
void | SetFileDescription (const std::string &value) |
Sets the file description. | |
void | SetGlobalSectionDescription (const std::string &value) |
Sets the common section description. | |
void | SetScaling (const std::string &value) |
Sets the scaling as a string. | |
void | SetTime (const std::string &value) |
Sets the time of recording as a string. | |
void | SetDate (const std::string &value) |
Sets the date of recording as a string. | |
void | SetComment (const std::string &value) |
Sets a comment string. | |
void | SetGlobalYUnits (std::size_t n_channel, const std::string &value) |
Sets the y units for a channel. | |
void | SetXUnits (const std::string &value) |
Sets the x units. | |
void | SetXScale (double value) |
Sets the x scaling. | |
virtual void | resize (std::size_t c_n_channels) |
Resize the Recording to a new number of channels. | |
virtual void | InsertChannel (Channel &c_Channel, std::size_t pos) |
Insert a Channel at a given position. | |
void | CopyAttributes (const Recording &c_Recording) |
Copy descriptive attributes from another Recording to this Recording. | |
void | MakeAverage (Section &AverageReturn, Section &SigReturn, std::size_t channel, const std::vector< std::size_t > §ion_index, bool isSig, const std::vector< int > &shift) const |
Calculates an average of several traces. | |
void | AddRec (const Recording &toAdd) |
Add a Recording at the end of this Recording. | |
Channel & | operator[] (std::size_t at) |
Unchecked channel access (read and write) | |
const Channel & | operator[] (std::size_t at) const |
Unchecked channel access (read-only) |
Represents the data within a file.
Contains an array of channels that can be accessed either via at() (range-checked, will throw an exception if out of range) or the []-operator (range unchecked). Moreover all the metadata such as time, date, samling rate and comments are stored here.
Recording::Recording | ( | const Channel & | c_Channel | ) | [explicit] |
Recording::Recording | ( | const std::vector< Channel > & | ChannelList | ) | [explicit] |
Constructor.
ChannelList | A vector of channels from which to construct a new Recording. |
Recording::Recording | ( | std::size_t | c_n_channels, |
std::size_t | c_n_sections = 0 , |
||
std::size_t | c_n_points = 0 |
||
) | [explicit] |
Constructor.
Setting the number of channels and sections at construction time will avoid unnecessary memory re-allocations.
c_n_channels | The number of channels. |
c_n_sections | The number of sections. |
c_n_points | The number of sampling points per section. |
void Recording::AddRec | ( | const Recording & | toAdd | ) |
const Channel& Recording::at | ( | std::size_t | n_c | ) | const |
Range-checked access to a channel (read-only).
Will throw std::out_of_range if out of range.
n_c | The index of the channel. |
Channel& Recording::at | ( | std::size_t | n_c | ) |
Range-checked access to a channel (read and write).
Will throw std::out_of_range if out of range.
n_c | The index of the channel. |
void Recording::CopyAttributes | ( | const Recording & | c_Recording | ) |
const std::vector<Channel>& Recording::get | ( | ) | const [inline] |
Retrieves the channels (read-only).
std::vector<Channel>& Recording::get | ( | ) | [inline] |
Retrieves the channels (read and write).
std::size_t Recording::GetChannelSize | ( | std::size_t | n_channel | ) | const |
Retrieves the number of sections in a channel.
n_channel | The index of the channel (range-checked). |
const std::string& Recording::GetComment | ( | ) | const [inline] |
Retrieves a comment string.
const std::string& Recording::GetDate | ( | ) | const [inline] |
Retrieves the date of recording as a string.
const std::string& Recording::GetFileDescription | ( | ) | const [inline] |
Retrieves the file description.
const std::string& Recording::GetGlobalSectionDescription | ( | ) | const [inline] |
Retrieves the common section description.
const std::string& Recording::GetScaling | ( | ) | const [inline] |
Retrieves the scaling as a string.
double Recording::GetSR | ( | ) | const [inline] |
Retrieves the sampling rate ( 1 / x-scale )
const std::string& Recording::GetTime | ( | ) | const [inline] |
Retrieves the time of recording as a string.
double Recording::GetXScale | ( | ) | const [inline] |
Retrieves the x scaling (sampling interval).
const std::string& Recording::GetXUnits | ( | ) | const [inline] |
Retrieves the x units.
virtual void Recording::InsertChannel | ( | Channel & | c_Channel, |
std::size_t | pos | ||
) | [virtual] |
void Recording::MakeAverage | ( | Section & | AverageReturn, |
Section & | SigReturn, | ||
std::size_t | channel, | ||
const std::vector< std::size_t > & | section_index, | ||
bool | isSig, | ||
const std::vector< int > & | shift | ||
) | const |
Calculates an average of several traces.
AverageReturn | The average will be returned in this variable by passing a reference. AverageReturn has to have the correct size upon entering this function already, it won't be resized. |
SigReturn | The standard deviation will be returned in this variable by passing a reference if isSig == true. SigReturn has to have the correct size upon entering this function already, it won't be resized. |
channel | The index of the channel to be used. |
section_index | A vector containing the indices of the sections to be used for the average. |
isSig | Set to true if the standard deviation should be calculated as well. |
shift | A vector indicating by how many data points each section should be shifted before averaging. |
Channel& Recording::operator[] | ( | std::size_t | at | ) | [inline] |
Unchecked channel access (read and write)
Use at() for range-checked access.
at | The channel index. |
const Channel& Recording::operator[] | ( | std::size_t | at | ) | const [inline] |
Unchecked channel access (read-only)
Use at() for range-checked access.
at | The channel index. |
virtual void Recording::resize | ( | std::size_t | c_n_channels | ) | [virtual] |
void Recording::SetComment | ( | const std::string & | value | ) | [inline] |
Sets a comment string.
value | A string containing a comment. |
void Recording::SetDate | ( | const std::string & | value | ) | [inline] |
Sets the date of recording as a string.
value | A string containing the date of recording. |
void Recording::SetFileDescription | ( | const std::string & | value | ) | [inline] |
Sets the file description.
value | The file description. |
void Recording::SetGlobalSectionDescription | ( | const std::string & | value | ) | [inline] |
Sets the common section description.
value | The common section description. |
void Recording::SetGlobalYUnits | ( | std::size_t | n_channel, |
const std::string & | value | ||
) |
Sets the y units for a channel.
n_channel | The channel index for which to set the units. |
value | A string containing the y units. |
void Recording::SetScaling | ( | const std::string & | value | ) | [inline] |
Sets the scaling as a string.
value | A string containing the description. |
void Recording::SetTime | ( | const std::string & | value | ) | [inline] |
Sets the time of recording as a string.
value | A string containing the time of recording. |
void Recording::SetXScale | ( | double | value | ) |
Sets the x scaling.
Note that setting the global x-scale will set it for all sections
value | The x scaling. |
void Recording::SetXUnits | ( | const std::string & | value | ) | [inline] |
Sets the x units.
value | A string containing the x units. |
std::size_t Recording::size | ( | ) | const [inline] |
Retrieves the size of the channel array.