I'm afraid I can't be of much help regarding running this through the FEAT
GUI, but I have gotten it to work quite well using the commandline
utilities. You have correctly identified that your field map intensities
may be part of the problem. I am curious what scanner you used to acquire
the field map and what utility you did the DICOM to NIFTI conversion with.
Assuming you have the correct intensities in your real field map, the
following shell function would work for you:
#Do intitial DTI preprocessing including: motion correction and distortion
correction
#Input: DTI data: data1.nii.gz, Magnitude image: Magnitude.nii.gz, Real
Field Map: FieldMap.nii.gz
#Output: data.nii.gz, the raw corrected DTI data.
function Preprocess_DTI {
echo "Preprocessing DTI"
UnwarpDir="y"
DwellTime="0.000720"
bet Magnitude.nii.gz Magnitude_brain.nii.gz -f .3 -m
fslmaths FieldMap.nii.gz -mas Magnitude_brain_mask.nii.gz
FieldMap_brain.nii.gz
fugue --loadfmap=FieldMap_brain -s 4 --savefmap=FieldMap_brain_s4
fslroi data1.nii.gz nodif 0 1
eddy_correct data1.nii.gz data1_corr.nii.gz 0
bet nodif.nii.gz nodif_brain -m -f .3
fugue -v -i Magnitude_brain --unwarpdir="$UnwarpDir" --dwell=$DwellTime
--loadfmap=FieldMap.nii.gz -w Magnitude_brain_warpped
flirt -in Magnitude_brain_warpped.nii.gz -ref nodif_brain.nii.gz -out
Magnitude_brain_warpped_2_nodif_brain -omat fieldmap2diff.mat
flirt -in FieldMap_brain_s4.nii.gz -ref nodif_brain -applyxfm -init
fieldmap2diff.mat -out FieldMap_brain_s4_2_nodif_brain
fugue -v -i nodif_brain --icorr --unwarpdir="$UnwarpDir" --dwell=$DwellTime
--loadfmap=FieldMap_brain_s4_2_nodif_brain.nii.gz -u
nodif_distortion_corrected
fugue -v -i data1_corr.nii.gz --icorr --unwarpdir="$UnwarpDir"
--dwell=$DwellTime --loadfmap=FieldMap_brain_s4_2_nodif_brain.nii.gz -u
data.nii.gz
echo "DTI Preprocessing Done"
}
Preprocess_DTI
The basics of what is happening in the above code are the following:
Extract the brain using the magnitude image and apply that to the field map.
Smooth the field map using a 4mm kernel. eddy_correct and extract the DTI
data. Warp the magnitude image according to the field map so that it
accurately matches the distortion in the DTI data. Register the field map
to the DTI data to generate a transformation matrix. Apply this
transformation matrix to the field map so that the DTI data and field map
are registered. Unwarp the b0 and the DTI data using the registered field
map. It should now be possible to register your FA image to your T1
structural image using only 6 degrees of freedom. You will need to change
the above script to match your dwell time and phase encoding direction.
Peace,
Matt.
-----Original Message-----
From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf
Of Siewmin Gan
Sent: Wednesday, April 29, 2009 8:36 AM
To: [log in to unmask]
Subject: [FSL] problem running FEAT
Hi,
I'm trying to use the FEAT GUI prestats to correct my DTI data
distortion with FSL
4.1.2. It started running fine with the following stated on the feat html
page and folders
created. However, the status is "still running" after several days. I'm not
sure if the
problem lies in my input files/parameters or with the fsl I've installed. I
have also used
the same dataset and tried running it on FSL4.1.0 and 4.1.1 and the same
thing happens.
The other tools on fsl ( bet, eddy, tbss, fdt and tracking and fslview) have
worked fine.
I have pasted here the output file/folders and feat report log from running
the FEAT GUI.
On the fsl FEAT GUI, i then turn off all options except the prestats and put
in my 4D
eddycorrected data.nii.gz, the calculated fieldmap, my
betted_magnitude_brain.nii.gz and
the required parameters effective EPI echo spacing 0.282ms and EPI TE 102ms.
The output files and folders are:
design.con mc
design.frf prefiltered_func_data.nii.gz
design.fsf prefiltered_func_data_mcf.nii.gz
design.mat report.html
design.png report_log.html
design.ppm report_poststats.html
design.trg report_prestats.html
design_cov.png report_reg.html
design_cov.ppm report_stats.html
example_func.nii.gz unwarp
logs
The progress report is :
Feat main script
/bin/cp /tmp/feat_AQIvE7.fsf design.fsf
/Applications/fsl/fsl/bin/feat_model design
mkdir .files;cp /Applications/fsl/fsl/doc/fsl.css .files;ln -s
/Applications/fsl/fsl/doc/images
.files/images
/Applications/fsl/fsl/bin/fsl_sub -T 11 -l logs -N feat2_pre
/Applications/fsl/fsl/bin/feat
/Users/siewmingan/Desktop/DATASET/sharon/fsl/trydistortion/data.feat/design.
fsf -D
/Users/siewmingan/Desktop/DATASET/sharon/fsl/trydistortion/data.feat -I 1
-prestats
Prestats
/Applications/fsl/fsl/bin/fslmaths
/Users/siewmingan/Desktop/DATASET/sharon/fsl/trydistortion/data
prefiltered_func_data
-odt float
Total original volumes = 35
/Applications/fsl/fsl/bin/fslroi prefiltered_func_data example_func 17 1
/bin/mkdir -p unwarp
Secondly, I would like to ask if I have done these calc correctly and if it
matters that the
range of intensity of my fieldmap has changed from (-4096 to 4096) to (0 to
4094) when
it is converted from dicom to nii format:
I have a magnitude map and a real field map from the scanner.
The real field map dicom file has intensity -4096 to +4094.
When the dicom file is converted to nifti, the real field map.nii has
intensity 0 to 4094.
I rescale it 2 ways to try it out as the range of my real fieldmap is not
from -pie to pie.
1. real fieldmap.nii -mul 3.142 -div 4096 fieldmap1.nii -odt float
(this output file has intensity 0 to 3.142)
2. real fieldmap.nii -mul 6.284 -div 4096 fieldmap2.nii -odt float
(this output file has intensity 0 to 6.284)
I did not divide by the TE echo time difference between the phase maps in
seconds (i.e
real fieldmap.nii -mul 6.284 -div 4096 -div 0.00246 newfieldmap.nii odt
float).
It is recommended to use the FEAT gui to do the distortion correction. If
unfortunately, for
some reasons I cannot run the FEAT gui, is it possible to run command line
with the
realfieldmap data and the magnitude map data that I have? I found commands
lines for
phase maps but am not sure how to do the distortion correction with a
realfieldmap of
intensity 0 to 4094 and a magnitude map. Is there a sample command line for
me to
perform the distortion correction?
Many Thanks
Siewmin
|