User Tools

Site Tools


epi_fieldmap_unwarping

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
epi_fieldmap_unwarping [2012/04/05 14:22]
apersi
epi_fieldmap_unwarping [2016/09/15 18:04] (current)
Line 17: Line 17:
 ===Unwarping at the command line=== ===Unwarping at the command line===
  
-These {{:methods:b0_unwarp_commands.pdf|commands}} can be implented as a bash script, or added into your existing processing scripts+Below is a sample voxbo script that implements b0 unwarping. Please let me know if you have any questions. apersi@sas.upenn.edu  
 + 
 +<code=IDL> 
 +#========================== 
 +# SOFTWARE USAGE 
 +
 +#   FSL -- /usr/local/fsl/ 
 +#          version 4.1 
 +#   SPM2 -- /usr/local/spm2/ 
 +
 +# dcm2nii -- /usr/local/mricron-64bit/dcm2nii 
 +
 +#   FreeSurfer -- /usr/local/freesurfer_64bit/ 
 +#     used for the mri_convert command 
 +
 +#   Bash shell script -- /jet/rito/migraine/PrepScripts/ASL_scripts/RunPerf.sh 
 +#   Bash shell script -- /jet/rito/migraine/PrepScripts/ASL_scripts/RunPASL.sh 
 +#   Bash shell script -- /jet/rito/migraine/PrepScripts/ASL_scripts/RunTransitTime.sh 
 +
 +#   IDL 
 +#     used to implement JJ Wang's perfusion and transit time analysis code 
 +
 +#========================== 
 + 
 + 
 +####### 
 +# Settings 
 +######## 
 + 
 +LOGGING 2 
 +globals thresh=200 
 +globals xa=1 
 +globals ya=1 
 +globals za=1 
 +globals xf=3 
 +globals yf=3 
 +globals zf=3 
 + 
 +globals refvol=/usr/local/spm2/templates/T1.mnc 
 +globals paramfile=SPM2_MNI_params.mat 
 + 
 +globals "bb_anat=[-79,-112,-51;79,76,86]" 
 +globals "bb_func=[-78,-111,-50;78,75,85]" 
 +globals "bb_disp=[-79,-112,-50;79,76,85]" 
 + 
 +####### 
 +# Reset any previous attempts to run this script 
 +####### 
 + 
 +runonce shellcommand "if [ -d Anatomy/raw ]; then mv -f */raw/* ./; fi" 
 +runonce shellcommand "if [ -d models ]; then rm -rf models; fi" 
 +runonce shellcommand "if [ -d Anatomy ]; then rm -rf Anatomy; fi" 
 +rUnonce shellcommand "if [ -d $Subject_* ]; then rm -rf $Subject_*; fi" 
 +runonce shellcommand "if [ -d b0map/mag_raw ]; then mv -f */mag_raw/0008* ./; fi" 
 +runonce shellcommand "if [ -d b0map/phase_raw ]; then mv -f */phase_raw/0009* ./; fi" 
 +runonce shellcommand "if [ -d b0map ]; then rm -rf b0map; fi" 
 +runonce shellcommand "if [ -d DTI ]; then rm -rf DTI; fi" 
 +runonce shellcommand "if [ -d Perfusion_pCASL ]; then rm -rf Perfusion_pCASL; fi" 
 + 
 + 
 +####### 
 +# Prepare Anatomy directory 
 +#  - Create directories 
 +#  - Move DICOM images into the raw directory 
 +#  - Create Functional.cub from ScoutEPI 
 +#  - Create Anatomical.cub from MPRAGE 
 +#  - Move "moco" versions of data to "unused_moco" directory 
 +######## 
 + 
 +runonce shellcommand "mkdir -p Anatomy" 
 +runonce shellcommand "mkdir -p Anatomy/raw" 
 +runonce shellcommand "mkdir -p b0map" 
 +runonce shellcommand "mkdir -p b0map/mag_raw" 
 +runonce shellcommand "mkdir -p b0map/phase_raw" 
 +runonce shellcommand "mv $b0mag b0map/mag_raw" 
 +runonce shellcommand "mv $b0phase b0map/phase_raw" 
 +runonce shellcommand "mv $Loc Anatomy/raw" 
 + 
 +runonce shellcommand "vb2cub $ScoutEPI/* Anatomy/Functional.cub" 
 +runonce shellcommand "mv $ScoutEPI Anatomy/raw/" 
 +runonce shellcommand "vb2cub $MPRAGE Anatomy/Anatomical.cub" 
 +runonce shellcommand "mv $MPRAGE Anatomy/raw/" 
 + 
 +####### 
 +# Prepare scout images 
 +#  These are images to be used for co-registration and for 
 +#  subsequent spatial normalizationThey are generated for 
 +#  the pCASL and DTI data 
 +######## 
 + 
 +runonce shellcommand "tes2cub $RestpCASL Anatomy/pCASL_scout.cub" 
 +runonce shellcommand "tes2cub $DTI1 Anatomy/DTI_scout.cub" 
 + 
 +##### 
 +# Align origins of functional, perfusion, DTI, and anatomical data 
 +##### 
 + 
 +runonce shellcommand "setorigin -m Anatomy/Anatomical.cub Anatomy/Functional.cub" 
 +runonce shellcommand "setorigin -m Anatomy/Functional.cub Anatomy/Anatomical.cub" 
 +runonce shellcommand "setorigin -m Anatomy/Anatomical.cub Anatomy/pCASL_scout.cub" 
 +runonce shellcommand "setorigin -m Anatomy/Anatomical.cub Anatomy/DTI_scout.cub" 
 +runonce shellcommand "resample Anatomy/Anatomical.cub Anatomy/Display.cub -ra Anatomy/Functional.cub" 
 + 
 + 
 +##### 
 +## Get b0 field map, to be used later to unwarp the epi runs 
 +# Convert Phase images to radians. 
 +# Unwrap the phase images 
 +# Get the fieldmap in radians 
 +##### 
 + 
 +### dicom2niftii   
 + 
 +runonce shellcommand "/usr/local/mricron-64bit/dcm2nii -o b0map/mag_raw b0map/mag_raw/$b0mag" 
 +runonce shellcommand "/usr/local/mricron-64bit/dcm2nii -o b0map/phase_raw b0map/phase_raw/$b0phase" 
 +runonce shellcommand "vbconv Anatomy/Functional.cub b0map/functional.nii.gz" 
 +runonce shellcommand "vbconv Anatomy/Display.cub b0map/display.nii.gz" 
 +runonce shellcommand "mv -f b0map/mag_raw/*1001.nii.gz b0map/b0_mag.nii.gz" 
 +runonce shellcommand "rm -f b0map/mag_raw/*2001.nii.gz" 
 +runonce shellcommand "mv -f b0map/phase_raw/*1001.nii.gz b0map/b0_phase1.nii.gz" 
 +runonce shellcommand "mv -f b0map/phase_raw/*2001.nii.gz b0map/b0_phase2.nii.gz" 
 + 
 +shellcommand "/usr/local/mricron-64bit/dcm2nii $raw" 
 +shellcommand "mv -f $raw/*.nii.gz b0map/$scan.nii.gz" 
 + 
 + 
 +# Convert Phase images to radians. Move orig phase 1 and 2 to raw dir. 
 + 
 +runonce shellcommand "fslmaths b0map/b0_phase1.nii.gz -mul 3.14159 -div 4096 -sub 3.14159 b0map/phase1_rad.nii.gz -odt float" 
 +runonce shellcommand "fslmaths b0map/b0_phase2.nii.gz -mul 3.14159 -div 4096 -sub 3.14159 b0map/phase2_rad.nii.gz -odt float" 
 +runonce shellcommand "mv b0map/b0_phase1.nii.gz b0map/phase_raw/b0_phase1.nii.gz" 
 +runonce shellcommand "mv b0map/b0_phase2.nii.gz b0map/phase_raw/b0_phase2.nii.gz"  
 + 
 + 
 +# Unwrap the phase images 
 + 
 +runonce shellcommand "prelude -a b0map/b0_mag.nii.gz -p b0map/phase1_rad.nii.gz -o b0map/phase1_unwrapped_rad.nii.gz" 
 +runonce shellcommand "prelude -a b0map/b0_mag.nii.gz -p b0map/phase2_rad.nii.gz -o b0map/phase2_unwrapped_rad.nii.gz" 
 +runonce shellcommand "mv b0map/phase1_rad.nii.gz b0map/phase_raw/phase1_rad.nii.gz" 
 +runonce shellcommand "mv b0map/phase2_rad.nii.gz b0map/phase_raw/phase2_rad.nii.gz" 
 + 
 +# Get the fieldmap in radians  
 + 
 +runonce shellcommand "fslmaths b0map/phase2_unwrapped_rad.nii.gz -sub b0map/phase1_unwrapped_rad.nii.gz -mul 1000 -div 2.58 b0map/fieldmap_rads.nii -odt float" 
 +runonce shellcommand "mv b0map/phase1_unwrapped_rad.nii.gz b0map/phase_raw/phase1_unwrapped_rad.nii.gz" 
 +runonce shellcommand "mv b0map/phase2_unwrapped_rad.nii.gz b0map/phase_raw/phase2_unwrapped_rad.nii.gz" 
 + 
 +# Unwarp ScoutEPI 
 + 
 +runonce shellcommand "fugue -i b0map/functional.nii.gz --dwell=.0005 --loadfmap=b0map/fieldmap_rads.nii.gz -u b0map/functional_unwarped.nii.gz --unwarpdir=y-" 
 + 
 +# Coregister the ScoutEPI to the Anatomical image 
 + 
 +runonce shellcommand "/home/avants/bin/ants/ANTS 3 -m PR[b0map/display.nii.gz,b0map/functional_unwarped.nii.gz,1,4] --use-Histogram-Matching --number-of-affine-iterations 10000x10000x10000x10000x10000 --rigid-affine true --affine-gradient-descent-option 0.5x0.95x1.e-4x1.e-4  --MI-option 32x16000 -o b0map/antsPR -i 0x0x0 -v -t SyN[0.5]" 
 + 
 +runonce shellcommand "/home/avants/bin/ants/WarpImageMultiTransform 3 b0map/functional_unwarped.nii b0map/functional_unwarped_antsPR.nii.gz -R b0map/display.nii.gz b0map/antsPRAffine.txt" 
 + 
 +runonce shellcommand "mv b0map/functional_unwarped_antsPR.nii.gz b0map/functional_unwarped_coreg.nii.gz" 
 +runonce shellcommand "rm -f b0map/display.nii.gz" 
 +runonce shellcommand "rm -f b0map/functional.nii.gz" 
 + 
 + 
 +runonce shellcommand "resample b0map/functional_unwarped_coreg.nii.gz b0map/functional_unwarped_coreg.nii.gz -xx 0 4 64 -yy 0 4 64" 
 + 
 + 
 +# Unwarp epi runs 
 + 
 +shellcommand "fugue -i b0map/$scan.nii.gz --dwell=.0005 --loadfmap=b0map/fieldmap_rads.nii.gz -u b0map/$scan_unwarped.nii.gz --unwarpdir=y-" 
 + 
 + 
 +# run motion correction on epis 
 + 
 +shellcommand "mcflirt -in b0map/$scan_unwarped.nii.gz -o b0map/$scan_unwarped.nii.gz -reffile b0map/functional_unwarped_coreg.nii.gz -plots" 
 + 
 +# Clean up b0 directory 
 + 
 +shellcommand "mkdir $Subject_$scan" 
 +shellcommand "mkdir $Subject_$scan/raw" 
 +shellcommand "mv $raw $Subject_$scan/raw" 
 +shellcommand "vbconv b0map/$scan_unwarped.nii.gz $Subject_$scan/$Subject_$scan.tes" 
 +shellcommand "vbconv b0map/$scan.nii.gz $Subject_$scan/raw/$Subject_$scan_raw.tes" 
 +shellcommand "rm -f b0map/$scan.nii.gz" 
 +shellcommand "mv b0map/$scan_unwarped.nii.gz.par $Subject_$scan/$Subject_$scan_motion.par" 
 +runonce shellcommand "mv b0map/b0_mag.nii.gz b0map/mag_raw" 
 +runonce shellcommand "mkdir b0map/coreg" 
 +runonce shellcommand "mv b0map/functional_unwarped_coreg.nii.gz b0map/coreg" 
 +runonce shellcommand "mv b0map/antsPRAffine.txt b0map/coreg" 
 + 
 +  
 +##### 
 +# Process the Anatomical volume 
 +##### 
 + 
 +# Store the original anatomical 
 + 
 +runonce shellcommand "cp Anatomy/Anatomical.cub Anatomy/OrigAnatomical.cub" 
 + 
 +# Convert the Anatomical.cub file to Anatomical.nii 
 +  
 +runonce shellcommand "vbconv Anatomy/Anatomical.cub -o Anatomy/Anatomical.nii" 
 +  
 +# Perform noise reduction, skull-stripping and inhomogeneity correction with FSL tools 
 +  
 +runonce shellcommand "/usr/local/fsl/bin/susan Anatomy/Anatomical.nii 23.3302 3 3D 1 0 Anatomy/susanAnatomical.nii.gz" 
 +runonce shellcommand "/usr/local/fsl/bin/bet Anatomy/susanAnatomical.nii.gz Anatomy/susanAnatomical_BET -f 0.5 -g 0 -o -m" 
 +  
 +runonce shellcommand "gunzip Anatomy/susanAnatomical.nii.gz" 
 +runonce shellcommand "gunzip Anatomy/susanAnatomical_BET.nii.gz" 
 +runonce shellcommand "gunzip Anatomy/susanAnatomical_BET_mask.nii.gz" 
 +  
 +runonce shellcommand "/usr/local/fsl/bin/fast --type=1 --class=3 -B --out=Anatomy/susanAnatomical_BET_FAST Anatomy/susanAnatomical_BET" 
 +  
 +# Gunzip the files 
 +  
 +runonce shellcommand "gunzip Anatomy/susanAnatomical_BET_FAST_*nii.gz" 
 +  
 +# Wrap the skull back around the inhomogeneity corrected brain volume 
 +  
 +runonce shellcommand "vbim -i Anatomy/susanAnatomical_BET_mask.nii -invert -write Anatomy/NotBrain_mask.nii" 
 +runonce shellcommand "vbim -i Anatomy/NotBrain_mask.nii Anatomy/susanAnatomical.nii -product -write Anatomy/NotBrain.nii" 
 +runonce shellcommand "vbim -i Anatomy/NotBrain.nii Anatomy/susanAnatomical_BET_FAST_restore.nii -sum -write Anatomy/Anatomical_fsl.nii" 
 +  
 +# Convert the Anatomical.nii file to Anatomical.cub 
 +  
 +runonce shellcommand "rm Anatomy/Anatomical.cub" 
 +runonce shellcommand "vbconv Anatomy/Anatomical_fsl.nii -o Anatomy/Anatomical.cub" 
 +runonce shellcommand "vbhdr -c Anatomy/OrigAnatomical.cub Anatomy/Anatomical.cub" 
 +  
 +# Clean-up 
 +  
 +runonce shellcommand "mv Anatomy/susanAnatomical_BET_FAST_seg.nii Anatomy/Anatomical_seg.nii" 
 + 
 +runonce shellcommand "rm Anatomy/Anatomical.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET_overlay.nii.gz" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET_mask.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET_FAST_mixeltype.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET_FAST_pve_0.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET_FAST_pve_1.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET_FAST_pve_2.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET_FAST_pveseg.nii" 
 +runonce shellcommand "rm Anatomy/susanAnatomical_BET_FAST_restore.nii" 
 +runonce shellcommand "rm Anatomy/NotBrain.nii" 
 +runonce shellcommand "rm Anatomy/NotBrain_mask.nii" 
 + 
 +##### 
 +# Create the "Display" volumes for the first MPRAGE 
 +##### 
 +  
 +runonce shellcommand "resample Anatomy/Anatomical.cub Anatomy/Display.cub -ra Anatomy/Functional.cub" 
 + 
 +#### 
 +# Co-register each of the scout images (pCASL, DTI) to 
 +#  the functional scout volume 
 +
 +# The header of the Functional.cub must be copied onto the 
 +#  resliced (coregistered) file to preserve origin info 
 +#### 
 + 
 +runonce shellcommand "vb2img Anatomy/Functional.cub Anatomy/Functional.img" 
 + 
 +runonce shellcommand "vb2img Anatomy/pCASL_scout.cub Anatomy/pCASL_scout.img" 
 +runonce shellcommand "vb2img Anatomy/DTI_scout.cub Anatomy/DTI_scout.img" 
 + 
 +runonce shellcommand "/usr/local/fsl/bin/flirt -in Anatomy/pCASL_scout.hdr -ref Anatomy/Functional.hdr -out Anatomy/pCASL_scout_Coreg.hdr -omat Anatomy/pCASL_scout_Coreg.mat -bins 256 -cost corratio -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -dof 12 -interp trilinear -noresample" 
 +runonce shellcommand "/usr/local/fsl/bin/flirt -in Anatomy/DTI_scout.hdr -ref Anatomy/Functional.hdr -out Anatomy/DTI_scout_Coreg.hdr -omat Anatomy/DTI_scout_Coreg.mat -bins 256 -cost corratio -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -dof 12 -interp trilinear -noresample" 
 + 
 +runonce shellcommand "gunzip Anatomy/pCASL_scout_Coreg.nii.gz" 
 +runonce shellcommand "gunzip Anatomy/DTI_scout_Coreg.nii.gz" 
 + 
 +runonce shellcommand "vbconv Anatomy/pCASL_scout_Coreg.nii Anatomy/pCASL_scout_Coreg.cub" 
 +runonce shellcommand "vbconv Anatomy/DTI_scout_Coreg.nii Anatomy/DTI_scout_Coreg.cub" 
 + 
 +runonce shellcommand "vbhdr -c Anatomy/Functional.cub Anatomy/pCASL_scout_Coreg.cub" 
 +runonce shellcommand "vbhdr -c Anatomy/Functional.cub Anatomy/DTI_scout_Coreg.cub" 
 + 
 +runonce shellcommand "rm Anatomy/pCASL_scout.img" 
 +runonce shellcommand "rm Anatomy/pCASL_scout.hdr" 
 +runonce shellcommand "rm Anatomy/pCASL_scout_Coreg.nii" 
 + 
 +runonce shellcommand "rm Anatomy/DTI_scout.img" 
 +runonce shellcommand "rm Anatomy/DTI_scout.hdr" 
 +runonce shellcommand "rm Anatomy/DTI_scout_Coreg.nii" 
 + 
 + 
 +##### 
 +# Perform normalization of anatomicals and scouts (Functional, perfusion, DTI) using SPM2 
 +##### 
 + 
 +runonce spm2_norm_calc $DIR/Anatomy/ $paramfile Anatomical.cub $refvol $xa $ya $za $bb_anat 
 +runonce spm2_norm_apply3d $DIR/Anatomy $DIR/Anatomy/$paramfile Anatomical.cub nAnatomical.cub $xa $ya $za $bb_anat 
 +runonce spm2_norm_apply3d $DIR/Anatomy $DIR/Anatomy/$paramfile Functional.cub nFunctional.cub $xf $yf $zf $bb_func 
 +runonce spm2_norm_apply3d $DIR/Anatomy $DIR/Anatomy/$paramfile pCASL_scout_Coreg.cub npCASL_scout_Coreg.cub $xf $yf $zf $bb_func 
 +runonce spm2_norm_apply3d $DIR/Anatomy $DIR/Anatomy/$paramfile DTI_scout_Coreg.cub nDTI_scout_Coreg.cub $xf $yf $zf $bb_func 
 +runonce spm2_norm_apply3d $DIR/Anatomy $DIR/Anatomy/$paramfile Anatomical.cub nDisplay.cub $xa $ya $zf $bb_disp 
 + 
 + 
 +####### 
 +# Process the pCASL data 
 +#  - Prepare Perfusion_pCASL directory 
 +#  - convert non-moco pCASL series to TES file 
 +#  - Call JJ Wang's IDL code via a bash shell script 
 +#  - extract the CBF image from the output (the third image of the tes file) 
 +#  - move the processed files into sub-directories 
 +#  - convert the CBF volumes to ANALYZE format 
 +#  - reslice the CBF images to the functional space using FLIRT 
 +#  - use Freesurfer MRI convert to change the replaced file to ANALYZE 
 +#  - convert CBF volumes to imagesthen cubs, and put the processed files away 
 +#  - spatially normalize the CBF cub images using SPM 
 +#  - remove the un-needed files 
 +####### 
 + 
 +runonce shellcommand "mkdir -p Perfusion_pCASL" 
 +runonce shellcommand "mkdir -p Perfusion_pCASL/raw" 
 +runonce shellcommand "vb2tes $RestpCASL Perfusion_pCASL/$Subject_pCASL_RestingCBF.tes" 
 +runonce shellcommand "mv $RestpCASL Perfusion_pCASL/raw/" 
 +runonce shellcommand "mv $moco_RestpCASL Perfusion_pCASL/raw/" 
 + 
 +runonce shellcommand "sh /jet/aguirre/PatientStudies/BlindnessNOS/PrepScripts/ASL_scripts/RunPerf.sh Perfusion_pCASL/$Subject_pCASL_RestingCBF.tes 1650 60 1200 1500" 
 + 
 +runonce shellcommand "tes2cub Perfusion_pCASL/$Subject_pCASL_RestingCBF.pf.tes Perfusion_pCASL/$Subject_pCASL_RestingCBF.cub 3" 
 +runonce shellcommand "mkdir Perfusion_pCASL/processed" 
 +runonce shellcommand "mv Perfusion_pCASL/$Subject_pCASL_RestingCBF.pf.tes Perfusion_pCASL/processed/" 
 +runonce shellcommand "mv Perfusion_pCASL/$Subject_pCASL_RestingCBF.tes Perfusion_pCASL/processed/" 
 + 
 +runonce shellcommand "vb2img Perfusion_pCASL/$Subject_pCASL_RestingCBF.cub Perfusion_pCASL/$Subject_pCASL_RestingCBF.img" 
 + 
 + 
 +runonce shellcommand "/usr/local/fsl/bin/flirt -in Perfusion_pCASL/$Subject_pCASL_RestingCBF.hdr -ref Anatomy/Functional.hdr -applyxfm -init Anatomy/pCASL_scout_Coreg.mat  -out Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.nii.gz" 
 +runonce shellcommand64 "export FREESURFER_HOME=/usr/local/freesurfer_64bit;/usr/local/freesurfer_64bit/bin/mri_convert $DIR/Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.nii.gz $DIR/Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.img" 
 + 
 +runonce shellcommand "vb2cub Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.img Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.cub" 
 + 
 +runonce spm2_norm_apply3d $DIR/Perfusion_pCASL $DIR/Anatomy/$paramfile $Subject_pCASL_RestingCBF_Coreg.cub n$Subject_pCASL_RestingCBF_Coreg.cub $xf $yf $zf $bb_func 
 + 
 +runonce shellcommand "rm Perfusion_pCASL/$Subject_pCASL_RestingCBF.img" 
 +runonce shellcommand "rm Perfusion_pCASL/$Subject_pCASL_RestingCBF.hdr" 
 +runonce shellcommand "rm Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.img" 
 +runonce shellcommand "rm Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.hdr" 
 +runonce shellcommand "rm Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.nii.gz" 
 +runonce shellcommand "rm Perfusion_pCASL/$Subject_pCASL_RestingCBF_Coreg.mat" 
 + 
 + 
 +####### 
 +# Prepare the DTI data 
 +#  At present, this involves simply 
 +#  involves moving the data into 
 +#  a top-level DTI directory 
 +####### 
 + 
 +runonce shellcommand "mkdir -p DTI" 
 +runonce shellcommand "mkdir -p DTI/raw" 
 + 
 +runonce shellcommand "mv $DTI1 DTI/raw/" 
 +runonce shellcommand "mv $DTI2 DTI/raw/" 
 + 
 +  
 +###################### 
 +# process the tes file 
 +###################### 
 +  
 +shellcommand "sliceacq -i $Subject_$scan/$Subject_$scan.tes -o $Subject_$scan/$Subject_$scan.tes -n" 
 +#shellcommand "setorigin -c Anatomy/Functional.cub $Subject_$scan/$Subject_$scan.tes 
 +spm2_norm_apply4d $DIR/$Subject_$scan $DIR/Anatomy/$paramfile $Subject_$scan.tes n$Subject_$scan.tes $xf $yf $zf $bb_func 
 +shellcommand "vbsmooth -vox 0.5 0.5 0.5 -o $Subject_$scan/$Subject_$scan.tes $Subject_$scan/$Subject_$scan.tes 
 +threshold $Subject_$scan/$Subject_$scan.tes $Subject_$scan/$Subject_$scan.tes $thresh 
 +calcgs $Subject_$scan/$Subject_$scan.tes 
 +calcps $Subject_$scan/$Subject_$scan.tes 
 + 
 +###################### 
 +# Create a models directory 
 +# Create the average power spectrum and one-over-f file 
 +##################### 
 + 
 +runonce shellcommand "mkdir -p Models" 
 +runonce shellcommand "vbfit 3000 150 $Subject_01/$Subject_01_PS.ref $Subject_02/$Subject_02_PS.ref $Subject_03/$Subject_03_PS.ref -o Models/OneOverF.ref" 
 + 
 +</code>
  
epi_fieldmap_unwarping.1333635776.txt.gz · Last modified: 2016/09/15 18:04 (external edit)