snake.core.handlers.activations.activations#

Activation Handler.

Module Contents#

Classes#

ActivationMixin

Add activation inside the region of interest. for a single type of event.

BlockActivationHandler

Activation Handler with block design.

API#

class snake.core.handlers.activations.activations.ActivationMixin[source]#

Bases: snake._meta.LogMixin

Add activation inside the region of interest. for a single type of event.

Parameters:
  • event_condition – array-like of shape (3, n_events) yields description of events for this condition as a (onsets, durations, amplitudes) triplet

  • hrf_model – Choice for the HRF, FIR is not

  • oversampling – Oversampling factor to perform the convolution. Default=50.

  • min_onset – Minimal onset relative to frame_times[0] (in seconds) events that start before frame_times[0] + min_onset are not considered. Default=-24.

  • base_tissue_name – Name of the tissue to intersect with the ROI.

  • atlas (str, default=None) – Name of the atlas to use for the ROI.

  • atlas_label (int | str, default=-1) – Label of the ROI in the atlas.

Notes

If no atlases is provided, the ROI is computed by intersecting the base tissue with an ellipsoid in the occipital region. If a probabilistic atlas is provided, the effective BOLD signal will be the product of the voxel base_tissue_name (e.g. gray-matter) and of the atlas mask.

See also

nilearn.compute_regressors

event_condition: pandas.DataFrame | numpy.ndarray = None#
duration: float = None#
offset: float = 0#
event_name: str = None#
roi_tissue_name: str = 'ROI'#
delta_r2s: float = 1000.0#
hrf_model: str = 'glover'#
oversampling: int = 10#
min_onset: float = None#
base_tissue_name: str = 'gm'#
atlas: str | None = 'hardvard-oxford__cort-maxprob-thr50-1mm'#
atlas_label: int | str = <Multiline-String>#
get_static(phantom: snake.core.phantom.Phantom, sim_config: snake.core.simulation.SimConfig) snake.core.phantom.Phantom[source]#

Get the static ROI.

_get_roi_base(phantom: snake.core.phantom.Phantom) numpy.typing.NDArray[source]#
_get_roi_atlas(phantom: snake.core.phantom.Phantom) numpy.typing.NDArray[source]#

Get the ROI from the atlas.

Currently, only the Harvard-Oxford atlas is supported.

get_dynamic(phantom: snake.core.phantom.Phantom, sim_conf: snake.core.simulation.SimConfig) snake.core.phantom.DynamicData[source]#

Get dynamic time series for adding Activations.

static apply_weights(phantom: snake.core.phantom.Phantom, data: numpy.typing.NDArray, time_idx: int) snake.core.phantom.Phantom[source]#

Apply weights to the ROI.

class snake.core.handlers.activations.activations.BlockActivationHandler[source]#

Bases: snake.core.handlers.activations.activations.ActivationMixin, snake.core.handlers.base.AbstractHandler

Activation Handler with block design.

Parameters:
  • block_on (float) – time the block activation is on.

  • block_off (float) – time the block activation is off

  • duration (float) – Total duration of the pattern in seconds

  • offset (float, default 0) – Start time of the pattern in seconds

  • roi_tissue_name (str, default "ROI") – Name of the ROI tissue

  • event_name (str, default "block_on") – Name of the event

  • delta_r2s (float, default 1000.0) – Delta R2s value

  • hrf_model (str, default "glover") – HRF model

  • oversampling (int, default 50) – Oversampling factor

  • min_onset (float, default -24.0) – Minimal onset

  • roi_threshold (float, default 0.0) – ROI threshold

Notes

See Also the GLM module of Nilearn.

__handler_name__ = 'activation-block'#
block_on: float = None#
block_off: float = None#
duration: float = None#
offset: float = 0#
roi_tissue_name: str = 'ROI'#
event_name: str = 'block_on'#
delta_r2s: float = 1000.0#
hrf_model: str = 'glover'#
oversampling: int = 50#
min_onset: float = None#
roi_threshold: float = 0.0#
base_tissue_name: str = 'gm'#
atlas: str | None = 'hardvard-oxford__cort-maxprob-thr50-1mm'#
atlas_label: int | str = <Multiline-String>#
__post_init__()[source]#