neuralset.events.etypes.Fmri¶
- pydantic model neuralset.events.etypes.Fmri[source][source]¶
Functional MRI (fMRI) recording event.
Handles both volumetric NIfTI files and FreeSurfer surface data (left + right hemisphere). For surface data,
filepathmust be the left hemisphere (containinghemi-L); the right hemisphere is derived automatically by replacinghemi-Lwithhemi-R.Supports chunking via
_split()inherited fromBaseSplittableEvent;read()crops to[offset, offset+duration]so chunks load only their own slice.- 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).
- Fields:
- field subject: Annotated[str, BeforeValidator(func=_int_cast, json_schema_input_type=PydanticUndefined)] [Required][source]¶
- field spec: Annotated[str, BeforeValidator(func=_coerce_spec, json_schema_input_type=PydanticUndefined)] | None = None[source]¶
- read() Any[source][source]¶
Read and return the data from the file or method URI.
- Returns:
The loaded data (type depends on the specific Event subclass)
- Return type:
Any
Examples
audio_event = Audio(start=0, timeline="t1", filepath="audio.wav") audio_tensor = audio_event.read() # Returns torch.Tensor