aqnwb 0.5.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 <optional>
7#include <string>
8#include <string_view>
9#include <utility>
10#include <vector>
11
12#include "Types.hpp"
13#include "Utils.hpp"
14#include "io/BaseIO.hpp"
15#include "io/ReadIO.hpp"
22#include "nwb/file/Subject.hpp"
23#include "spec/core.hpp"
24
29namespace AQNWB::NWB
30{
31
45class NWBFile : public NWBContainer
46{
47public:
48 // Register the NWBFile as a subclass of NWBContainer
50
51 // Static paths for NWB file structure
53 inline const static std::string ACQUISITION_PATH = "/acquisition";
55 inline const static std::string SPECIFICATIONS_PATH = "/specifications";
57 inline const static std::string PROCESSING_PATH = "/processing";
59 inline const static std::string STIMULUS_PATH = "/stimulus";
61 inline const static std::string GENERAL_PATH = "/general";
63 inline const static std::string ANALYSIS_PATH = "/analysis";
65 inline const static std::string EVENTS_PATH = "/events";
67 inline const static std::string INTERVALS_PATH = "/intervals";
68
79 {
81 std::optional<std::string> experimentDescription = std::nullopt;
84 std::optional<std::vector<std::string>> experimenter = std::nullopt;
87 std::optional<std::string> institution = std::nullopt;
89 std::optional<std::vector<std::string>> keywords = std::nullopt;
91 std::optional<std::string> lab = std::nullopt;
93 std::optional<std::string> notes = std::nullopt;
96 std::optional<std::string> pharmacology = std::nullopt;
99 std::optional<std::string> protocol = std::nullopt;
102 std::optional<std::vector<std::string>> relatedPublications = std::nullopt;
104 std::optional<std::string> sessionId = std::nullopt;
107 std::optional<std::string> slices = std::nullopt;
110 std::optional<std::string> sourceScript = std::nullopt;
113 std::optional<std::string> sourceScriptFileName = std::nullopt;
116 std::optional<std::string> stimulusNotes = std::nullopt;
119 std::optional<std::string> surgery = std::nullopt;
122 std::optional<std::string> virus = std::nullopt;
126 std::optional<std::vector<std::pair<std::string, std::string>>>
127 wasGeneratedBy = std::nullopt;
128
136 {
137 experimentDescription = std::move(value);
138 return *this;
139 }
140
147 GeneralMetadataSpec& withExperimenter(std::vector<std::string> value)
148 {
149 experimenter = std::move(value);
150 return *this;
151 }
152
160 {
161 institution = std::move(value);
162 return *this;
163 }
164
170 GeneralMetadataSpec& withKeywords(std::vector<std::string> value)
171 {
172 keywords = std::move(value);
173 return *this;
174 }
175
181 GeneralMetadataSpec& withLab(std::string value)
182 {
183 lab = std::move(value);
184 return *this;
185 }
186
192 GeneralMetadataSpec& withNotes(std::string value)
193 {
194 notes = std::move(value);
195 return *this;
196 }
197
205 {
206 pharmacology = std::move(value);
207 return *this;
208 }
209
217 {
218 protocol = std::move(value);
219 return *this;
220 }
221
228 GeneralMetadataSpec& withRelatedPublications(std::vector<std::string> value)
229 {
230 relatedPublications = std::move(value);
231 return *this;
232 }
233
240 {
241 sessionId = std::move(value);
242 return *this;
243 }
244
251 GeneralMetadataSpec& withSlices(std::string value)
252 {
253 slices = std::move(value);
254 return *this;
255 }
256
264 {
265 sourceScript = std::move(value);
266 return *this;
267 }
268
276 {
277 sourceScriptFileName = std::move(value);
278 return *this;
279 }
280
288 {
289 stimulusNotes = std::move(value);
290 return *this;
291 }
292
300 {
301 surgery = std::move(value);
302 return *this;
303 }
304
311 GeneralMetadataSpec& withVirus(std::string value)
312 {
313 virus = std::move(value);
314 return *this;
315 }
316
325 std::vector<std::pair<std::string, std::string>> value)
326 {
327 wasGeneratedBy = std::move(value);
328 return *this;
329 }
330 };
331
337 static std::shared_ptr<NWBFile> create(std::shared_ptr<IO::BaseIO> io)
338 {
339 return RegisteredType::create<NWBFile>("/", io);
340 }
341
342protected:
347 explicit NWBFile(std::shared_ptr<IO::BaseIO> io);
348
352 NWBFile(const std::string& path, std::shared_ptr<IO::BaseIO> io);
353
354public:
358 NWBFile(const NWBFile&) = delete;
359
363 NWBFile& operator=(const NWBFile&) = delete;
364
368 ~NWBFile() override;
369
392 const std::string& identifierText,
393 const std::string& description = "a recording session",
394 const std::string& dataCollection = "",
395 const std::string& sessionStartTime = "",
396 const std::string& timestampsReferenceTime = "",
397 const std::optional<AQNWB::NWB::Subject::SubjectSpec>& subjectSpec =
398 std::nullopt,
399 const std::optional<GeneralMetadataSpec>& generalMetadataSpec =
400 std::nullopt);
401
413 Status setSessionStartTime(const std::string& sessionStartTime);
414
426 Status setTimestampsReferenceTime(const std::string& timestampsReferenceTime);
427
435 bool isInitialized() const;
436
453 std::shared_ptr<ElectrodesTable> createElectrodesTable(
454 std::vector<Types::ChannelVector> recordingArrays,
455 bool finalizeTable = true,
456 const SizeType rowChunkSize = 100);
457
468 static Status requireEventsGroup(std::shared_ptr<IO::BaseIO> io);
469
480 static Status requireIntervalsGroup(std::shared_ptr<IO::BaseIO> io);
481
506 std::shared_ptr<EventsTable> createEventsTable(
507 const std::string& name,
508 const std::string& description,
509 const std::optional<std::string>& sourceDescription = std::nullopt,
510 std::optional<float> timestampResolution = std::nullopt,
511 bool createDurationColumn = false,
512 std::optional<float> durationResolution = std::nullopt,
513 const bool createAnnotationColumn = false,
514 const SizeType rowChunkSize = 100);
515
537 std::shared_ptr<EventsTable> createEventsTable(
538 const std::string& name,
539 const std::string& description,
540 const std::string& sourceDescription,
541 const std::vector<NWB::DynamicTable::DataSpecPtr>& columnSpecs);
542
549 std::shared_ptr<TimeIntervals> createEpochs(
550 const bool createTagsColumn = false, const SizeType rowChunkSize = 100);
551
558 std::shared_ptr<TimeIntervals> createTrials(
559 const bool createTagsColumn = false, const SizeType rowChunkSize = 100);
560
567 std::shared_ptr<TimeIntervals> createInvalidTimes(
568 const bool createTagsColumn = false, const SizeType rowChunkSize = 100);
569
582 std::shared_ptr<TimeIntervals> createTimeIntervals(
583 const std::string& name,
584 const std::string& description,
585 const bool createTagsColumn = false,
586 const SizeType rowChunkSize = 100);
587
604 std::shared_ptr<TimeIntervals> createTimeIntervals(
605 const std::string& name,
606 const std::string& description,
607 const std::vector<NWB::DynamicTable::DataSpecPtr>& columnSpecs);
608
626 std::vector<Types::ChannelVector> recordingArrays,
627 std::vector<std::string> recordingNames,
628 const IO::BaseDataType& dataType,
629 std::vector<SizeType>& containerIndexes);
630
660 std::vector<Types::ChannelVector> recordingArrays,
661 std::vector<std::string> recordingNames,
662 const IO::BaseDataType& dataType,
663 std::vector<SizeType>& containerIndexes,
664 const SizeType numSamples,
665 const bool useChannelConversion = true);
666
675 Status createAnnotationSeries(const std::vector<std::string>& recordingNames,
676 std::vector<SizeType>& containerIndexes);
677
680 "intervals/epochs",
681 "Table of experimental epochs.")
682
685 "intervals/trials",
686 "Table of experimental trials.")
687
690 "intervals/invalid_times",
691 "Table of invalid times.")
692
695 ElectrodesTable::electrodesTablePath,
696 "table with the extracellular electrodes")
697
699 std::string,
700 "nwb_version",
701 File version string)
702
705 std::string,
706 "file_create_date",
707 A record of the date the file was created and of
708 subsequent modifications)
709
712 std::string,
713 "identifier",
714 A unique text identifier for the file)
715
718 std::string,
719 "session_description",
720 A description of the experimental session and data in the
721 file)
722
725 std::string,
726 "session_start_time",
727 Date and time of the experiment or session start)
728
731 std::string,
732 "timestamps_reference_time",
733 Date and time corresponding to time zero of all
734 timestamps)
735
738 std::string,
739 "general/data_collection",
740 Notes about data collection and analysis)
741
744 std::string,
745 "general/experiment_description",
746 General description of the experiment)
747
750 std::string,
751 "general/experimenter",
752 Name of person(s) who performed the experiment)
753
756 std::string,
757 "general/institution",
758 Institution(s) where experiment was performed)
759
762 std::string,
763 "general/keywords",
764 Terms to search over)
765
767 recordLab,
768 std::string,
769 "general/lab",
770 Laboratory where experiment was performed)
771
774 std::string,
775 "general/notes",
776 Notes about the experiment)
777
780 std::string,
781 "general/pharmacology",
782 Description of drugs used)
783
786 std::string,
787 "general/protocol",
788 Experimental protocol)
789
792 std::string,
793 "general/related_publications",
794 Publication information)
795
798 std::string,
799 "general/session_id",
800 Lab-specific ID for the session)
801
804 std::string,
805 "general/slices",
806 Description of slices)
807
811 std::string,
812 "general/source_script",
813 Script file or link to public source code used to create this NWB file)
814
817 std::string,
818 "general/stimulus",
819 Notes about stimuli)
820
823 std::string,
824 "general/surgery",
825 Narrative description about surgery / surgeries)
826
829 std::string,
830 "general/virus",
831 Information about virus(es) used in experiments)
832
835 std::string,
836 "general/was_generated_by",
837 Name and version of software package(s) used to generate
838 data in this file(shape[num_sources, 2]))
839
841 std::string,
842 "general/source_script/file_name",
843 Name of script file)
844
848 "acquisition",
849 Get a TimeSeries stored in the acquisition
850 group)
851
855 "processing",
856 Get a ProcessingModule stored in the
857 processing group)
858
862 "intervals",
863 Get a TimeIntervals object stored in the
864 intervals group)
865
869 "events",
870 Get an EventsTable stored in the events group)
871
872protected:
888 Status createFileStructure(const std::string& identifierText,
889 const std::string& description,
890 const std::string& dataCollection,
891 const std::string& sessionStartTime,
892 const std::string& timestampsReferenceTime);
893
894private:
901 void cacheSpecifications(const Types::NamespaceInfo& namespaceInfo);
902
912
922 bool isNewOptionalDataSet(const std::string& path) const;
923
932 Status createOptionalTextDataSet(const std::string& path,
933 const std::optional<std::string>& value);
934
944 const std::string& path,
945 const std::optional<std::vector<std::string>>& values);
946
955 static SizeType getNumBytes(const IO::BaseDataType& dataType);
956
969 Status overwriteTimeDataSet(const std::string& path,
970 const std::string& time,
971 const std::string& caller);
972
977};
978
979} // 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_DATASET_FIELD(readName, writeName, default_type, fieldPath, description)
Defines a lazy-loaded dataset field accessor function.
Definition RegisteredType.hpp:619
#define DEFINE_UNNAMED_REGISTERED_FIELD(readName, writeName, registeredType, fieldPrefixPath, description)
Defines a lazy-loaded accessor function for reading fields that are RegisteredTypes that do not have ...
Definition RegisteredType.hpp:711
#define DEFINE_REGISTERED_FIELD(name, registeredType, fieldPath, description)
Defines a lazy-loaded accessor function for reading fields that are RegisteredTypes.
Definition RegisteredType.hpp:672
Represents a base data type.
Definition BaseIO.hpp:47
Represents a table containing electrode metadata.
Definition ElectrodesTable.hpp:17
A column-based table to store information about events, one event per row. Use EventsTable when each ...
Definition EventsTable.hpp:35
Status initialize()
Initialize the object.
Definition NWBContainer.cpp:17
NWBContainer(const std::string &path, std::shared_ptr< AQNWB::IO::BaseIO > io)
Constructor.
Definition NWBContainer.cpp:11
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordSessionId(bool reset=false)
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordSlices(bool reset=false)
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordNotes(bool reset=false)
static SizeType getNumBytes(const IO::BaseDataType &dataType)
Number of bytes of a single element of the given data type.
Definition NWBFile.cpp:961
static const std::string STIMULUS_PATH
The path to the stimulus group in the NWB file.
Definition NWBFile.hpp:59
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordTimestampsReferenceTime(bool reset=false)
std::unique_ptr< RTYPE > createAquisitionSeries(std::string &objectName) const
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordInstitution(bool reset=false)
std::unique_ptr< RTYPE > createProcessingModule(std::string &objectName) const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readWasGeneratedBy() const
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordFileCreateDate(bool reset=false)
bool isNewOptionalDataSet(const std::string &path) const
Checks whether an optional dataset can be created at the path.
Definition NWBFile.cpp:248
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readPharmacology() const
static Status requireIntervalsGroup(std::shared_ptr< IO::BaseIO > io)
Ensure that the intervals group exists in the NWB file.
Definition NWBFile.cpp:529
std::shared_ptr< RTYPE > readInvalidTimes() const
NWBFile(std::shared_ptr< IO::BaseIO > io)
Constructor for NWBFile class.
Definition NWBFile.cpp:39
Status createOptionalTextDataSet(const std::string &path, const std::optional< std::string > &value)
Creates an optional text dataset if a value is set and the dataset doesn't exist yet (see isNewOption...
Definition NWBFile.cpp:259
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readTimestampsReferenceTime() const
std::unique_ptr< RTYPE > createEventsTableInstance(std::string &objectName) const
std::shared_ptr< TimeIntervals > createInvalidTimes(const bool createTagsColumn=false, const SizeType rowChunkSize=100)
Create the Invalid Times table in the INTERVALS_PATH group.
Definition NWBFile.cpp:654
static std::shared_ptr< NWBFile > create(std::shared_ptr< IO::BaseIO > io)
Convenience factor method since the path is fixed to '/'.
Definition NWBFile.hpp:337
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readLab() const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readInstitution() const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readSessionDescription() const
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordExperimenter(bool reset=false)
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordSourceScript(bool reset=false)
std::unique_ptr< RTYPE > createTimeIntervalsInstance(std::string &objectName) const
NWBFile(const NWBFile &)=delete
Deleted copy constructor to prevent construction-copying.
static const std::string ACQUISITION_PATH
The path to the acquisition group in the NWB file.
Definition NWBFile.hpp:53
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordIdentifier(bool reset=false)
std::shared_ptr< RTYPE > readTimeIntervals(std::string &objectName) const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readProtocol() const
std::shared_ptr< RTYPE > readAquisitionSeries(std::string &objectName) const
Status setSessionStartTime(const std::string &sessionStartTime)
Change the session start time of an initialized file.
Definition NWBFile.cpp:312
Status createGeneralMetadata(const GeneralMetadataSpec &spec)
Writes the fields of a GeneralMetadataSpec to /general.
Definition NWBFile.cpp:136
static Status requireEventsGroup(std::shared_ptr< IO::BaseIO > io)
Ensure that the events group exists in the NWB file.
Definition NWBFile.cpp:515
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readSurgery() const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readKeywords() const
std::shared_ptr< TimeIntervals > createEpochs(const bool createTagsColumn=false, const SizeType rowChunkSize=100)
Create the Epochs table in the INTERVALS_PATH group.
Definition NWBFile.cpp:632
std::shared_ptr< RTYPE > readElectrodesTable() const
std::shared_ptr< TimeIntervals > createTimeIntervals(const std::string &name, const std::string &description, const bool createTagsColumn=false, const SizeType rowChunkSize=100)
Create a TimeIntervals table in the INTERVALS_PATH group. Note, this function will fail if the file i...
Definition NWBFile.cpp:663
static const std::string EVENTS_PATH
The path to the root events group in the NWB file.
Definition NWBFile.hpp:65
Status createFileStructure(const std::string &identifierText, const std::string &description, const std::string &dataCollection, const std::string &sessionStartTime, const std::string &timestampsReferenceTime)
Creates the default file structure. Note, this function will fail if the file is in a mode where new ...
Definition NWBFile.cpp:366
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordRelatedPublications(bool reset=false)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readSourceScriptFileName() const
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordVirus(bool reset=false)
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordExperimentDescription(bool reset=false)
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordSessionStartTime(bool reset=false)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readExperimentDescription() const
std::shared_ptr< RTYPE > readProcessingModule(std::string &objectName) const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readVirus() const
static std::shared_ptr< NWBFile > create(const std::string &path, std::shared_ptr< AQNWB::IO::BaseIO > io)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readDataCollection() const
std::shared_ptr< TimeIntervals > createTrials(const bool createTagsColumn=false, const SizeType rowChunkSize=100)
Create the Trials table in the INTERVALS_PATH group.
Definition NWBFile.cpp:643
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readSourceScript() const
Status setTimestampsReferenceTime(const std::string &timestampsReferenceTime)
Change the timestamps reference time of an initialized file.
Definition NWBFile.cpp:318
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordKeywords(bool reset=false)
NWBFile & operator=(const NWBFile &)=delete
Deleted copy assignment operator to prevent copying.
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordStimulusNotes(bool reset=false)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readSessionId() const
std::shared_ptr< RTYPE > readEpochs() const
std::shared_ptr< RTYPE > readTrials() const
std::unique_ptr< ElectrodesTable > m_electrodeTable
The ElectrodesTable for the file.
Definition NWBFile.hpp:976
Status overwriteTimeDataSet(const std::string &path, const std::string &time, const std::string &caller)
Overwrites the value of an existing scalar time dataset (e.g., /session_start_time).
Definition NWBFile.cpp:282
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readSlices() const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readIdentifier() const
Status createAnnotationSeries(const std::vector< std::string > &recordingNames, std::vector< SizeType > &containerIndexes)
Create AnnotationSeries objects to record data into. Created objects are automatically added to the I...
Definition NWBFile.cpp:902
void cacheSpecifications(const Types::NamespaceInfo &namespaceInfo)
Saves the specification files for the schema.
Definition NWBFile.cpp:938
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordDataCollection(bool reset=false)
static const std::string GENERAL_PATH
The path to the general group in the NWB file.
Definition NWBFile.hpp:61
bool isInitialized() const
Check if the NWB file is initialized.
Definition NWBFile.cpp:326
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordProtocol(bool reset=false)
~NWBFile() override
Destructor for NWBFile class.
Definition NWBFile.cpp:54
std::shared_ptr< RTYPE > readEventsTable(std::string &objectName) const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readRelatedPublications() const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readNWBVersion() const
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readNotes() const
static const std::string PROCESSING_PATH
The path to the processing group in the NWB file.
Definition NWBFile.hpp:57
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readExperimenter() const
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordLab(bool reset=false)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readFileCreateDate() const
std::shared_ptr< ElectrodesTable > createElectrodesTable(std::vector< Types::ChannelVector > recordingArrays, bool finalizeTable=true, const SizeType rowChunkSize=100)
Create ElectrodesTable. Note, this function will fail if the file is in a mode where new objects cann...
Definition NWBFile.cpp:442
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readStimulusNotes() const
std::shared_ptr< EventsTable > createEventsTable(const std::string &name, const std::string &description, const std::optional< std::string > &sourceDescription=std::nullopt, std::optional< float > timestampResolution=std::nullopt, bool createDurationColumn=false, std::optional< float > durationResolution=std::nullopt, const bool createAnnotationColumn=false, const SizeType rowChunkSize=100)
Create an EventsTable in the EVENTS_PATH group. Note, this function will fail if the file is in a mod...
Definition NWBFile.cpp:543
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordSurgery(bool reset=false)
Status createElectricalSeries(std::vector< Types::ChannelVector > recordingArrays, std::vector< std::string > recordingNames, const IO::BaseDataType &dataType, std::vector< SizeType > &containerIndexes)
Create ElectricalSeries objects to record data into. Created objects are automatically added to the I...
Definition NWBFile.cpp:744
static const std::string SPECIFICATIONS_PATH
The path to the specification group in the NWB file.
Definition NWBFile.hpp:55
static const std::string ANALYSIS_PATH
The path to the analysis group in the NWB file.
Definition NWBFile.hpp:63
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordWasGeneratedBy(bool reset=false)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readSessionStartTime() const
static const std::string INTERVALS_PATH
The path to the root intervals group in the NWB file.
Definition NWBFile.hpp:67
Status createSpikeEventSeries(std::vector< Types::ChannelVector > recordingArrays, std::vector< std::string > recordingNames, const IO::BaseDataType &dataType, std::vector< SizeType > &containerIndexes, const SizeType numSamples, const bool useChannelConversion=true)
Create SpikeEventSeries objects to record data into. Created objects are automatically added to the I...
Definition NWBFile.cpp:802
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordSessionDescription(bool reset=false)
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordPharmacology(bool reset=false)
A collection of processed data.
Definition ProcessingModule.hpp:27
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 container for aggregating epoch data and the TimeSeries that each epoch applies to.
Definition TimeIntervals.hpp:30
General purpose time series.
Definition TimeSeries.hpp:19
The namespace for IO components of AqNWB.
Namespace for all classes related to the NWB data standard.
const std::string namespaceName
Definition core.hpp:21
Provides definitions for various types used in the project.
Definition Types.hpp:24
Optional metadata of the experiment in /general.
Definition NWBFile.hpp:79
GeneralMetadataSpec & withProtocol(std::string value)
Set the protocol field.
Definition NWBFile.hpp:216
GeneralMetadataSpec & withRelatedPublications(std::vector< std::string > value)
Set the relatedPublications field.
Definition NWBFile.hpp:228
GeneralMetadataSpec & withExperimenter(std::vector< std::string > value)
Set the experimenter field.
Definition NWBFile.hpp:147
std::optional< std::string > sessionId
Lab-specific ID for the session (session_id).
Definition NWBFile.hpp:104
GeneralMetadataSpec & withInstitution(std::string value)
Set the institution field.
Definition NWBFile.hpp:159
GeneralMetadataSpec & withSurgery(std::string value)
Set the surgery field.
Definition NWBFile.hpp:299
std::optional< std::vector< std::pair< std::string, std::string > > > wasGeneratedBy
Name and version of the software package(s) used to generate the data in this file (was_generated_by)...
Definition NWBFile.hpp:127
std::optional< std::vector< std::string > > experimenter
Name of person(s) who performed the experiment (experimenter), e.g., "Last, First".
Definition NWBFile.hpp:84
GeneralMetadataSpec & withPharmacology(std::string value)
Set the pharmacology field.
Definition NWBFile.hpp:204
GeneralMetadataSpec & withSourceScript(std::string value)
Set the sourceScript field.
Definition NWBFile.hpp:263
GeneralMetadataSpec & withKeywords(std::vector< std::string > value)
Set the keywords field.
Definition NWBFile.hpp:170
std::optional< std::string > institution
Institution(s) where the experiment was performed (institution).
Definition NWBFile.hpp:87
GeneralMetadataSpec & withSourceScriptFileName(std::string value)
Set the sourceScriptFileName field.
Definition NWBFile.hpp:275
GeneralMetadataSpec & withSlices(std::string value)
Set the slices field.
Definition NWBFile.hpp:251
std::optional< std::string > notes
Notes about the experiment (notes).
Definition NWBFile.hpp:93
GeneralMetadataSpec & withLab(std::string value)
Set the lab field.
Definition NWBFile.hpp:181
std::optional< std::string > virus
Information about virus(es) used in experiments, including virus ID, source, date made,...
Definition NWBFile.hpp:122
std::optional< std::string > stimulusNotes
Notes about stimuli, such as how and where they were presented (/general/stimulus).
Definition NWBFile.hpp:116
std::optional< std::string > pharmacology
Description of drugs used, including how and when they were administered (pharmacology).
Definition NWBFile.hpp:96
std::optional< std::string > protocol
Experimental protocol, e.g., the IACUC protocol number (protocol).
Definition NWBFile.hpp:99
std::optional< std::string > lab
Laboratory where the experiment was performed (lab).
Definition NWBFile.hpp:91
GeneralMetadataSpec & withExperimentDescription(std::string value)
Set the experimentDescription field.
Definition NWBFile.hpp:135
std::optional< std::string > slices
Description of slices, including preparation thickness, orientation, temperature, and bath solution (...
Definition NWBFile.hpp:107
std::optional< std::string > sourceScript
Script file or link to public source code used to create this NWB file (source_script)....
Definition NWBFile.hpp:110
std::optional< std::vector< std::string > > relatedPublications
Publication information, e.g., PMID, DOI, URL (related_publications).
Definition NWBFile.hpp:102
GeneralMetadataSpec & withStimulusNotes(std::string value)
Set the stimulusNotes field.
Definition NWBFile.hpp:287
std::optional< std::string > experimentDescription
General description of the experiment (experiment_description).
Definition NWBFile.hpp:81
GeneralMetadataSpec & withSessionId(std::string value)
Set the sessionId field.
Definition NWBFile.hpp:239
std::optional< std::string > surgery
Narrative description about surgery/surgeries, including date(s) and who performed surgery (surgery).
Definition NWBFile.hpp:119
std::optional< std::vector< std::string > > keywords
Terms to search over (keywords).
Definition NWBFile.hpp:89
GeneralMetadataSpec & withNotes(std::string value)
Set the notes field.
Definition NWBFile.hpp:192
GeneralMetadataSpec & withWasGeneratedBy(std::vector< std::pair< std::string, std::string > > value)
Set the wasGeneratedBy field.
Definition NWBFile.hpp:324
GeneralMetadataSpec & withVirus(std::string value)
Set the virus field.
Definition NWBFile.hpp:311
std::optional< std::string > sourceScriptFileName
Name of the script file (file_name attribute of source_script). Required if sourceScript is set.
Definition NWBFile.hpp:113