Repository navigation
Description
Context
This issue is related to open-ephys-plugins/nwb-format#7 and open-ephys-plugins/nwb-format#6 and is motivated by the need to specify additional metadata (e.g., Subject metadata) in order to ensure compliance of the NWB files generated by the plugin with the DANDI archive.
Summary
Record engines can declare options through their RecordEngineManager (e.g. Binary's "Record TTL full words", or NWB's "Identifier Text"). In v1.1.0 these options have no effect:
-
Never applied.
RecordEngine::configureEngine()returns immediately unless the engine has a manager:void RecordEngine::configureEngine() { if (! manager) return; for (int i = 0; i < manager->getNumParameters(); ++i) setParameter (manager->getParameter (i)); }
The only call to
registerManageris inControlPanel::setSelectedRecordEngine(ControlPanel.cpp:1268-1278), on a temporary engine that is deleted at the end of the function. The engines that actually record are created byRecordNode::setEngine(RecordNode.cpp:468-495) throughRecordEngineManager::instantiateEngine(), and never get a manager. SoconfigureEngine(), called when acquisition starts (RecordNode.cpp:770), does nothing, andsetParameteris never called. -
No UI, and not saved. No editor exposes the parameters.
RecordEngineManager::saveParametersToXmlis never called.ControlPanel::loadStateFromXmldoes read<RECORDENGINES><ENGINE id=...><PARAMETER .../>into the Control Panel's managers (ControlPanel.cpp:1423-1432), but because of 1. the values never reach the recording engine.
Reproduction: we added
<RECORDENGINES><ENGINE id="NWB2"><PARAMETER id="0" type="string" value="xml-identifier-test"/></ENGINE></RECORDENGINES>to a settings file and recorded with the NWB format. The file's /identifier was the default random UUID, not xml-identifier-test. For the same reason, Binary's "Record TTL full words" option always keeps its default value.
Suggested fix
- In
RecordNode::setEngine, register the manager with the new engine:recordEngine->registerManager (engine);. The managers are currently created per call bygetAvailableRecordEngines(), so the Record Node (or the Control Panel) would need to own them for the lifetime of the engine. - Decide where the parameters are configured. Since v0.6 the engine is selected per Record Node, so per-node parameters (e.g. Record Node processor parameters generated from the engine's
EngineParameters, saved with the Record Node's settings and settable via the HTTP API) seem more natural than the global Control Panel.
This would also give record engines a place for per-session metadata. For example, the NWB format needs subject and session metadata (subject ID, species, sex, age, experimenter, institution) for files to be DANDI-ready.
AI disclaimer: I worked with Claude on the code changes and this issue.
Activity
anjaldoshi commentedon Nov 6, 2026
Hi @oruebel,
Thanks for flagging this and digging into the cause. I’ve pushed a fix to
developmentin 3c513e8. Engine options are now regular Record Node parameters, with a gear button next to the recording-format selector and access through the HTTP API.To clarify how the XML works, the options are saved as attributes in the Record Node’s
<PROCESSOR_PARAMETERS>element. For your identifier test, that would look like:The parameter keys follow this pattern:
These use the manager’s engine ID and the numeric ID declared in the
EngineParameter, not the display label or the parameter’s position in the list. So:engine_BINARY_0is Binary’s “Record TTL full words” option;"1"means enabled.engine_NWB2_0is NWB2’s “Identifier Text” option. In the attached configuration, its saved value is currently empty.Each Record Node registers typed parameters from the available engines’ declarations. That’s why both Binary and NWB2 options appear in the same saved node, although only the selected engine’s options are applied. The separate
engine="1"attribute is the recording-format selection index.For accessing through the HTTP API, using the Record Node’s ID, e.g.
101:Set these values while acquisition is stopped. Before recording files are opened,
configureEngine()reads the selected engine’s values from that Record Node and passes them to the engine’ssetParameter()implementation.This should also provide a way to configure the additional metadata you mentioned, once those fields are exposed and written by the NWB plugin.
The old global
<RECORDENGINES>block is no longer loaded. Configuring the options through the new UI and saving settings will generate the correct per-node XML. Could you retest the identifier example on the latestdevelopmentusing this path?oruebel commentedon Nov 10, 2026
Thanks, this works. On
development(e6008f0), I setengine_NWB2_0throughPUT /api/processors/101/parameters/engine_NWB2_0and recorded:/identifieris the value that was set;PUT /api/savewritesengine_NWB2_0="xml-identifier-test"to the Record Node's<PROCESSOR_PARAMETERS>;Based on this, NeurodataWithoutBorders/nwb-format#2 adds the session and subject metadata of open-ephys-plugins/nwb-format#7 as NWB2 options:
When a new NWB file is created, the plugin reads the metadata JSON file, if there is one, and then replaces its values with the options that aren't empty (so the values the user sets in the GUI take precedence). I tested the options through the HTTP API with and without a metadata file. From my side, this issue can be closed.