diff --git a/src/nwb/ecephys/ElectricalSeries.cpp b/src/nwb/ecephys/ElectricalSeries.cpp index c60fa4d1..797aa182 100644 --- a/src/nwb/ecephys/ElectricalSeries.cpp +++ b/src/nwb/ecephys/ElectricalSeries.cpp @@ -1,5 +1,7 @@ #include "nwb/ecephys/ElectricalSeries.hpp" +#include "nwb/file/ElectrodeTable.hpp" + using namespace AQNWB::NWB; // ElectricalSeries @@ -66,7 +68,7 @@ void ElectricalSeries::initialize() io->createCommonNWBAttributes( getPath() + "/electrodes", "hdmf-common", "DynamicTableRegion", ""); io->createReferenceAttribute( - electrodesTablePath, getPath() + "/electrodes", "table"); + ElectrodeTable::electrodeTablePath, getPath() + "/electrodes", "table"); } Status ElectricalSeries::writeChannel(SizeType channelInd, diff --git a/src/nwb/ecephys/ElectricalSeries.hpp b/src/nwb/ecephys/ElectricalSeries.hpp index 40482881..597669be 100644 --- a/src/nwb/ecephys/ElectricalSeries.hpp +++ b/src/nwb/ecephys/ElectricalSeries.hpp @@ -74,11 +74,6 @@ class ElectricalSeries : public TimeSeries */ Types::ChannelVector channelVector; - /** - * @brief Path to the electrodes table this time series references - */ - std::string electrodesTablePath = "/general/extracellular_ephys/electrodes/"; - /** * @brief Pointer to channel-specific conversion factor dataset. */ diff --git a/src/nwb/file/ElectrodeTable.cpp b/src/nwb/file/ElectrodeTable.cpp index 2e144e8d..027c9f6a 100644 --- a/src/nwb/file/ElectrodeTable.cpp +++ b/src/nwb/file/ElectrodeTable.cpp @@ -9,11 +9,9 @@ using namespace AQNWB::NWB; /** Constructor */ ElectrodeTable::ElectrodeTable(std::shared_ptr io, const std::string& description) - : DynamicTable( - "/general/extracellular_ephys/electrodes/", // default value for - // electrodes table - io, - description) + : DynamicTable(electrodeTablePath, // use the electrodeTablePath + io, + description) { } diff --git a/src/nwb/file/ElectrodeTable.hpp b/src/nwb/file/ElectrodeTable.hpp index 1e96aa14..b8611a32 100644 --- a/src/nwb/file/ElectrodeTable.hpp +++ b/src/nwb/file/ElectrodeTable.hpp @@ -83,6 +83,12 @@ class ElectrodeTable : public DynamicTable std::unique_ptr locationsDataset = std::make_unique(); /**< The locations dataset. */ + /** + * @brief The path to the ElectrodeTable. + */ + inline const static std::string electrodeTablePath = + "/general/extracellular_ephys/electrodes/"; + private: /** * @brief The channel information from the acquisition system. diff --git a/tests/testFile.cpp b/tests/testFile.cpp index 490a5589..568ba35d 100644 --- a/tests/testFile.cpp +++ b/tests/testFile.cpp @@ -11,7 +11,6 @@ using namespace AQNWB; TEST_CASE("ElectrodeTable", "[ecephys]") { - std::string path = "/general/extracellular_ephys/electrodes/"; SECTION("test initialization") { std::string filename = getTestFilePath("electrodeTable.h5"); @@ -35,7 +34,8 @@ TEST_CASE("ElectrodeTable", "[ecephys]") // Check if id datasets are created correctly SizeType numChannels = 3; - std::unique_ptr id_data = io->getDataSet(path + "id"); + std::unique_ptr id_data = + io->getDataSet(NWB::ElectrodeTable::electrodeTablePath + "id"); std::unique_ptr idDataset( dynamic_cast(id_data.release())); int* buffer = new int[numChannels];