Archived FMRI pipeline: Difference between revisions

From Brain Mapping Unit
Jump to navigationJump to search
No edit summary
m (mk556 moved page FMRI to Archived FMRI pipeline without leaving a redirect: outdated)
 
(18 intermediate revisions by one other user not shown)
Line 1: Line 1:
NOTE: THIS PAGE NEEDS FILLING IN!
==About fMRI data and file types==
==About fMRI data and file types==
Raw fMRI data is saved in .dcm (dicom) files. Typically these .dcm files correspond to individual slices, and the resulting 3D image (or a time-series of 3D images) is saved in a .nii (nifti) file. Raw dicom files can be transformed into nifti format using SPM (a MATLAB software package implementing Statistical Parametric Mapping for neuroimaging data) or other software such as MRIcro.
Raw fMRI data is saved in .dcm (dicom) files. Typically these .dcm files correspond to individual slices, and the resulting 3D image (or a time-series of 3D images) is saved in a .nii (nifti) file. Raw dicom files can be transformed into nifti format using SPM (a MATLAB software package implementing Statistical Parametric Mapping for neuroimaging data) or other software such as MRIcro or Freesurfer. (Note that, when handling neuroimaging data, you need to take special care that the orientation of the images is correct.)
 
Note that, when handling neuroimaging data, you need to take special care that the orientation of the images is correct.


==Standard Preprocessing Steps & The Pipeline==
==Standard Preprocessing Steps & The Pipeline==
In what follows, we describe the broad stages of fMRI preprocessing. Note that the pipeline saves the data after each intermediate step in newly created files with relevant prefixes.  
NOTE THAT THIS IS NOT THE MOST UPTO DATE PIPELINE, which is why we don't link to the relevant code here. We have kept this section for reference, and since the main preprocessing steps are standard, the documentation may be a useful guide.
(SECTION TO BE FILLED IN!)
PLEASE SEE SECTION ON MOTION (below) for the new pipeline (which can be downloaded from the secure wiki).
 
==Parcellation==
(SECTION TO BE FILLED IN!)


==Wavelet Decomposition==
The input to the pre-processing pipeline must be provided in nifti (.nii) format (see section above). The following PDF [[http://bcni.psychol.cam.ac.uk/~pv226/fmri_preprocessing.pdf]] describes 6 broad stages of fMRI preprocessing:
(SECTION TO BE FILLED IN!)


A very basic tutorial on wavelets can be found here: [[http://person.hst.aau.dk/enk/ST8/wavelet_tutotial.pdf]]
'''Signal preprocessing'''


For details on the wavelet toolbox in MATLAB, read: [[http://web.mit.edu/1.130/WebDocs/wavelet_ug.pdf]]
1. Preprocessing of anatomical images


==The Motion Problem==
2. Preprocessing of functional images
In short, the 'motion problem' refers to the recent (2012) discovery that even tiny head-motion can lead to severe artifacts in connectvitiy analyses of resting state fMRI data. The issue is clearly described and illustrated in the following papers:


Power JD, others and Petersen [[http://imap.humanconnectome.org/hosted/docs/Power-et-al-NeuroImage.pdf]]
3. Anatomical standardization of functional images
Spurious but systematic correlations in functional connectivity MRI networks arise from subject motion.
NeuroImage 2012.


Satterthwaite, others and Gur [[http://www.sciencedirect.com/science/article/pii/S1053811911014650]]
4. Removal of noise signal
Impact of in-scanner head motion on multiple measures of functional connectivity: Relevance for studies of neurodevelopment in youth.
NeuroImage 2012.


Van Dijk, others and Buckner [[http://www.sciencedirect.com/science/article/pii/S1053811911008214]]
'''Network construction'''
The influence of head motion on intrinsic functional connectivity MRI.
NeuroImage 2012.


===Motion Task-Froce===
5. Construction of nodes: Parcellation
The aim of this group is twofold:


1) We aim to produce a simple diagnostic kit that can be run on pre-existing resting state fMRI data to assess the magnitude of the problem (ie. quantify the amount of motion as well as the confounding effects it may have).
6. Construction of links


2) We also aim to settle on a single dataset and a set of analyses that will allow the comparison of various denoising methods designed to tackle the problem.
NB: The pipeline ends once the full, weighted adjacency matrix is defined. Network analyses need to be carried out separately.


3) Having settled on the optimal method, we aim to implement it in a user-friendly way.


This page of the wiki will serve as a repository for useful code and data generated along the way. The task-force will also hold regular meetings to keep efforts integrated, the key ideasemerging from these meetings will be logged below.
'''The pipeline uses the following software packages:'''


[[====Meeting 1 - summary & slides====]]
* AFNI (Analysis of Functional NeuroImages - made by the NIH)
[[===Useful Code===]]
===Prantik's %DVARS script===
Here are the scripts dvars.py and dvars_mo.py to generate "Petersen plots:" [[http://bcni.psychol.cam.ac.uk/~pv226/dvars.py]] and [[http://bcni.psychol.cam.ac.uk/~pv226/dvars_mo.py]]
Here are the requirements


-python (you have it if you're on mac or linux, but an upgrade to
* FSL (FMRIB Software Library - made by the FMRIB in Oxford)  
2.7.x from python.org is suggested)


-numpy (a version appropriate for your OS and python version, if you
* WMTSA (Wavelet Methods for Time-Series Analysis - a Matlab or R program for computing frequency-band specific “wavelet” correlations) . A very basic tutorial on wavelets can be found here: [[http://person.hst.aau.dk/enk/ST8/wavelet_tutotial.pdf]]. For details on the wavelet toolbox in MATLAB, read: [[http://web.mit.edu/1.130/WebDocs/wavelet_ug.pdf]].
haven't installed numpy yet)


-NiBabel, at a command prompt, run
Note that it saves the data after each intermediate step in newly created files with relevant prefixes.
 sudo easy_install nibabel


Then run the code as such:


1. RMS Delta Displacement plot:
==The Motion Problem==
 
In short, the 'motion problem' refers to the recent (2012) discovery that even tiny head-motion can lead to severe artifacts in connectvitiy analyses of resting state fMRI data. We have recently set up a 'task-force' to try to better understand and deal with this problem. The task-force holds regular meetings to keep efforts integrated and the key ideas emerging from these meetings will be logged on a parallel (secure) wiki which also contains benchmark data and useful code generated along the way:
python dvars_mo.py <rigid body motion parameter file>
 i.e.     python dvars_mo.py motionXYZ.1D
this will output a file called motionXYZ_dvars.1D
 
2. %DVARS:
 
python dvars.py <NIFTI dataset>
 i.e      python dvars.py foobar.nii.gz
this will output a file called foobar_dvars.1D
 
The input dataset should be at least roughly masked, but otherwise can
be raw or preprocessed data. If data is preprocessed and the mean has
been removed, run like this:
 
python dvars.py <preprocessed NIFTI dataset> <NIFTI dataset with
non-zero means, 3D or 4D>
 
The numbers in the fMRI DVARS are in percent signal change, so they
should be consistent across subjects and vary with the amount of
motion subjects have. FYI, the baseline of DVARS will be higher with
more thermal noise or continuous noise that you have, so for example,
with people with a lot of cerebral pulsation from vasculature, the
baseline DVARS% will be high.


Enjoy, and let me know if something breaks or if you need help.
[https://wiki.cam.ac.uk/bmuwikisecure/Motion_Task-Froce_Meetings_and_Related_Code Secure Wiki]


==Back To Main Page==
==Back To Main Page==
[[Main Page]]
[[Main Page]]

Latest revision as of 10:53, 10 May 2018

About fMRI data and file types

Raw fMRI data is saved in .dcm (dicom) files. Typically these .dcm files correspond to individual slices, and the resulting 3D image (or a time-series of 3D images) is saved in a .nii (nifti) file. Raw dicom files can be transformed into nifti format using SPM (a MATLAB software package implementing Statistical Parametric Mapping for neuroimaging data) or other software such as MRIcro or Freesurfer. (Note that, when handling neuroimaging data, you need to take special care that the orientation of the images is correct.)

Standard Preprocessing Steps & The Pipeline

NOTE THAT THIS IS NOT THE MOST UPTO DATE PIPELINE, which is why we don't link to the relevant code here. We have kept this section for reference, and since the main preprocessing steps are standard, the documentation may be a useful guide. PLEASE SEE SECTION ON MOTION (below) for the new pipeline (which can be downloaded from the secure wiki).

The input to the pre-processing pipeline must be provided in nifti (.nii) format (see section above). The following PDF [[1]] describes 6 broad stages of fMRI preprocessing:

Signal preprocessing

1. Preprocessing of anatomical images

2. Preprocessing of functional images

3. Anatomical standardization of functional images

4. Removal of noise signal

Network construction

5. Construction of nodes: Parcellation

6. Construction of links

NB: The pipeline ends once the full, weighted adjacency matrix is defined. Network analyses need to be carried out separately.


The pipeline uses the following software packages:

  • AFNI (Analysis of Functional NeuroImages - made by the NIH)
  • FSL (FMRIB Software Library - made by the FMRIB in Oxford)
  • WMTSA (Wavelet Methods for Time-Series Analysis - a Matlab or R program for computing frequency-band specific “wavelet” correlations) . A very basic tutorial on wavelets can be found here: [[2]]. For details on the wavelet toolbox in MATLAB, read: [[3]].

Note that it saves the data after each intermediate step in newly created files with relevant prefixes.


The Motion Problem

In short, the 'motion problem' refers to the recent (2012) discovery that even tiny head-motion can lead to severe artifacts in connectvitiy analyses of resting state fMRI data. We have recently set up a 'task-force' to try to better understand and deal with this problem. The task-force holds regular meetings to keep efforts integrated and the key ideas emerging from these meetings will be logged on a parallel (secure) wiki which also contains benchmark data and useful code generated along the way:

Secure Wiki

Back To Main Page

Main Page