8000 redo subsample · nipype/pydra-tutorial@3802670 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3802670

Browse files
committed
redo subsample
1 parent e4a9a54 commit 3802670

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

notebooks/7_twolevel_glm_nilearn.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,14 @@ def set_contrast(subj_id, run_id, dm_path):
236236
)
237237
def firstlevel_estimation(subj_id, run_id, subj_imgs, subj_masks, smoothing_fwhm, dm_path, contrasts):
238238
print(f"\nStart firstlevel estimation for subject-{subj_id}, run-{run_id} ...\n")
239-
print('Fit the firstlevel model...')
240-
# fit the (fixed-effects) firstlevel model with three runs simultaneously< 78C0 /span>
239+
240+
# subsample img to reduce memory
241241
run_img = subj_imgs[run_id-1]
242242
img = load_img(run_img)
243-
img_data = get_data(run_img)[::3,::3,::3]
243+
img_data = get_data(run_img)[::2,::2,::2]
244244
new_img = nib.Nifti1Image(img_data, img.affine)
245245
run_mask = subj_masks[run_id-1]
246+
print('Fit the firstlevel model...')
246247
first_level_model = FirstLevelModel(mask_img=run_mask, smoothing_fwhm=smoothing_fwhm)
247248
dm= pd.read_csv(dm_path)
248249
first_level_model = first_level_model.fit(new_img, design_matrices=dm)

0 commit comments

Comments
 (0)
0