Skip to main content

feature_calculators.NwbFeatureCalculator

feature_calculators.NwbFeatureCalculator(
    ap_source=None,
    lf_source=None,
    name=None,
    neuropixel_version=1,
)

Feature calculator for NWB recordings (local, streamed, or DANDI).

Holds one :class:NwbSource per band and opens each lazily through the shared SpikeInterface reader-contract logic. Use the constructor with explicit :class:NwbSource objects, or the :meth:from_local / :meth:from_url / :meth:from_dandi convenience constructors.

Args: ap_source (NwbSource, optional): Source for the AP band. lf_source (NwbSource, optional): Source for the LF band. name (str, optional): Output identifier. Defaults to a source-derived stem. neuropixel_version (int): Neuropixels version passed to destriping.

Raises: ValueError: If neither an AP nor an LF source is provided.

Methods

Name Description
from_dandi Build a calculator that streams NWB assets from a DANDI dataset.
from_local Build a calculator from local NWB file paths.
from_url Build a calculator that streams NWB files from S3/HTTPS URLs.

from_dandi

feature_calculators.NwbFeatureCalculator.from_dandi(
    dandiset_id,
    ap_filepath=None,
    lf_filepath=None,
    version='draft',
    backend='auto',
    ap_electrical_series=None,
    lf_electrical_series=None,
    stream_mode='remfile',
    name=None,
    neuropixel_version=1,
)

Build a calculator that streams NWB assets from a DANDI dataset.

A single NWB file holding both bands is expressed by passing the same filepath for AP and LF with different *_electrical_series selectors.

from_local

feature_calculators.NwbFeatureCalculator.from_local(
    ap_path=None,
    lf_path=None,
    backend='auto',
    ap_electrical_series=None,
    lf_electrical_series=None,
    name=None,
    neuropixel_version=1,
)

Build a calculator from local NWB file paths.

from_url

feature_calculators.NwbFeatureCalculator.from_url(
    ap_url=None,
    lf_url=None,
    backend='auto',
    ap_electrical_series=None,
    lf_electrical_series=None,
    stream_mode='remfile',
    name=None,
    neuropixel_version=1,
)

Build a calculator that streams NWB files from S3/HTTPS URLs.