t2sv.nii Limited estimated T2* 3D map.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pandas as pd | |
| import nibabel as nib | |
| from pathlib import Path, PurePath | |
| from nilearn import image | |
| from numpy.lib import recfunctions | |
| from nilearn.input_data import NiftiMasker | |
| from nistats.first_level_model import FirstLevelModel | |
| """ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import re | |
| import requests | |
| repo = '5hju4' # my example repository, update as appropriate | |
| query = '?filter[name][contains]=confounds_regressors.tsv' # my example query, update or leave blank as appropriate | |
| url = 'https://api.osf.io/v2/nodes/{0}/files/osfstorage/{1}'.format(repo, query) | |
| guids = [] | |
| while True: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Functions to identify TE-dependent and TE-independent components. | |
| """ | |
| import json | |
| import logging | |
| import pickle | |
| from nilearn._utils import check_niimg | |
| import numpy as np | |
| from scipy import stats |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| from itertools import groupby | |
| multi_echo_ses = {'data': ['sub-01_ses-01_task-view_run-01_echo-1_bold.nii.gz', | |
| 'sub-01_ses-01_task-view_run-01_echo-2_bold.nii.gz', | |
| 'sub-01_ses-01_task-view_run-01_echo-3_bold.nii.gz', | |
| 'sub-01_ses-01_task-view_run-02_echo-1_bold.nii.gz', | |
| 'sub-01_ses-01_task-view_run-02_echo-2_bold.nii.gz', | |
| 'sub-01_ses-01_task-view_run-02_echo-3_bold.nii.gz', | |
| 'sub-01_ses-01_task-rest_run-01_bold.nii.gz', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_last_echo_mask(echo_list): | |
| """ | |
| Make a map of longest echo that a voxel can be sampled with, | |
| with minimum value of map as X value of voxel that has median | |
| value in the 1st echo. N.B. larger factor leads to bias to lower TEs | |
| **Inputs** | |
| echo_list | |
| List of file names for all echos of interest |