aqnwb 0.4.0
Loading...
Searching...
No Matches
ElectrodesTable.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include "io/BaseIO.hpp"
9#include "spec/core.hpp"
10
11namespace AQNWB::NWB
12{
17{
18public:
19 // Register the ElectrodesTable as a subclass of Container
23
24protected:
30 explicit ElectrodesTable(std::shared_ptr<IO::BaseIO> io);
31
32 // required so we can call create
33 ElectrodesTable(const std::string& path, std::shared_ptr<IO::BaseIO> io);
34
35public:
42 static std::shared_ptr<ElectrodesTable> create(std::shared_ptr<IO::BaseIO> io)
43 {
46 }
47
51 ~ElectrodesTable() override;
52
60 const std::vector<DataSpecPtr>& dataSpecs) const override;
61
67 static std::vector<DataSpecPtr> createDefaultDataSpecs(
68 const SizeType rowChunkSize = 100);
69
81 Status initialize(const std::string& description =
82 "metadata about extracellular electrodes",
83 const std::vector<DataSpecPtr>& columnSpecs = {});
84
92 Status finalize() override;
93
98 void addElectrodes(const std::vector<Channel>& channelsInput);
99
103 inline const static std::string electrodesTablePath =
104 "/general/extracellular_ephys/electrodes";
105
109 "location",
110 "the location of channel within the subject e.g. brain region")
111
114 VectorDataTyped<std::string>,
115 "group_name",
116 "the name of the ElectrodeGroup this electrode is a part of")
117
118private:
122 std::vector<int> m_electrodeNumbers;
123
127 std::vector<std::string> m_groupNames;
128
132 std::vector<std::string> m_locationNames;
133
138 std::vector<std::string> m_groupReferences;
139
143 inline const static std::string m_groupPathBase =
144 "/general/extracellular_ephys";
145};
146
147} // 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_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
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
std::vector< std::string > m_groupNames
The names of the ElectrodeGroup object for each added electrode.
Definition ElectrodesTable.hpp:127
std::shared_ptr< RTYPE > readLocationColumn() const
std::vector< std::string > m_groupReferences
The references to the ElectrodeGroup object for each added electrode.
Definition ElectrodesTable.hpp:138
Status validateDataSpecs(const std::vector< DataSpecPtr > &dataSpecs) const override
Validates the provided data specifications for the ElectrodesTable.
Definition ElectrodesTable.cpp:65
~ElectrodesTable() override
Destructor.
Definition ElectrodesTable.cpp:31
static const std::string m_groupPathBase
The references path to the ElectrodeGroup.
Definition ElectrodesTable.hpp:143
static std::shared_ptr< ElectrodesTable > create(std::shared_ptr< IO::BaseIO > io)
Convenience factor method since the path is fixed to electrodeTablePath.
Definition ElectrodesTable.hpp:42
std::vector< std::string > m_locationNames
The location names for each added electrode.
Definition ElectrodesTable.hpp:132
static const std::string electrodesTablePath
The path to the ElectrodesTable.
Definition ElectrodesTable.hpp:103
Status finalize() override
Finalizes the ElectrodesTable.
Definition ElectrodesTable.cpp:112
static std::vector< DataSpecPtr > createDefaultDataSpecs(const SizeType rowChunkSize=100)
Creates the default data specs for the ElectrodesTable.
Definition ElectrodesTable.cpp:33
std::vector< int > m_electrodeNumbers
The global indices for each added electrode.
Definition ElectrodesTable.hpp:122
std::shared_ptr< RTYPE > readGroupNameColumn() const
ElectrodesTable(std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition ElectrodesTable.cpp:13
void addElectrodes(const std::vector< Channel > &channelsInput)
Sets up the ElectrodesTable by adding electrodes and their metadata.
Definition ElectrodesTable.cpp:100
static std::shared_ptr< RegisteredType > create(const std::string &fullClassName, const std::string &path, std::shared_ptr< IO::BaseIO > io, bool fallbackToBase=false)
Create or retrieve the canonical instance of a registered subclass.
Definition RegisteredType.cpp:87
A typed n-dimensional dataset representing a column of a DynamicTable.
Definition VectorData.hpp:143
Namespace for all classes related to the NWB data standard.
const std::string namespaceName
Definition core.hpp:21