allensdk.brain_observatory.ecephys.stimulus_analysis.natural_movies module

class allensdk.brain_observatory.ecephys.stimulus_analysis.natural_movies.NaturalMovies(ecephys_session, trial_duration=None, **kwargs)[source]

Bases: allensdk.brain_observatory.ecephys.stimulus_analysis.stimulus_analysis.StimulusAnalysis

A class for computing single-unit metrics from the natural movies stimulus of an ecephys session NWB file.

To use, pass in a EcephysSession object::
session = EcephysSession.from_nwb_path(‘/path/to/my.nwb’) nm_analysis = NaturalMovies(session)
or, alternatively, pass in the file path::
nm_analysis = Flashes(‘/path/to/my.nwb’)

You can also pass in a unit filter dictionary which will only select units with certain properties. For example to get only those units which are on probe C and found in the VISp area:

nm_analysis = NaturalMovies(session, filter={'location': 'probeC', 'ecephys_structure_acronym': 'VISp'})
To get a table of the individual unit metrics ranked by unit ID::
metrics_table_df = nm_analysis.metrics()

TODO: Need to find a default trial_duration otherwise class will fail

METRICS_COLUMNS
classmethod known_stimulus_keys()[source]

Used for discovering the correct stimulus_name key for a given StimulusAnalysis subclass (when stimulus_key is not explicity set). Should return a list of “stimulus_name” strings.

metrics

Returns a pandas DataFrame of the stimulus response metrics for each unit.

name

Return the stimulus name.

null_condition