84 std::optional<std::vector<std::string>>
experimenter = 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;
99 std::optional<std::string>
protocol = std::nullopt;
107 std::optional<std::string>
slices = 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>>>
183 lab = std::move(value);
194 notes = std::move(value);
253 slices = std::move(value);
313 virus = std::move(value);
325 std::vector<std::pair<std::string, std::string>> value)
337 static std::shared_ptr<NWBFile>
create(std::shared_ptr<IO::BaseIO> io)
347 explicit NWBFile(std::shared_ptr<IO::BaseIO> io);
352 NWBFile(
const std::string& path, std::shared_ptr<IO::BaseIO> io);
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 =
399 const std::optional<GeneralMetadataSpec>& generalMetadataSpec =
454 std::vector<Types::ChannelVector> recordingArrays,
455 bool finalizeTable =
true,
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,
538 const std::string& name,
539 const std::string& description,
540 const std::string& sourceDescription,
541 const std::vector<NWB::DynamicTable::DataSpecPtr>& columnSpecs);
550 const bool createTagsColumn =
false,
const SizeType rowChunkSize = 100);
559 const bool createTagsColumn =
false,
const SizeType rowChunkSize = 100);
568 const bool createTagsColumn =
false,
const SizeType rowChunkSize = 100);
583 const std::string& name,
584 const std::string& description,
585 const bool createTagsColumn =
false,
605 const std::string& name,
606 const std::string& description,
607 const std::vector<NWB::DynamicTable::DataSpecPtr>& columnSpecs);
626 std::vector<Types::ChannelVector> recordingArrays,
627 std::vector<std::string> recordingNames,
629 std::vector<SizeType>& containerIndexes);
660 std::vector<Types::ChannelVector> recordingArrays,
661 std::vector<std::string> recordingNames,
663 std::vector<SizeType>& containerIndexes,
665 const bool useChannelConversion =
true);
676 std::vector<SizeType>& containerIndexes);
681 "Table of experimental epochs.")
686 "Table of experimental trials.")
690 "intervals/invalid_times",
691 "Table of invalid times.")
696 "table with the extracellular electrodes")
707 A record of the date the file was created and of
708 subsequent modifications)
714 A unique text identifier for the file)
719 "session_description",
720 A description of the experimental session and data in the
726 "session_start_time",
727 Date and time of the experiment or session start)
732 "timestamps_reference_time",
733 Date and time corresponding to time zero of all
739 "general/data_collection",
740 Notes about data collection and analysis)
745 "general/experiment_description",
746 General description of the experiment)
751 "general/experimenter",
752 Name of person(s) who performed the experiment)
757 "general/institution",
758 Institution(s) where experiment was performed)
764 Terms to search over)
770 Laboratory where experiment was performed)
776 Notes about the experiment)
781 "general/pharmacology",
782 Description of drugs used)
788 Experimental protocol)
793 "general/related_publications",
794 Publication information)
799 "general/session_id",
800 Lab-specific ID for the session)
806 Description of slices)
812 "general/source_script",
813 Script file or link to public source code used to
create this
NWB file)
825 Narrative description about surgery / surgeries)
831 Information about virus(es) used in experiments)
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]))
842 "general/source_script/file_name",
889 const std::
string& description,
890 const std::
string& dataCollection,
891 const std::
string& sessionStartTime,
892 const std::
string& timestampsReferenceTime);
933 const std::optional<std::
string>& value);
944 const std::
string& path,
945 const std::optional<std::vector<std::
string>>& values);
970 const std::
string& time,
971 const std::
string& caller);
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 ×tampsReferenceTime)
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 ×tampsReferenceTime)
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