aqnwb 0.5.0
Loading...
Searching...
No Matches
ElectricalSeries.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include "Channel.hpp"
6#include "Utils.hpp"
7#include "io/BaseIO.hpp"
8#include "io/ReadIO.hpp"
11#include "spec/core.hpp"
12
13namespace AQNWB::NWB
14{
19{
20public:
21 // Register the TimeSeries as a subclass of Container
25
26protected:
32 ElectricalSeries(const std::string& path, std::shared_ptr<IO::BaseIO> io);
33
34public:
38 ~ElectricalSeries() override;
39
67 const Types::ChannelVector& channelVector,
68 const std::string& description,
69 const float& conversion = 1.0f,
70 const float& resolution = -1.0f,
71 const float& offset = 0.0f,
72 const bool useChannelConversion = true);
73
87 Status writeChannel(SizeType channelInd,
88 const SizeType& numSamples,
89 const void* dataInput,
90 const void* timestampsInput,
91 const void* controlInput = nullptr);
92
125 Status writeAllChannels(const SizeType& numSamples,
126 const void* dataInput,
127 const void* timestampsInput = nullptr,
128 const void* controlInput = nullptr);
129
136 bool channelsAtSameSampleOffset() const;
137
142
145 float,
146 "channel_conversion",
147 Channel - specific conversion factor)
148
150 readData, recordData, float, "data", Recorded voltage data)
151
153 std::string,
154 "data/unit",
155 Base unit of measurement for working with the data.
156 This value is fixed to volts)
157
161 int,
162 "electrodes",
163 The indices of the electrodes that generated this electrical series.)
164
166 std::string,
167 "electrodes/description",
168 The electrodes that generated this electrical series.)
169
173 "electrodes/table",
174 The electrodes table retrieved from the object referenced in the
175 `electrodes / table` attribute.)
176
177private:
182};
183} // namespace AQNWB::NWB
AQNWB::Types::Status Status
Definition BaseIO.hpp:21
AQNWB::Types::SizeArray SizeArray
Definition BaseIO.hpp:22
AQNWB::Types::SizeType SizeType
Definition Channel.hpp:8
#define DEFINE_REFERENCED_REGISTERED_FIELD(name, registeredType, fieldPath, description)
Defines a lazy-loaded accessor function for reading fields that are RegisteredTypes that are linked t...
Definition RegisteredType.hpp:766
#define REGISTER_SUBCLASS(T, BASE, NAMESPACE)
Macro to register a subclass with the RegisteredType class registry.
Definition RegisteredType.hpp:547
#define DEFINE_ATTRIBUTE_FIELD(name, default_type, fieldPath, description)
Defines a lazy-loaded attribute field accessor function.
Definition RegisteredType.hpp:580
#define DEFINE_DATASET_FIELD(readName, writeName, default_type, fieldPath, description)
Defines a lazy-loaded dataset field accessor function.
Definition RegisteredType.hpp:619
Class for storing acquisition system channel information.
Definition Channel.hpp:16
Base class for array dataset configuration.
Definition BaseIO.hpp:277
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordChannelConversion(bool reset=false)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readChannelConversion() const
SizeArray m_samplesRecorded
The number of samples already written per channel.
Definition ElectricalSeries.hpp:181
bool channelsAtSameSampleOffset() const
Checks if all channels are at the same sample offset, i.e. if every channel has the same number of sa...
Definition ElectricalSeries.cpp:209
Status writeAllChannels(const SizeType &numSamples, const void *dataInput, const void *timestampsInput=nullptr, const void *controlInput=nullptr)
Writes a block of multichannel samples to an ElectricalSeries dataset in a single operation.
Definition ElectricalSeries.cpp:169
std::shared_ptr< RTYPE > readElectrodesTable() const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readDataUnit() const
ElectricalSeries(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition ElectricalSeries.cpp:16
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordElectrodes(bool reset=false)
Types::ChannelVector m_channelVector
Channel group that this time series is associated with.
Definition ElectricalSeries.hpp:141
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readElectrodes() const
Status writeChannel(SizeType channelInd, const SizeType &numSamples, const void *dataInput, const void *timestampsInput, const void *controlInput=nullptr)
Writes a channel to an ElectricalSeries dataset.
Definition ElectricalSeries.cpp:146
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordData(bool reset=false)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readElectrodesDescription() const
~ElectricalSeries() override
Destructor.
Definition ElectricalSeries.cpp:23
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readData() const
Represents a table containing electrode metadata.
Definition ElectrodesTable.hpp:17
Status initialize()
Initialize the object.
Definition NWBDataInterface.cpp:17
TimeSeries(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition TimeSeries.cpp:22
Namespace for all classes related to the NWB data standard.
const std::string namespaceName
Definition core.hpp:21
std::vector< Channel > ChannelVector
Alias for a vector of channels.
Definition Types.hpp:120