Skip to content

Record engine parameters (EngineParameter) are never applied to the Record Node's engine #710

Open

Description

@oruebel

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:

  1. 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 registerManager is in ControlPanel::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 by RecordNode::setEngine (RecordNode.cpp:468-495) through RecordEngineManager::instantiateEngine(), and never get a manager. So configureEngine(), called when acquisition starts (RecordNode.cpp:770), does nothing, and setParameter is never called.

  2. No UI, and not saved. No editor exposes the parameters. RecordEngineManager::saveParametersToXml is never called. ControlPanel::loadStateFromXml does 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 by getAvailableRecordEngines(), 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

  1. anjaldoshi commented on Nov 6, 2026

    @anjaldoshi
    Member

    Hi @oruebel,

    Thanks for flagging this and digging into the cause. I’ve pushed a fix to development in 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:

    <PROCESSOR_PARAMETERS directory="None" engine="1"
                          engine_BINARY_0="1"
                          engine_NWB2_0="xml-identifier-test"
                          events="1" spikes="1" main_sync="0"/>

    The parameter keys follow this pattern:

    engine_<engine ID>_<parameter ID>
    

    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_0 is Binary’s “Record TTL full words” option; "1" means enabled.
    • engine_NWB2_0 is 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:

    GET /api/processors/101/parameters/engine_NWB2_0
    
    PUT /api/processors/101/parameters/engine_NWB2_0

    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’s setParameter() 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 latest development using this path?

  2. oruebel commented on Nov 10, 2026

    @oruebel
    Author

    Thanks, this works. On development (e6008f0), I set engine_NWB2_0 through PUT /api/processors/101/parameters/engine_NWB2_0 and recorded:

    • the NWB file's /identifier is the value that was set;
    • PUT /api/save writes engine_NWB2_0="xml-identifier-test" to the Record Node's <PROCESSOR_PARAMETERS>;
    • after loading the saved settings, the option is restored and applied to the next file.

    Based on this, NeurodataWithoutBorders/nwb-format#2 adds the session and subject metadata of open-ephys-plugins/nwb-format#7 as NWB2 options:

    • IDs 1-13: session description, experimenter(s), institution, lab, and the subject fields (ID, species, sex, age, date of birth, genotype, strain, weight, description);
    • ID 14: the path of a JSON metadata file for optional fields that have no option (e.g., keywords, protocol, surgery). I omitted these in the GUI to avoid creating too much clutter.

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions