← back to fmri_data methods ·
Object methods index ·
Recasting objects
Project a set of group-level spatial maps (e.g., group ICA components) onto a single subject's 4-D data to recover (a) per-component time courses and (b) subject-specific spatial maps. The first regression is spatial (maps against each volume) and the second is temporal (recovered time courses against each voxel) — the standard FSL dual-regression workflow.
[spatial_maps, timecourses, tmaps] = dual_regression(group_map_obj, data_obj, varargin)The method is dispatched on group_map_obj: the receiver carries the
group-level component maps and data_obj is the subject's 4-D image series.
data_obj is resampled into the space of group_map_obj before the
regressions are performed; the heavy lifting is delegated to
dual_regression_fsl.
| Argument | Type | Description |
|---|---|---|
group_map_obj |
fmri_data |
Group-level spatial maps, one image per component (e.g., from group ICA). |
data_obj |
fmri_data |
Subject's 4-D BOLD time series. Resampled to the space of group_map_obj. |
varargin |
misc. | Forwarded to dual_regression_fsl. |
| Output | Type | Description |
|---|---|---|
spatial_maps |
fmri_data |
Subject-specific spatial maps, one image per component. |
timecourses |
matrix | [components × timepoints] recovered time courses. |
tmaps |
fmri_data |
Z-scored version of spatial_maps (effect-size maps). |
- Resampling happens with
resample_space(data_obj, group_map_obj)— the subject data are aligned to the group-map grid, not the other way around. - All real work is performed by
dual_regression_fsl; this method exists to provide the standard CANlab object-method dispatch and to handle space alignment automatically. - Pair this with
load_image_set('npsplus'), ICA component sets, or any other reference map collection of interest.
% Use a few CANlab signature maps as stand-in components
group_map_obj = load_image_set('npsplus');
group_map_obj = get_wh_image(group_map_obj, 2:7);
disp(group_map_obj.image_names)
% Single-subject 4-D BOLD data
data_obj = fmri_data(which('swrsub-sid001567_task-pinel_acq-s1p2_run-03_bold.nii.gz'));
% Dual regression
[spatial_maps, timecourses, tmaps] = dual_regression(group_map_obj, data_obj);
% Inspect the recovered time courses
plot(timecourses');
xlabel('Volume'); ylabel('Component score');fmri_data.ica— group ICA that can produce the input mapsfmri_data.predict— cross-validated multivariate predictionfmri_data.regress— voxelwise multiple regressionapply_parcellation— alternative when components are categoricalresample_space— alignment used internally
