Skip to content
 
Brain Pipe brain_pipe.preprocessing.brain.link.LinkStimulusToBrainResponse
Type to start searching
    Brain Pipe
    • Brain Pipe
    • API Reference
    • brain_pipe
    • brain_pipe.preprocessing
    • brain_pipe.preprocessing.brain
    • brain_pipe.preprocessing.brain.link
    Brain Pipe
    • Overview
      • Concept
      • Convenient classes
      • Additional considerations
      • Writing your own PipelineStep
      • Small Example
    • Defining and running Pipelines through configuration files
      • Running pipelines from configuration files
      • Background
      • Typical structure for SimpleDictParsers
      • Specifying the parser
    • Command Line Interface
      • API
    • API Reference
      • brain_pipe
    • LinkStimulusToBrainResponse
      • LinkStimulusToBrainResponse
        • __init__()
        • parse_dict_keys()
    • Show Source

    brain_pipe.preprocessing.brain.link.LinkStimulusToBrainResponse¶

    class LinkStimulusToBrainResponse(stimulus_data: ~typing.Sequence[~typing.Dict[str, ~typing.Any]] | ~brain_pipe.pipeline.base.PipelineStep, extract_stimuli_information_fn=<brain_pipe.preprocessing.brain.link.BIDSStimulusInfoExtractor object>, comparison_fn=<brain_pipe.preprocessing.brain.link.BasenameComparisonFn object>, stimulus_path_key='stimulus_path', stimuli_key='stimuli', grouper: ~brain_pipe.utils.path.BIDSStimulusGrouper | None = None, key_fn_for_multiprocessing=<function default_multiprocessing_key_fn>, *args, **kwargs)¶

    Bases: PipelineStep

    Link stimulus to Brain data.

    Attributes

    multiprocessing_condition

    multiprocessing_dict

    __init__(stimulus_data: ~typing.Sequence[~typing.Dict[str, ~typing.Any]] | ~brain_pipe.pipeline.base.PipelineStep, extract_stimuli_information_fn=<brain_pipe.preprocessing.brain.link.BIDSStimulusInfoExtractor object>, comparison_fn=<brain_pipe.preprocessing.brain.link.BasenameComparisonFn object>, stimulus_path_key='stimulus_path', stimuli_key='stimuli', grouper: ~brain_pipe.utils.path.BIDSStimulusGrouper | None = None, key_fn_for_multiprocessing=<function default_multiprocessing_key_fn>, *args, **kwargs)¶

    Create a new LinkStimulusToEEG instance.

    Parameters:
    • stimulus_data_dicts (Sequence[Dict[str, Any]]) – A sequence of data dicts containing the stimulus data.

    • find_stimulus_fn (Callable[[str], Sequence[str]]) – A function that takes the path to the EEG recording and returns a sequence of corresponding stimulus paths.

    • comparison_fn (Callable[[Dict[str, Any], str], bool]) – A function that takes a data dict and a stimulus path and returns True if the data dict corresponds to the stimulus path.

    • stimulus_path_key (str) – The key in the data dict that contains the path to the stimulus.

    • stimuli_key (str) – The key in the data dict that contains the stimulus data.

    • pipeline_cache (Optional[PipelineCache]) – The pipeline cache to use to load the stimulus data dict if necessary. This is only necessary if the stimulus data dicts are cached.

    Methods

    __init__(stimulus_data[, ...])

    Create a new LinkStimulusToEEG instance.

    parse_dict_keys(key[, name, ...])

    Parse a key or a sequence of keys.

    parse_dict_keys(key: str | Sequence[str] | Mapping[str, str], name='key', require_ordered_dict=False) → OrderedDict[str, str]¶

    Parse a key or a sequence of keys.

    Parameters:
    • key (Union[str, Sequence[str], Mapping[str,str]]) – A key or a sequence of keys.

    • name (str) – The name of the key. Used for error messages.

    • require_ordered_dict (bool) – If True, the key must be an OrderedDict. If False, the key can also be an ordinary dict.

    Returns:

    A mapping of input keys to output keys.

    Return type:

    OrderedDict[str, str]

    Raises:

    TypeError – If the key is not a string, a sequence of strings or a mapping of strings. If the key is a mapping but require_ordered_dict is True and the mapping is not an OrderedDict.

    "Previous" brain_pipe.preprocessing.brain.link.BasenameComparisonFn
    "Next" brain_pipe.preprocessing.brain.load
    © Copyright 2023, Bernd Accou, ExpORL.
    Created using Sphinx 7.3.7. and Material for Sphinx