Skip to content

Commit

Permalink
update connectivity
Browse files Browse the repository at this point in the history
  • Loading branch information
torwager committed Jun 16, 2023
1 parent 1c870f4 commit ab264f9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Binary file modified canlab_mixed_effects_matlab_demo1/canlab_mixed_model_example.mlx
Binary file not shown.
32 changes: 32 additions & 0 deletions unfinished_examples/extract_and_prep_for_connectomics.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
% Extract data from each region in a standardized atlas, averaging over voxels in the region

% Method 1
% pass fmri_data object img into canlab_connectivity_preproc, using the 'extract_roi' keyword and passing in the atlas
img = load_image_set('emotionreg'); % a sample fmri_data object; insert your single-subject 4-D time series object here

% Replace img with your single-subject 4-D time series object here, which
% would usually be image data corresponding to one run. You'd save the
% output for each run, and concatenate across runs along with a metadata
% table describing the task conditions and sessions.

my_atlas = load_atlas('canlab2018_2mm');
[img_preprocessed, region_average_data] = canlab_connectivity_preproc(img, 'extract_roi', my_atlas, 'unique_mask_values');

% NOTE: Customize additional inputs to canlab_connectivity_preproc by
% passing in nuisance regressors (outlier 'spikes', movement-related
% regressors)

% Method 2
b = brainpathway;
img = load_image_set('emotionreg'); % a sample fmri_data object; insert your single-subject 4-D time series object here
img = resample_space(img, b.region_atlas); % resample the image to the voxel space/dims of atlas stored in b
b.voxel_dat = img.dat;

region_average_data = b.region_dat; % images x brain regions
region_labels = b.region_atlas.labels; % labels (names) for the brain regions

% next: Run canlab_connectivity_preproc, bandpass filtering and nuisance
% regression
% Create an image object storing the region averages
% Pass the image object into canlab_connectivity_preproc

0 comments on commit ab264f9

Please sign in to comment.