export_simulation_to_nwb#
- export_simulation_to_nwb(
- filepath: str | Path,
- spike_train__Block: Block | None = None,
- surface_emg__Block: Block | None = None,
- surface_muap__Block: Block | None = None,
- intramuscular_emg__Block: Block | None = None,
- intramuscular_muap__Block: Block | None = None,
- session_description: str = 'MyoGen neuromuscular simulation',
- identifier: str | None = None,
- session_start_time: datetime | None = None,
- **kwargs,
Export all simulation data to a single NWB file.
This is a convenience function that combines multiple Neo Blocks (spike trains, EMG, MUAPs) into a single NWB file.
- Parameters:
filepath (str or Path) – Output file path.
spike_train__Block (
SPIKE_TRAIN__Block, optional) – Block containing spike train data.surface_emg__Block (
SURFACE_EMG__Block, optional) – Block containing surface EMG data.surface_muap__Block (
SURFACE_MUAP__Block, optional) – Block containing surface MUAP templates.intramuscular_emg__Block (
INTRAMUSCULAR_EMG__Block, optional) – Block containing intramuscular EMG data.intramuscular_muap__Block (
INTRAMUSCULAR_MUAP__Block, optional) – Block containing intramuscular MUAP templates.session_description (str, default="MyoGen neuromuscular simulation") – Description of the simulation session.
identifier (str, optional) – Unique identifier for this NWB file.
session_start_time (datetime, optional) – Start time of the session.
**kwargs – Additional metadata passed to export_to_nwb.
- Returns:
Path to the created NWB file.
- Return type:
Path
Examples
>>> from myogen.utils.nwb import export_simulation_to_nwb >>> >>> # Export complete simulation >>> export_simulation_to_nwb( ... "full_simulation.nwb", ... spike_train__Block=simulation.get_spike_train__Block(), ... surface_emg__Block=surface_emg.surface_emg__Block, ... session_description="Biceps brachii simulation", ... institution="University", ... )