Combined Linenoise and CAR

process_nwb.__init__.preprocess_block(nwb_path, acq_name='ECoG', initial_resample_rate=3200.0, final_resample_rate=400.0, filters='rat', hg_only=True, all_steps=False, logger=None)[source]

This is the default preprocessing pipeline.

Perform the following steps: 1) Resample to initial_resample_rate, 2) Remove 60Hz noise and remove the CAR, and 3) Perform and store a wavelet decomposition. 4) Optionally resample the wavelet amplitudes.

Parameters
  • nwb_path (str or pathlike) – Path to the .nwb file. This file will be modified as a result of this function.

  • acq_name (str) – Name of the acquisition, either ‘ECoG’ or ‘Poly’.

  • initial_resample_rate (float) – Frequency (in Hz) to resample to before performing wavelet transform.

  • final_resample_rate (float) – Frequency (in Hz) to resample to after calculating wavelet amplitudes.

  • filters (str) – Type of filter bank to use for wavelets. Choose from [‘rat’, ‘human’, ‘changlab’].

  • hg_only (bool) – Whether to store high gamma bands only. If False, use all filters.

  • all_steps (bool) – Whether to store intermediate data between preprocessing steps.

  • logger (logger) – Optional logger passed from upstream.

Returns

  • Returns nothing, but changes the NWB file at nwb_path.

  • A ProcessingModule with name ‘preprocessing’ will be added to the NWB.

process_nwb.__init__.store_linenoise_notch_CAR(elec_series, processing, mean_frac=0.95, round_func=<ufunc 'ceil'>, precision='single')[source]

Apply a notch filter at 60 Hz and its harmonics, calculate and remove the common average reference (CAR), and finally store the signal and the CAR.

Parameters
  • elec_series (ElectricalSeries) – ElectricalSeries to process.

  • processing (Processing module) – NWB Processing module to save processed data.

  • mean_frac (float) – Fraction of the data to be taken in the mean. 0. < mean_frac <= 1.

  • round_func (callable) – Function for rounding the fraction of channels.

  • precision (str) – Either single for float32/complex64 or double for float/complex.

Returns

  • X_CAR_ln (ndarray, (n_time, n_channels)) – Data with line noise and CAR removed.

  • elec_series_CAR_ln (ElectricalSeries) – ElectricalSeries that holds X_CAR_ln.