aqnwb 0.2.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 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
52
63 Status initialize(const std::string& description =
64 "metadata about extracellular electrodes");
65
73 Status finalize() override;
74
79 void addElectrodes(std::vector<Channel> channelsInput);
80
84 inline const static std::string electrodesTablePath =
85 "/general/extracellular_ephys/electrodes";
86
90 "location",
91 "the location of channel within the subject e.g. brain region")
92
95 VectorDataTyped<std::string>,
96 "group_name",
97 "the name of the ElectrodeGroup this electrode is a part of")
98
99private:
103 std::vector<int> m_electrodeNumbers;
104
108 std::vector<std::string> m_groupNames;
109
113 std::vector<std::string> m_locationNames;
114
119 std::vector<std::string> m_groupReferences;
120
124 inline const static std::string m_groupPathBase =
125 "/general/extracellular_ephys";
126
131
136};
137} // namespace AQNWB::NWB
AQNWB::Types::Status Status
Definition BaseIO.hpp:22
#define REGISTER_SUBCLASS(T, BASE, NAMESPACE)
Macro to register a subclass with the RegisteredType class registry.
Definition RegisteredType.hpp:501
#define DEFINE_REGISTERED_FIELD(name, registeredType, fieldPath, description)
Defines a lazy-loaded accessor function for reading fields that are RegisteredTypes.
Definition RegisteredType.hpp:638
Status initialize()
Initialize the container.
Definition Container.cpp:20
DynamicTable(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition DynamicTable.cpp:12
std::vector< std::string > m_groupNames
The names of the ElectrodeGroup object for each added electrode.
Definition ElectrodesTable.hpp:108
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:119
std::shared_ptr< VectorData > m_groupNamesVectorData
The group names column for write.
Definition ElectrodesTable.hpp:130
void addElectrodes(std::vector< Channel > channelsInput)
Sets up the ElectrodesTable by adding electrodes and their metadata.
Definition ElectrodesTable.cpp:68
static const std::string m_groupPathBase
The references path to the ElectrodeGroup.
Definition ElectrodesTable.hpp:124
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
~ElectrodesTable()
Destructor.
Definition ElectrodesTable.cpp:39
std::vector< std::string > m_locationNames
The location names for each added electrode.
Definition ElectrodesTable.hpp:113
static const std::string electrodesTablePath
The path to the ElectrodesTable.
Definition ElectrodesTable.hpp:84
Status finalize() override
Finalizes the ElectrodesTable.
Definition ElectrodesTable.cpp:80
std::vector< int > m_electrodeNumbers
The global indices for each added electrode.
Definition ElectrodesTable.hpp:103
std::shared_ptr< RTYPE > readGroupNameColumn() const
ElectrodesTable(std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition ElectrodesTable.cpp:13
std::shared_ptr< VectorData > m_locationsVectorData
The locations column for write.
Definition ElectrodesTable.hpp:135
static std::shared_ptr< RegisteredType > create(const std::string &fullClassName, const std::string &path, std::shared_ptr< IO::BaseIO > io, bool fallbackToBase=false)
Create an instance of a registered subclass by name.
Definition RegisteredType.cpp:75
An n-dimensional dataset representing a column of a DynamicTable.
Definition VectorData.hpp:16
A typed n-dimensional dataset representing a column of a DynamicTable.
Definition VectorData.hpp:113
Namespace for all classes related to the NWB data standard.
const std::string namespaceName
Definition core.hpp:21