How to get dataset with data structure like in nilearn.dataset.fetch_adhd

Hi! I would like to ask how you got datast structure like in adhd200_sample from nilearn.datasets. That would help me very much to perform some academic tasks on this code:

#Using a filter to extract the regions time series
from nilearn import input_data
masker = input_data.NiftiMapsMasker(components_img, smoothing_fwhm=6,
standardize=False, detrend=True,
t_r=2.5, low_pass=0.1,
high_pass=0.01)

#Computing the regions signals and extracting the phenotypic information of interest
subjects = []
adhds = []
sites = []
labels = []
for func_file, confound_file, phenotypic in zip(
adhd_data.func, adhd_data.confounds, adhd_data.phenotypic):
time_series = masker.fit_transform(func_file, confounds=confound_file)
subjects.append(time_series)
print(adhd_data.confounds)
is_adhd = phenotypic[‘adhd’]
if is_adhd == 1:
adhds.append(time_series)
sites.append(phenotypic[‘site’])
labels.append(phenotypic[‘adhd’])

This code needs the regressors files which I can not find in other fMRI dataset structures like full ADHD-200

‘/home/milan/nilearn_data/adhd/data/0010042/0010042_regressors.csv’,
‘/home/milan/nilearn_data/adhd/data/0010064/0010064_regressors.csv’,
‘/home/milan/nilearn_data/adhd/data/0010128/0010128_regressors.csv’,
‘/home/milan/nilearn_data/adhd/data/0021019/0021019_regressors.csv’,
‘/home/milan/nilearn_data/adhd/data/0023008/0023008_regressors.csv’,

1 Like

Hi @milanziuziakowski

Sorry for the delay !

In case you’re still having trouble here: Some amount of data preprocessing is usually required to generate regressor files. For example, if you look at fMRIPrep processed datasets, you should be able to pull from the generated derivatives folder both _desc-regressors_timeseries.tsv and _desc-preproc_bold.nii.gz files.

In general, you’ll want to make sure that you’re sub-selecting confounds from the generated timeseries.tsv file, since quite a few of these are included by default. One example sub-selection is in the nilearn.datasets.fetch_development_fmri function, but there’s a more general package simexp/load_confounds that might be useful !

HTH,

Elizabeth

1 Like