neuralset.events.etypes.Fmri

class neuralset.events.etypes.Fmri(*, start: float, timeline: str, duration: Annotated[float, Ge(ge=0)] = 0.0, extra: dict[str, Any] = {}, filepath: Path | str = '', frequency: float = 0, offset: Annotated[float, Ge(ge=0)] = 0.0, subject: Annotated[str, BeforeValidator(func=_int_cast, json_schema_input_type=PydanticUndefined)], space: str = 'custom', preproc: str = 'custom', mask_filepath: str | None = None, spec: Annotated[str, BeforeValidator(func=_coerce_spec, json_schema_input_type=PydanticUndefined)] | None = None)[source][source]

Functional MRI (fMRI) recording event.

Handles both volumetric NIfTI files and FreeSurfer surface data (left + right hemisphere). For surface data, filepath must be the left hemisphere (containing hemi-L); the right hemisphere is derived automatically by replacing hemi-L with hemi-R.

Parameters:
  • subject (str) – Subject identifier (required).

  • space (str) – Coordinate space, e.g. "MNI152NLin2009cAsym", "T1w", "fsaverage", "custom".

  • preproc (str) – Preprocessing pipeline: "fmriprep", "deepprep", "custom".

  • mask_filepath (str or None) – Path to a brain mask NIfTI file (volumetric only).

  • spec (dict[str, str] or None) – Variant parameters for DataFrame filtering (e.g. {"registration": "msmall", "resolution": "1.6mm"}). Auto-encoded to sorted "key=value&..." strings.

  • frequency (float) – Sampling frequency in Hz (required).

read_mask() Any[source][source]

Read brain mask. Returns None if no mask is available.