aqnwb 0.4.0
Loading...
Searching...
No Matches
EventsTable.hpp
Go to the documentation of this file.
1#pragma once
2
3// Common STL includes
4#include <memory>
5#include <optional>
6#include <string>
7#include <vector>
8// Base AqNWB includes for IO and RegisteredType
9#include "io/BaseIO.hpp"
10#include "io/ReadIO.hpp"
12// Include for parent type
16
17// Include for the namespace schema header
18#include "spec/core.hpp"
19
20namespace AQNWB::NWB
21{
22
35{
36public:
40 virtual ~EventsTable() override {}
41
49 const std::vector<DataSpecPtr>& dataSpecs) const override;
50
69 static std::vector<DataSpecPtr> createDefaultDataSpecs(
70 std::optional<float> timestampResolution = std::nullopt,
71 bool createDurationColumn = false,
72 std::optional<float> durationResolution = std::nullopt,
73 const bool createAnnotationColumn = false,
74 const SizeType rowChunkSize = 100);
75
98 const std::string& description,
99 const std::optional<std::string>& sourceDescription = std::nullopt,
100 const std::vector<DataSpecPtr>& columnSpecs = {});
101
102 // Define read methods
103 // description overrides inherited field from parent neurodata_type
106 std::string,
107 "description",
108 "A description of the events stored in the table - including information "
109 "about how the event times were computed - especially if the times are "
110 "the result of processing or filtering raw data. For example - if the "
111 "experimenter is encoding different types of events using a strobed or "
112 "N-bit encoding - then the description should describe which channels "
113 "were used and how the event time is computed - e.g. - as the rise time "
114 "of the first bit.")
115
118 std::string,
119 "source_description",
120 "Optional short text description of where the events came from - "
121 "applying to every row in the table. For example - Acquisition system "
122 "for events emitted directly by the acquisition system (e.g. - TTL edges "
123 "or hardware event channels); Thresholding of analog signal ANALOG1 at 3 "
124 "V for events produced by a detection algorithm run on acquired data; or "
125 "Manual video review for events added by a human annotator. This is a "
126 "free-text label of origin only; use `description` for the longer "
127 "narrative of how the event times were computed (channels used - "
128 "encoding scheme - algorithm parameters - etc.).")
129
132 "timestamp",
133 "Column containing the time that each event occurred "
134 "- in seconds - from the session start time.")
135
139 "duration",
140 "Optional column containing the duration of each event - in seconds. A "
141 "value of NaN can be used for events without a duration or with a "
142 "duration that is not yet specified.")
143
146 "annotation",
147 "Column containing user annotations about events.")
148
150
151protected:
157 EventsTable(const std::string& path, std::shared_ptr<AQNWB::IO::BaseIO> io);
158};
159
160} // namespace AQNWB::NWB
AQNWB::Types::Status Status
Definition BaseIO.hpp:21
AQNWB::Types::SizeType SizeType
Definition Channel.hpp:8
#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_REGISTERED_FIELD(name, registeredType, fieldPath, description)
Defines a lazy-loaded accessor function for reading fields that are RegisteredTypes.
Definition RegisteredType.hpp:672
Status initialize()
Initialize the container.
Definition Container.cpp:20
A 1-D VectorData that stores durations in seconds.
Definition DurationVectorData.hpp:24
Represents a group containing multiple datasets that are aligned on the first dimension.
Definition DynamicTable.hpp:32
DynamicTable(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition DynamicTable.cpp:19
static std::vector< DataSpecPtr > createDefaultDataSpecs(std::optional< float > timestampResolution=std::nullopt, bool createDurationColumn=false, std::optional< float > durationResolution=std::nullopt, const bool createAnnotationColumn=false, const SizeType rowChunkSize=100)
Creates the default data specs for the EventsTable.
Definition EventsTable.cpp:35
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readDescription() const
Status validateDataSpecs(const std::vector< DataSpecPtr > &dataSpecs) const override
Validates the provided data specifications for the EventsTable.
Definition EventsTable.cpp:23
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readSourceDescription() const
virtual ~EventsTable() override
Virtual destructor.
Definition EventsTable.hpp:40
std::shared_ptr< RTYPE > readTimestampColumn() const
std::shared_ptr< RTYPE > readDurationColumn() const
std::shared_ptr< RTYPE > readAnnotationColumn() const
EventsTable(const std::string &path, std::shared_ptr< AQNWB::IO::BaseIO > io)
Constructor.
Definition EventsTable.cpp:17
A 1-D VectorData that stores timestamps in seconds from the session start time. Timestamps are not re...
Definition TimestampVectorData.hpp:25
An n-dimensional dataset representing a column of a DynamicTable.
Definition VectorData.hpp:23
The namespace for IO components of AqNWB.
Namespace for all classes related to the NWB data standard.
The namespace for managing format schema and namespaces.
The main namespace for AqNWB.
Definition Channel.hpp:11