fMRI Processing steps Conversion from DICOM to NIFTI Organization of folders Visual Inspection Quality control of a Structural and b Functional images Preprocessing Motion correction Realign and ID: 933212
Download Presentation The PPT/PDF document "fMRI Image Analysis SPM" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
fMRI Image Analysis
SPM
Slide2fMRI Processing steps
Conversion from DICOM
to
NIFTI
Organization
of
folders
Visual
Inspection
(Quality control
of a) Structural and b) Functional
images)
Pre-processing
Motion correction – Realign and
Unwarp (U)
Slice time
correction (a)
Segmentation
Get Pathname
Image Calculator
Coregister
and Estimate
Normalization and Write
(w)
Smoothing
Pre-processing flowchart
Slide3Online tutorial Preprocessing in SPM12
https://
www.youtube.com/watch?v=Y4i1FFgWz_g
Slide41. Conversion from DICOM
to NIFTI
SPM12 uses NIFTI file format so you will need to convert your DICOM images into NIFTI format. You can use SPM to conver
t the images or you can use other programs such as MICROGL
https://www.nitrc.org/projects/mricrogl/
Go to folder
mricroGL and double click MRIcroGL application.Go to import convert DICOM to NIFTI.4D files can be used in SPM, FSL and AFNI. However, compressed 4D is most common in FSL (*.nii.gz), although it recognizes the non-compressed 4D file (*.nii) (FSL would then write everything in *.nii.gz). But for SPM, it has to be non-compressed, so make sure you uncheck the box “compress”.Also should check the BIDS format (Brain Imaging Data Structure) while converting.Drag the DICOM folder onto the GUI.
You can look at what the various options of dcm2nii
https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage
Slide52. Organization of folders
Raw_Directory
(you can keep it untouched)
Subj_001
DICOM
Task Log files
Subj_002
DICOM
Task Log files
You can use
the
subject ids with group info as prefix. For
eg.
HC – C000; MDD – D000; or you can use numbers as identifiers.
All HC starts with 1; MDD starts with 2;
rMDD
starts with 3, etc. When you come to pull subjects for groups analyses, it becomes
easier naming
all functional and structural data the same,
eg
. Resting.nii.gz, stroop.nii.gz, T1.nii.gz across all subjects, makes it easier for
batching,
t
hen
you just can loop across subjects.
NIFTI Directory
Subj_001
anat
func
dwi
Log
Subj_002
anat
func
dwi
Log
Pre-
processing
Create new folders for:
1st
level
analy
Slide63. Visual inspection using MRICROGL
It is very important to check your images (quality control) before performing any type of analysis.
MRICROGL is particularly useful when checking for any abnormalities in your
structural images
(T1).
For inspecting
functional images
, fslview allows you to see a video of your functional images, to search for any serious movement. Note: to view the data in mricrogl, change default by clicking on “Display” to Multiplanar, or press Ctrl + M.Select Multiplanar under Display, and then just open
your T1 by going to File open and
navigate through your data until
you reach your structural. Above is an exemple
of a good T1.
Slide7a.
Quality Control
Structural Data
Aim is to check the Quality of the structural data
Check for any weird
abnormalities, such as big
holes, stripes,
etc.Structural MRI hardware related artifactsRF bias (B1 inhomogeneity)Non-uniform RF field causes smooth variations in intensityNeed to compensate in analysis
Slide8a. Quality Control Structural Data
Structural MRI hardware related artifacts
RF interference
RF spikes
Ghosting
Wrap-around
Hardware/settings
Serious but uncommon, easily identifiable
Slide9a. Quality Control Structural Data
Structural MRI
Motion related artifacts
MOTION is
v
ery
hard to
correct, so try to minimize at acquisition.
Slide10b. Quality Control
Functional
Data
Aim is to check the Quality of the functional
data
If you can get
fslview
and play it in video mode, look for jumps, nods and stripesIf looking using mricroGL, open couple of volumes and look for stripes, artefacts, etcCheck if you have the entire brain coverageFew examples are on the next slides
Slide11b. Quality Control Functional Data
Functional MRI artifacts
DISTORTION
Due to Bo inhomogeneity (air in sinuses)
Fieldmap
are used for correcting these
Signal Loss
Nothing we
can do, except selecting good acquisition methods, like 30deg angle, Z-shimming, etc
Phsyiological
NoiseAcquire physiological measurements Remove from your signal by covarying these measuresMOTION isvery hard to correct, so try to minimize at acquisition.
Slide124. Preprocessing in SPM
Preprocessing has
2 major goals: remove uninteresting variability from the data
(motion correction, slice timing, smoothing) and
to prepare the data for the statistical
analysis (Normalizing).
To prepare the data for analysis we should match all scans of an individual subject and match all subjects into a standard space. The overall goal is to increase the
quality of the images.Open SPM/batch. You find pre-defined batches inside the SPM folder, subfolder batches. To used them, open the Batch editor on the SPM for functional MRI box and load/open the SPM folder that contains a subfolder called Batches, then select the Preprocessing fMRI.m file. Then another SPM window opens. You are asked to do slice time correction and then you are asked to choose the number of sessions.
Add image of where to get the SPM batch
Slide134.1 Motion correction
People always move in the
scanner. Even
with padding around the head, there is still
motion.
However, it is important that every voxel corresponds to
the same anatomic point across
scans and subjects.Motion correction realigns all images to a common reference. The reference can be the first (one) image or mean of all images.Small motion (e.g. 1% of voxel size) near strong intensity boundaries may induce a 1% BOLD signal change.Each image is registered individually with the target reference image. Uses rigid body (6 DOF).
Slide144.1 Motion correction – Realign and Unwarp (u)
Realign
is the most basic function to match images. It is used to correct for motion during the functional scans. Uses a ridged body transformation to manipulate the scans, so it only allows translations and rotations in the x, y and z directions that are then incorporated in the
nii
files. Tries to minimize the difference between 2 scans. It can only be used in scans that have been acquired with the same pulse sequence.
Unwarp
should only be used if you believe your scans are warped. Usually realignment takes care of the distortions. When you have movements up and down and also the shape of the volume changes as a function of time, then realignment cannot take care of these changes.
Slide154.1 Motion correction – Realign and Unwarp (u)
Click on Data – New Session
If we have several sessions, we can preprocess them all together, by selecting different
sessions
Click on Images – navigate to the folder where your NIFTI
images are.
C
hoose all the functional files for the session or sessions. Note, on filter you can write faces.* and all the images show up. Select them all.
Slide164.1 Motion correction – Realign and Unwarp (u)
Change default
Num
Passes – from “Register to First” to “Register to Mean
”
Change default Interpolation – from 2nd degree interpolation to 4
th
degree
interpolation
Keep rest as default
Slide174.1 Motion correction – Realign and Unwarp (u)
Effect of Motion Correction
Slide184.1 Motion correction – Realign and Unwarp (u)
Motion Correction Output
Relative = time point to next time point – shows jumps
Absolute = time point to reference – shows jumps & drifts
Note: large jumps are more serious than slower drifts, especially in the relative motion plot
Slide194.1 Motion correction – Realign and Unwarp (u)
Motion Correction Remedies
Motion correction eliminates gross motion changes but assumes rigid-body motion
Other motion artefacts persist including
Spin-history changes, B0 (susceptibility) interactions & interpolation effects
Such artefacts can severely degrade functional results
Worse for stimulus correlated motion
Potential analysis remedies
Including motion parameters as
regressors
in GLM (covariates of no interest)
Removing artefacts with ICA
denoising
Outlier
timepoint
detection and exclusion (via GLM)
Excluding subjects with excessive motion
No simple cut off for “too much” motion
Slide20PengFei
please write about the “Fixing program”
Slide214.2 Slice time correction (a)
Almost all
fmri
scanning takes each scan
separately, so each
slice is acquired at slightly different
times:
Data acquisition / Slice acquisitionData are acquired using pulse sequences using radiofrequency excitation followed by data collection from throughout that slice. To collect data from the entire brain, a typical pulse sequence might acquire 30 slices within a TR of 1.5 to 3.0 s depending on the scanner. Ascending/descending slice acquisition: data is acquired in a consecutive order or sequentially from one end of the imaging volume to the other.Interleaved: data is acquired in an alternating order, so data are acquired first from the odd numbered slices and then from the even numbered slices. This minimized the influence of excitation pulses on adjacent slices. A problem might be that adjacent parts of the brain are acquired at non adjacent time points within the TR. So, if slice 1 was acquired at 0 second, the 2 slice would not be acquired until 1.5 seconds later, so the same BOLD response would seem to occur earlier in the latter slice. That means that the same hemodynamic response will have different time courses within the slices. This is a problem especially in event-related designs. Temporal interpolation: Estimate the amplitude of a signal at a time point that was not originally collected, using data from nearby points. But when we do analysis, we assume that the entire brain volume is imaged at the same time, which is not true.
Slide224.2 Slice time correction (a)
Without any adjustment, the model timing is the same
Slide234.2 Slice time correction (a)
…but the timing of each slice’s data is
different
Slide244.2 Slice time correction (a)
Can get consistency by shifting the
data
Slide254.2 Slice time correction (a)
And then interpolating the data = Slice Timing Correction
Slide264.2 Slice time correction (a)
Slice timing correction changes the data – degraded by the interpolation
Slide274.2 Slice time correction (a)
Alternatively, we can get consistency by shifting the
model
Slide284.2 Slice time correction (a)
Batch
Click Data / New Session
Click on Dependency
Select Realign & Unwarp:
Unwarped
Images (
sess 1)As you want all the images to be slice time corrected and not only the mean image.
Slide294.2 Slice time correction (a)
Batch
All slice information comes from the protocol
TA – acquisition time is calculated = TR – TR/
nslices
Reference slice – usually slice that was collected at middle of the TR, here it is 45, as the slice order here was interleaved
Slice order – 1 3 5 …45 2,4,6….
44Eg to write on the slice order 1:3:45 2:4:44
Slide304.3 Segmentation
Is used to separate the distinct tissues such as grey
matter (GM),
white matter
(WM) and
CSF in anatomical scans. This can also be used for normalization. This step is performed with the anatomical image (T1-weighted).
Slide314.3 Segmentation
Batch
Click Volumes
Navigate to T1 NIFTI folder and select your T1 image
Change default Save bias corrected – from “save nothing” to “save field and corrected”
Change default native tissue – from “native space” to “native +
Dartel
imported”Change default Warped tissue – from “none’ to “modulated + unmodulated”***last two changes are because these files are useful if we plan to do structural analyses later. **change the last defaults for all tissue probability map (1 – 6)
Slide324.3 Segmentation
Batch
Change default Deformation Field - from “None” to “inverse + forward”
This step moves segmented grey matter into the MNI space (ICBM space template – European brains)
Forward deformation – represents the transformation needed to move subject space to MNI space
Inverse deformation – represents the transformation needed to move MNI space to subject space
Slide334.4 Get Pathname
This step is really only to get the pathname of your T1 folder where segmentation outputs are
saved.
Slide344.5 Image calculator
This step put together the WM+GM+CSF images into one and corrects for bias field by multiplying this added image by bias corrected image (output from segmentation step
)
It is just to create a mask corrected for intensity changes, so co-registration with functional images are more accurate. It is not needed for normalization, as deformation filed is already created in segmentation step using T1 (GM)
Slide354.5 Image calculator
Input images – c1 (GM), c2 (WM), c3 (CSF) and bias corrected
All of them are outputs of segmentation steps, so we can
choose using dependency
Output name – T1_bias_brain
Output
Directory: Directories Unique
Expression = (i1 + i2 + i3).* i4 Adding WM, GM, CSF And multiply with bias corrected image Leave all the rest as default.
Slide364.6 Coregister and Estimate
Coregistration
is done to match scans of different modalities (
eg
., T1 and T2) and like realignment it only allows rigid body
transformations.
Estimation
determines the transformation parameters without changing the bitmap. It incorporates them into the nii file. As a reference image you should select the scan to which another scan is going to be compared. As a source image, you should select the scan that is going to be transformed onto the reference scan. In this step we take care of the connection between structural and functional images within the subject.
Slide374.6 Coregister and Estimate
Coregister
mean functional image
(
Unwarped
mean, source image)
to T1_bias_brain (
reference image) Other images, slice timming corr Images session1. Use dependency to choose these images.It moves functional images in the space registration as T1.
Slide384.7 Normalization and write (W)
Functional
During
the normalizing step we connect our functional
data
with the normative data from MNI.
This
step requires smoothing. Importantly, you should consider using a “bounding box” which defines the amount of MNI space that will be incorporated in your new files.StructuralDuring the normalizing step we connect our structural data with the normative data from MNI. This step does not require smoothing.
Slide394.7 Normalization and write (W)
Move functional data and T1_bia_brain into MNI
space (use dependency in these steps).
Need to do in two Normalize – Write
steps (functional on the left, structural on the right
).
4.8 Smoothing
Smoothing is one of the last steps and aims at blurring the functional images to correct for any remaining functional and anatomical differences between subjects.
Nevertheless
the more you smooth the less resolution you get.
If
you are interested in small regions you should not smooth that much.
Smooth data –rule of thumb twice as your voxel size
Slide41Pre-processing flowchart
REALIGN & UNWARP
SLICE TIMING CORRECTION
Preparing Structural Data
SEGMENTATION
GM (C1)
WM (C2)
CSF (C3)
Bias Corrected
Forward + Inverse Deformations
Create Bias corrected T1 mask
Realigned Images
Realigned Mean Image
Combining
func
+
struc
Preparing functional data
CO-REGISTRATION
Source
Reference
Other
Co-registered STC images (not saved)
NORMALIZATION (MNI)
Forward Deformation
Normalized functional Images
SMOOTHING
NORMALIZATION (MNI)
Forward Deformation
Normalized T1_bias_brain Images
1
2
3
4
5
6
7
8