aqnwb 0.1.0
Loading...
Searching...
No Matches
NWBFile.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstdint>
5#include <memory>
6#include <string>
7#include <string_view>
8#include <vector>
9
10#include "BaseIO.hpp"
11#include "Types.hpp"
16
21namespace AQNWB::NWB
22{
23
28class NWBFile : public Container
29{
30public:
36 NWBFile(const std::string& idText, std::shared_ptr<BaseIO> io);
37
41 NWBFile(const NWBFile&) = delete;
42
46 NWBFile& operator=(const NWBFile&) = delete;
47
51 ~NWBFile();
52
59 Status initialize(const std::string description = "a recording session",
60 const std::string dataCollection = "");
61
66
85 std::vector<Types::ChannelVector> recordingArrays,
86 std::vector<std::string> recordingNames,
87 const BaseDataType& dataType = BaseDataType::I16,
88 RecordingContainers* recordingContainers = nullptr,
89 std::vector<SizeType>& containerIndexes = emptyContainerIndexes);
90
106 std::vector<Types::ChannelVector> recordingArrays,
107 std::vector<std::string> recordingNames,
108 const BaseDataType& dataType = BaseDataType::I16,
109 RecordingContainers* recordingContainers = nullptr,
110 std::vector<SizeType>& containerIndexes = emptyContainerIndexes);
111
112protected:
122 Status createFileStructure(std::string description,
123 std::string dataCollection);
124
125private:
135 std::unique_ptr<BaseRecordingData> createRecordingData(
136 BaseDataType type,
137 const SizeArray& size,
138 const SizeArray& chunking,
139 const std::string& path);
140
149 template<SizeType N>
150 void cacheSpecifications(
151 const std::string& specPath,
152 const std::string& versionNumber,
153 const std::array<std::pair<std::string_view, std::string_view>, N>&
154 specVariables);
155
156 inline const static std::string acquisitionPath = "/acquisition";
157 static std::vector<SizeType> emptyContainerIndexes;
158
159private:
163 std::unique_ptr<ElectrodeTable> m_electrodeTable;
164 const std::string m_identifierText;
165};
166
167} // namespace AQNWB::NWB
AQNWB::Types::SizeArray SizeArray
Definition BaseIO.hpp:15
Represents a base data type.
Definition BaseIO.hpp:35
static const BaseDataType I16
Accessor for signed 16-bit integer.
Definition BaseIO.hpp:72
Abstract data type for a group storing collections of data and metadata.
Definition Container.hpp:15
void initialize()
Initialize the container.
Definition Container.cpp:18
The NWBFile class provides an interface for setting up and managing the NWB file.
Definition NWBFile.hpp:29
Status createSpikeEventSeries(std::vector< Types::ChannelVector > recordingArrays, std::vector< std::string > recordingNames, const BaseDataType &dataType=BaseDataType::I16, RecordingContainers *recordingContainers=nullptr, std::vector< SizeType > &containerIndexes=emptyContainerIndexes)
Create SpikeEventSeries objects to record data into. Created objects are stored in recordingContainer...
Definition NWBFile.cpp:178
NWBFile(const NWBFile &)=delete
Deleted copy constructor to prevent construction-copying.
Status createFileStructure(std::string description, std::string dataCollection)
Creates the default file structure. Note, this function will fail if the file is in a mode where new ...
Definition NWBFile.cpp:58
Status createElectricalSeries(std::vector< Types::ChannelVector > recordingArrays, std::vector< std::string > recordingNames, const BaseDataType &dataType=BaseDataType::I16, RecordingContainers *recordingContainers=nullptr, std::vector< SizeType > &containerIndexes=emptyContainerIndexes)
Create ElectricalSeries objects to record data into. Created objects are stored in recordingContainer...
Definition NWBFile.cpp:104
NWBFile & operator=(const NWBFile &)=delete
Deleted copy assignment operator to prevent copying.
~NWBFile()
Destructor for NWBFile class.
Definition NWBFile.cpp:40
NWBFile(const std::string &idText, std::shared_ptr< BaseIO > io)
Constructor for NWBFile class.
Definition NWBFile.cpp:33
Status finalize()
Finalizes the NWB file by closing it.
Definition NWBFile.cpp:53
The RecordingContainers class provides an interface for managing and holding groups of Containers acq...
Definition RecordingContainers.hpp:16
Status
Represents the status of an operation.
Definition Types.hpp:22
Namespace for all classes related to the NWB data standard.
Definition TimeSeries.hpp:9