Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accounting for confounds in timeseries #15

Open
salma1601 opened this issue May 8, 2018 · 12 comments
Open

accounting for confounds in timeseries #15

salma1601 opened this issue May 8, 2018 · 12 comments
Labels
answered The question has been answered question Further information is requested

Comments

@salma1601
Copy link

It is said in the doc that "For each subject, we preliminary extracted signals using different brain parcellations and atlases and accounting for motion correction and confounds." but while going through the script
preprocessing/extract_time_series.py it looks like the saved .csv files are obtained without confounds regression
https://github.com/ramp-kits/autism/blob/master/preprocessing/extract_time_series.py#L233

Am I misunderstanding something ?

@glemaitre
Copy link
Contributor

Thanks to point this out. This is a mistake on the website. We finally did not account for the confounds but instead provided the motions which can be corrected with nilearn.signal.clean.

@glemaitre glemaitre added question Further information is requested answered The question has been answered labels May 8, 2018
@glemaitre
Copy link
Contributor

Actually this is the notebook which is faulty. I am correcting this now.

@salma1601
Copy link
Author

Ok thanks. The thing is that I plotted many correlation matrices and they have relatively high anticorrelations, but from the script it looks as if only detrending has been achieved, so I am a little puzzled. Can you confirm that the images from which the signal is extracted have not undergone any time processing step ?

@pattishih
Copy link

Hey @salma1601, anticorrelations are still present in resting state data, even without confound regression. The question is, how much anticorrelation are you seeing? I wish I can play with the data myself, but I'm currently swamped with other stuff to do. :(

@glemaitre
Copy link
Contributor

@salma1601 The only processing that have been done is spatial smoothing and detrending: here

@salma1601
Copy link
Author

OK thanks. Well I am seeing a lot of anticorrelations and lower correlations than "usual", which means playing with other public/private rsfMRI data before confounds removal. For instance on a subsample of 41 adult controls from only 2 sites for the challenge data this is the distribution of correlation coefficients

while I am used to more skewed distribution like this one (another datasets, control adults, same number of subjects, only detrending and spatial smoothing)

To illustrate, here are the average correlation matrices. The Challenge matrix looks like one with regressed confounds to me. But may be I am wrong, never mind...

@pattishih
Copy link

@salma1601 For your "other" sample of rsfMRI data, how are you obtaining your time series? Using the same cortical parcellation scheme?

@salma1601
Copy link
Author

I used the same function to extract detrended timeseries from the same atlas. Before that, my images have undergone standard spatial preprocessing steps, leading to normalized images in MNI. Note that I use the "other" subsample Just for illustration. I had the opportunity in the past to work on différent rsfMRI datasets and I never experienced such correlation patterns before confounds regression, this is why I am puzzled.

@pattishih
Copy link

@salma1601 yes, I agree that the distribution of correlations in this dataset looks a lot like something you would see after removing the global or white-matter signal. It's definitely puzzling. I did some digging and the detrend method is as expected (removes mean and linear trend).

@jmarichez
Copy link

@glemaitre you mention that you provided the motions which can be corrected with nilearn.signal.clean.
Discovering this API I'm struggling with understanding how to use it with the motions file content and signals.
I guess signals is the array returned by load_fmri, but I can't understand how to format motions content to make it work with the API. Could you please detail how to make usage of the nilearn.signal.clean API in this context?

@glemaitre
Copy link
Contributor

This should be something like:

import numpy as np
import pandas as pd
from nilearn.signal import clean

path_motions_subject = './fmri/motions/subject_id/run_*/motions.txt'
confounds = np.loadtxt(path_motions)

path_fmri = './some_atlas/subject_id/run_*/subject_id_task-Rest_confounds.csv'
timeseries = pd.read_csv(path_fmri, header=None)

cleaned_timeseries = clean(timeseries, confounds=confounds)

@jmarichez
Copy link

Ok thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered The question has been answered question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants