-
Notifications
You must be signed in to change notification settings - Fork 2
05. layer fMRI analysis
This is different from MPRAGE images. MP2RAGE generates three sets of images, which are two sets of images at two different TI with one TI specified with nulled gray matter signal and one set of images as the ratio between the two. The ratio images have much better gray/white matter contrast. It is that set of images (ratio images) to be used for FreeSurfer reconstruction.
The images below are three sets of images from one subject at 7T using MP2RAGE. The one in the middle should be used for FreeSurfer reconstruction.
Run the following commands to get 9 intermediate equi-spaced surfaces between gray/white matter boundary (?h.white) and gray matter/pial surface boundary (?h.pial).
mris_expand -thickness lh.white 0.1 lh.gray01
mris_expand -thickness lh.white 0.2 lh.gray02
mris_expand -thickness lh.white 0.3 lh.gray03
mris_expand -thickness lh.white 0.4 lh.gray04
mris_expand -thickness lh.white 0.5 lh.gray05
mris_expand -thickness lh.white 0.6 lh.gray06
mris_expand -thickness lh.white 0.7 lh.gray07
mris_expand -thickness lh.white 0.8 lh.gray08
mris_expand -thickness lh.white 0.9 lh.gray09
mris_expand -thickness rh.white 0.1 rh.gray01
mris_expand -thickness rh.white 0.2 rh.gray02
mris_expand -thickness rh.white 0.3 rh.gray03
mris_expand -thickness rh.white 0.4 rh.gray04
mris_expand -thickness rh.white 0.5 rh.gray05
mris_expand -thickness rh.white 0.6 rh.gray06
mris_expand -thickness rh.white 0.7 rh.gray07
mris_expand -thickness rh.white 0.8 rh.gray08
mris_expand -thickness rh.white 0.9 rh.gray09
Use the following codes to correct distortion by topup
in FSL. These include the steps to prepare data acquired with "blipped-up" and "blipped-down" phase encoding steps. Merge these data as one single file. Estimate the distortion map. Then, apply distortion map to the original EPI data to restore the right shape.
fslroi bold/010/fmcprstc.nii.gz bold/010/PA_b0 0 1
fslroi bold/008/fmcprstc.nii.gz bold/008/AP_b0 0 1
fslroi bold/012/fmcprstc.nii.gz bold/012/AP_b0 0 1
fslroi bold/014/fmcprstc.nii.gz bold/014/AP_b0 0 1
fslroi bold/016/fmcprstc.nii.gz bold/016/AP_b0 0 1
fslroi bold/018/fmcprstc.nii.gz bold/018/AP_b0 0 1
fslroi bold/022/fmcprstc.nii.gz bold/022/AP_b0 0 1
fslmerge -t bold/008/AP_PA_fmcprstc.nii.gz bold/008/AP_b0.nii.gz bold/010/PA_b0.nii.gz
fslmerge -t bold/012/AP_PA_fmcprstc.nii.gz bold/012/AP_b0.nii.gz bold/010/PA_b0.nii.gz
fslmerge -t bold/014/AP_PA_fmcprstc.nii.gz bold/014/AP_b0.nii.gz bold/010/PA_b0.nii.gz
fslmerge -t bold/016/AP_PA_fmcprstc.nii.gz bold/016/AP_b0.nii.gz bold/010/PA_b0.nii.gz
fslmerge -t bold/018/AP_PA_fmcprstc.nii.gz bold/018/AP_b0.nii.gz bold/010/PA_b0.nii.gz
fslmerge -t bold/022/AP_PA_fmcprstc.nii.gz bold/022/AP_b0.nii.gz bold/010/PA_b0.nii.gz
topup --imain=bold/008/AP_PA_fmcprstc.nii.gz --datain=acqp.txt --subsamp=1 --config=b02b0.cnf --out=bold/008/AP_PA_fmcprstc_topup --fout=bold/008/AP_PA_fmcprstc_topup_field --iout=bold/008/AP_PA_fmcprst_upwarp_b0 -v
topup --imain=bold/012/AP_PA_fmcprstc.nii.gz --datain=acqp.txt --subsamp=1 --config=b02b0.cnf --out=bold/012/AP_PA_fmcprstc_topup --fout=bold/012/AP_PA_fmcprstc_topup_field --iout=bold/012/AP_PA_fmcprst_upwarp_b0 -v
topup --imain=bold/014/AP_PA_fmcprstc.nii.gz --datain=acqp.txt --subsamp=1 --config=b02b0.cnf --out=bold/014/AP_PA_fmcprstc_topup --fout=bold/014/AP_PA_fmcprstc_topup_field --iout=bold/014/AP_PA_fmcprst_upwarp_b0 -v
topup --imain=bold/016/AP_PA_fmcprstc.nii.gz --datain=acqp.txt --subsamp=1 --config=b02b0.cnf --out=bold/016/AP_PA_fmcprstc_topup --fout=bold/016/AP_PA_fmcprstc_topup_field --iout=bold/016/AP_PA_fmcprst_upwarp_b0 -v
topup --imain=bold/018/AP_PA_fmcprstc.nii.gz --datain=acqp.txt --subsamp=1 --config=b02b0.cnf --out=bold/018/AP_PA_fmcprstc_topup --fout=bold/018/AP_PA_fmcprstc_topup_field --iout=bold/018/AP_PA_fmcprst_upwarp_b0 -v
topup --imain=bold/022/AP_PA_fmcprstc.nii.gz --datain=acqp.txt --subsamp=1 --config=b02b0.cnf --out=bold/022/AP_PA_fmcprstc_topup --fout=bold/022/AP_PA_fmcprstc_topup_field --iout=bold/022/AP_PA_fmcprst_upwarp_b0 -v
applytopup --imain=bold/008/fmcprstc.nii.gz --inindex=1 -a acqp.txt --topup=bold/008/AP_PA_fmcprstc_topup --out=bold/008/fmcprstc_topup.nii.gz --method=jac
applytopup --imain=bold/012/fmcprstc.nii.gz --inindex=1 -a acqp.txt --topup=bold/012/AP_PA_fmcprstc_topup --out=bold/012/fmcprstc_topup.nii.gz --method=jac
applytopup --imain=bold/014/fmcprstc.nii.gz --inindex=1 -a acqp.txt --topup=bold/014/AP_PA_fmcprstc_topup --out=bold/014/fmcprstc_topup.nii.gz --method=jac
applytopup --imain=bold/016/fmcprstc.nii.gz --inindex=1 -a acqp.txt --topup=bold/016/AP_PA_fmcprstc_topup --out=bold/016/fmcprstc_topup.nii.gz --method=jac
applytopup --imain=bold/018/fmcprstc.nii.gz --inindex=1 -a acqp.txt --topup=bold/018/AP_PA_fmcprstc_topup --out=bold/018/fmcprstc_topup.nii.gz --method=jac
applytopup --imain=bold/022/fmcprstc.nii.gz --inindex=1 -a acqp.txt --topup=bold/022/AP_PA_fmcprstc_topup --out=bold/022/fmcprstc_topup.nii.gz --method=jac
This [script] simplfies all the commands above into a Matlab script.
Here the example script uses fMRI volume "ruras039_MURun1.nii" and registers it to the brain surface of subject "s039".
bbregister --frame 1 --s s025 --mov rura180722_PtTseng_MURun1.nii --rh-only --init-reg bb_register_init.dat --reg bb_register_01.dat --bold
NOTE EPI data should be pre-processed (off-resonance corrected; motion-corrected; slice-timing corrected; spatially smoothed).
The initialized registration is the key! Here we use "bb_register_ini.dat", which is like this:
s025
1.000000
1.000000
0.150000
0 1 0 0
1 0 0 0
0 0 -1 0
0 0 0 1
round
This data has 1.5 mm slice thickness. Change this number accordingly based on your acquisition.
This initial registration is strongly recommended to be updated by using the following script with tkregister2 or FreeView
tkregister2 --mov rura180722_PtTseng_MURun1_frame001.nii --reg bb_register_init.dat --surf
tkregisterfv --mov rura180722_PtTseng_MURun1_frame001.nii --reg bb_register_init.dat --surfs
Sometimes the automatic registration may be off. In such cases, we need to manually adjust the initial registration matrix. [This script file] first reads a pre-defined 12-parameter registration matrix. Then, registration can be adjusted and exported. This procedure may be repeated a few rounds to make it right.
dti_reg=etc_read_xfm('file_xfm','bb_register_init.dat'); %read the pre-defined registration matrix
dtim=MRIvol2vol(dti,targ,dti_reg); %transform the image to match the structural MRI volume
%%%%% if needed, use the registration toool ('k' in etc_render_fsbrain) to
%%%%% register manually and expert the registration matrix as
%%%%% `overlay_xfm`. Then use the product dti_reg*overlay_xfm as the
%%%%% transformation
% dtim=MRIvol2vol(dti,targ,dti_reg*overlay_xfm);
%load the Talairach transformation matrix from the "pre-OP" data
talxfm=etc_read_xfm('file_xfm','/Users/fhlin_admin/workspace/7t_music_skku/subjects/SUB4A/mri/transforms/talairach.xfm'); %for MAC/Linux
%show images
etc_render_fsbrain('surf','orig','hemi','rh','subject',subject,'vol',targ,'overlay_vol',dtim,'overlay_threshold',[100 500]);
Read the content of dti_reg*overlay_xfm
in Matlab and update the inital registration matrix accordingly. Then go back to ### 2.1 for registration
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf white --out TonotopicMap-rh-white.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray01 --out TonotopicMap-rh-gray01.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray02 --out TonotopicMap-rh-gray02.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray03 --out TonotopicMap-rh-gray03.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray04 --out TonotopicMap-rh-gray04.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray05 --out TonotopicMap-rh-gray05.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray06 --out TonotopicMap-rh-gray06.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray07 --out TonotopicMap-rh-gray07.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray08 --out TonotopicMap-rh-gray08.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf gray09 --out TonotopicMap-rh-gray09.w --out_type paint
mri_vol2surf --src TonotopicMap.nii --srcreg register.dat --hemi rh --surf pial --out TonotopicMap-rh-pial.w --out_type paint
In General Linear Modeling (GLM), we included covariates of no interests to better separate the variance. [get_mc_regressor.m] reads the six time series decribing the head motion estimate. These six time series can be included as regressors as confounds in the GLM. [get_ventricle_wm_regressor.m] reads the time series in the ventricle and white matter. These time series can be included as regressors as confounds in the GLM.