pnpl.preprocessing.epochs_to_h5

Contents

pnpl.preprocessing.epochs_to_h5#

pnpl.preprocessing.epochs_to_h5(epochs, output_path, dtype=<class 'numpy.float32'>, compression=None, compression_opts=4)[source]#

Convert MNE Epochs to H5 format.

Creates an H5 file with structure: - data: (trials, channels, time) - Epoched MEG data - labels: (trials,) - Event labels - times: (time,) - Time vector - channel_names: (channels,) - Channel names - channel_types: (channels,) - Channel types - sensor_xyz: (channels, 3) - Sensor positions

Parameters:
  • epochs (mne.Epochs) – MNE Epochs object

  • output_path (str) – Output H5 file path

  • dtype (dtype) – Data type for storage (default: float32)

  • compression (str | None) – Compression algorithm (‘gzip’ or None)

  • compression_opts (int) – Compression level (1-9)

Returns:

Path to created H5 file

Return type:

str