allensdk.brain_observatory.behavior.data_objects.stimuli.stimuli module

class allensdk.brain_observatory.behavior.data_objects.stimuli.stimuli.Stimuli(presentations: Presentations, templates: Templates)[source]

Bases: DataObject, StimulusFileReadableInterface, NwbReadableInterface, NwbWritableInterface

classmethod from_nwb(nwbfile: NWBFile, presentation_columns: List[str] | None = None, add_is_change_to_presentations_table=True) Stimuli[source]

Populate a DataObject from a pyNWB file object.

Parameters:
nwbfile:

The file object (NWBFile) of a pynwb dataset file.

Returns:
DataObject:

An instantiated DataObject which has name and value properties

classmethod from_stimulus_file(stimulus_file: BehaviorStimulusFile, stimulus_timestamps: StimulusTimestamps, behavior_session_id: int, trials: Trials, limit_to_images: List | None = None, presentation_columns: List[str] | None = None, presentation_fill_omitted_values: bool = True, project_code: ProjectCode | None = None, load_stimulus_movie: bool = False) Stimuli[source]
Parameters:
stimulus_file: BehaviorStimulusFile

Input stimulus file for the session.

stimulus_timestamps: StimulusTimestamps

Stimulus timestamps for the session.

trials: Trials

Trials object to add trials_id column into the presentations data frame to allow for merging between the two tables.

behavior_session_id

behavior session id in LIMS

limit_to_images: limit to certain images. Used for testing.
presentation_columns: The columns and order of columns

in the final presentations dataframe

presentation_fill_omitted_values: Whether to fill stop_time and

duration for omitted frames

project_codeProjectCode

For released datasets, provide a project code to produce explicitly named stimulus_block column values in the column stimulus_block_name

load_stimulus_moviebool

Whether to load the stimulus movie (e.g natrual_movie_one) as part of loading stimuli. Default False.

Returns:
property presentations: Presentations
property templates: Templates
to_nwb(nwbfile: NWBFile, presentations_stimulus_column_name='stimulus_name') NWBFile[source]
Parameters:
nwbfile
presentations_stimulus_column_name: Name of the column in the

presentations table that denotes the stimulus name

Returns:
NWBFile