aqnwb 0.1.0
Loading...
Searching...
No Matches
Channel.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <string>
5
6#include "Types.hpp"
7
9
10namespace AQNWB
11{
16{
17public:
21 Channel(const std::string name,
22 const std::string groupName,
23 const SizeType groupIndex,
24 const SizeType localIndex,
25 const SizeType globalIndex,
26 const float conversion = 1e6f, // uV to V
27 const float samplingRate = 30000.f, // placeholder
28 const float bitVolts = 0.05f, // least significant bit needed to
29 // convert 16-bit int to volts
30 // currently a placeholder
31 const std::array<float, 3> position = {0.f, 0.f, 0.f},
32 const std::string comments = "no comments");
33
37 ~Channel();
38
42 Channel(const Channel& other) = default;
43
47 Channel(Channel&& other) = default;
48
52 Channel& operator=(const Channel& other) = default;
53
57 Channel& operator=(Channel&& other) = default;
58
63 inline float getConversion() const { return m_bitVolts / m_conversion; }
64
69 inline float getSamplingRate() const { return m_samplingRate; }
70
75 inline float getBitVolts() const { return m_bitVolts; }
76
81 inline std::string getGroupName() const { return m_groupName; }
82
87 inline std::string getName() const { return m_name; }
88
93 inline SizeType getGroupIndex() const { return m_groupIndex; }
94
99 inline SizeType getLocalIndex() const { return m_localIndex; }
100
105 inline SizeType getGlobalIndex() const { return m_globalIndex; }
106
111 inline const std::array<float, 3>& getPosition() const { return m_position; }
112
117 inline std::string getComments() const { return m_comments; }
118
123 inline void setComments(const std::string& comments)
124 {
125 m_comments = comments;
126 }
127
132 inline void setPosition(const std::array<float, 3>& position)
133 {
134 m_position = position;
135 }
136
141 inline void setName(const std::string& name) { m_name = name; }
142
143private:
147 std::string m_comments;
148
152 std::array<float, 3> m_position;
153
157 SizeType m_globalIndex;
158
162 SizeType m_localIndex;
163
167 SizeType m_groupIndex;
168
172 std::string m_name;
173
177 std::string m_groupName;
178
182 float m_conversion;
183
187 float m_samplingRate;
188
192 float m_bitVolts;
193};
194} // namespace AQNWB
AQNWB::Types::SizeType SizeType
Definition BaseIO.hpp:16
Class for storing acquisition system channel information.
Definition Channel.hpp:16
void setPosition(const std::array< float, 3 > &position)
Set coordinates of channel (x, y, z) within the recording array.
Definition Channel.hpp:132
Channel & operator=(const Channel &other)=default
Assignment operator.
void setName(const std::string &name)
Set name of the channel.
Definition Channel.hpp:141
float getSamplingRate() const
Getter for sampling rate of the channel.
Definition Channel.hpp:69
const std::array< float, 3 > & getPosition() const
Get the coordinates of channel (x, y, z) within the recording array.
Definition Channel.hpp:111
SizeType getGroupIndex() const
Get the array group index the channel belongs to.
Definition Channel.hpp:93
Channel(const std::string name, const std::string groupName, const SizeType groupIndex, const SizeType localIndex, const SizeType globalIndex, const float conversion=1e6f, const float samplingRate=30000.f, const float bitVolts=0.05f, const std::array< float, 3 > position={0.f, 0.f, 0.f}, const std::string comments="no comments")
Constructor.
Definition Channel.cpp:7
std::string getName() const
Get the name of the channel.
Definition Channel.hpp:87
float getConversion() const
Getter for conversion factor.
Definition Channel.hpp:63
~Channel()
Destructor.
Definition Channel.cpp:30
void setComments(const std::string &comments)
Set comments about the channel.
Definition Channel.hpp:123
Channel(Channel &&other)=default
Move constructor.
std::string getComments() const
Get comments about the channel.
Definition Channel.hpp:117
float getBitVolts() const
Getter for bitVolts floating point value of microvolts per bit.
Definition Channel.hpp:75
SizeType getGlobalIndex() const
Get the index of the channel across the recording system.
Definition Channel.hpp:105
SizeType getLocalIndex() const
Get the index of the channel within the recording array.
Definition Channel.hpp:99
Channel & operator=(Channel &&other)=default
Move assignment operator.
Channel(const Channel &other)=default
Copy constructor.
std::string getGroupName() const
Get the name of the array group the channel belongs to.
Definition Channel.hpp:81
size_t SizeType
Alias for the size type used in the project.
Definition Types.hpp:30
The main namespace for AqNWB.