JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for FSL Archives


FSL Archives

FSL Archives


FSL@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

FSL Home

FSL Home

FSL  June 2010

FSL June 2010

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Gradient Field Map & Eddy Current Correction

From:

"Todd L. Richards" <[log in to unmask]>

Reply-To:

FSL - FMRIB's Software Library <[log in to unmask]>

Date:

Wed, 16 Jun 2010 10:15:02 -0700

Content-Type:

multipart/mixed

Parts/Attachments:

Parts/Attachments

text/plain (18 lines) , par_rec_dti_donna.txt (1 lines)

I think its best to run eddy current correction first and then apply the B0 map correction.  I have included here a bash script which shows how to process the B0map and the DTI scan using FSL commands  but its specific for Philips par rec files.  You will need to modify this script for your specific acquisition.
Todd Richards

-----Original Message-----
From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Forrest Johnson
Sent: Wednesday, June 16, 2010 8:39 AM
To: [log in to unmask]
Subject: [FSL] Gradient Field Map & Eddy Current Correction

Hello Experts, 

I was wondering if someone could tell me if I apply my gradient field map correction before or after I run the eddy current correction in my DTI data? Also, if someone could provide a reference article that would be absolutely fabulous. 

Also, do I need to motion correct the gradient field map?

Cheers



#!/bin/sh SEARCHFOR=fMRI:DTI:B0:MPRAGE #echo $SEARCHFOR # Save current location MYLOCAT=`pwd` echo $MYLOCAT TEST=`awk {print} ${1}` ; #echo TEST:${TEST} for AFOLDER in ${TEST} do if [ ! -d ${AFOLDER} ] ; then echo echo ERROR: Skipping this line of submit file echo Can not CD to ${AFOLDER} from: pwd continue fi cd ${AFOLDER} echo Working in Folder: ${AFOLDER} PARSTOPROCESS=`ls *.PAR` #echo $PARSTOPROCESS for AFILE in ${PARSTOPROCESS} do #Strip off the extension AFILE=`echo ${AFILE} | awk ' { keep=index($0,".PAR")-1 ; print substr($0, 1, keep) } ' ` ; PROTOCOL=`awk ' /Protocol name/ { numsearch=split( "'${SEARCHFOR}'" , protos, ":") ; for (anitem in protos) {tst=index($0,protos[anitem]); if (tst > 0) print protos[anitem] ;} }' ${AFILE}.PAR ` # test if protocol not recognized; if [ -z ${PROTOCOL} ]; then echo echo ERROR: Protocol not cognized for File: ${AFILE} continue fi # test if this file has already been processed if [ \( -e _${PROTOCOL}_${AFILE}.nii.gz \) -o \( -e \_${PROTOCOL}_MAG_${AFILE}.nii.gz \) ] ; then #skip to next item in list for this folder echo File: _${PROTOCOL}_${AFILE}.nii.gz already exists continue fi echo ${AFILE} in folder ${AFOLDER} is a ${PROTOCOL} Protocol #echo The PAR file contains a ${PROTOCOL} Protocol SLICES=`awk '/Max. number of slices\/locations/ {print $7} ' ${AFILE}.PAR` ; #echo Slices: $SLICES; VOLS=`awk ' /Max. number of dynamics/ {print $7} ' ${AFILE}.PAR ` ; #echo Volumes: $VOLS DIMS=`awk ' /1 1 1 1/ {print $10, $11, $12, $13, $23, $24, $29, $30} ' ${AFILE}.PAR ` ; #echo VoxelInfo: $DIMS XDIM=`echo ${DIMS} | awk '{print $1}'`; echo XDIM: ${XDIM} XSIZE=`echo ${DIMS} | awk '{print $7}'`; #echo XSIZE: ${XSIZE} YDIM=`echo ${DIMS} | awk '{print $2}'`; #echo YDIM: ${YDIM} YSIZE=`echo ${DIMS} | awk '{print $8}'`; #echo YSIZE: ${YSIZE} ZSIZE=`echo ${DIMS} | awk '{print $5+$6}'`; #echo ZSIZE: ${ZSIZE} TR=`awk ' /Repetition time/ {print $6/1000} ' ${AFILE}.PAR ` ; #echo TR: $TR case "$PROTOCOL" in fMRI) #. Protocol name : fMRI_SSh CLEAR_TE30_BW2083P5_TR3_DYN114 CLEAR #. Max. number of slices/locations : 32 #. Max. number of dynamics : 114 #. FOV (ap,fh,rl) [mm] : 240.00 159.00 240.00 #. Repetition time [ms] : 3000.00 # 1 1 1 1 0 2 0 16 100 64 64 0.0 1.632 4.815e-004 1000 2000 0.0 0.0 0.0 -3.3 -48.5 1.5 4.0 1.0 0 1 0 2 3.750 3.750 30.0 0.0 0.0 0.000 1 90.0 0 0 0 0 0.0 XYDIM=`echo ${DIMS} | awk '{print $1*$2}'`; echo XYDIM: ${DIMS} echo VOLS: $VOLS echo SLICES: $SLICES # create a header for xy t z avwcreatehd ${XYDIM} ${VOLS} ${SLICES} 1 ${XSIZE} ${YSIZE} ${ZSIZE} ${TR} 0 0 0 4 rj_1.hdr # Match this header to the input data cp ${AFILE}.REC rj_1.img #Swap the z and t dimensions avwswapdim rj_1 x z y rj_2 # Force Output to ANALYZE format avwchfiletype ANALYZE rj_2 # create a header for x y z t avwcreatehd ${XDIM} ${YDIM} ${SLICES} ${VOLS} ${XSIZE} ${YSIZE} ${ZSIZE} ${TR} 0 0 0 4 rj_3.hdr cp rj_2.img rj_3.img #avwchfiletype NIFTI_GZ rj_3 avwswapdim rj_3 x -y z rj_4 #fslview rj_4 RI=`echo ${DIMS} | awk '{print $3}'`; #echo RI: ${RI} RS=`echo ${DIMS} | awk '{print $4}'`; #echo RS: ${RS} # DV = PV * RS + RI avwmaths rj_4 -mul ${RS} -add ${RI} _${PROTOCOL}_${AFILE} #fslview _${PROTOCOL}_${AFILE} ;; B0) #. Protocol name : B0_MAP_TE20_24_BW144P8 #. Max. number of slices/locations : 32 #. Max. number of dynamics : 1 #. FOV (ap,fh,rl) [mm] : 240.00 159.00 240.00 # 1 1 1 1 0 2 0 16 100 64 64 0.0 1.221 1.811e-004 1000 2000 0.0 0.0 0.0 -3.3 -48.5 1.5 4.0 1.0 0 1 0 2 3.750 3.750 20.0 0.0 0.0 0.000 1 90.0 0 0 0 0 0.0 # 1 1 1 1 3 4 32 16 100 64 64 -125.0 0.061 1.638e+001 0 250 0.0 0.0 0.0 -3.3 -48.5 1.5 4.0 1.0 0 1 0 2 3.750 3.750 20.0 0.0 0.0 0.000 1 90.0 0 0 0 0 0.0 # test if this is the B0 file that actually has some data if [ -s ${AFILE}.REC ] ; then # create a header for x y z t avwcreatehd ${XDIM} ${YDIM} ${SLICES} 2 ${XSIZE} ${YSIZE} ${ZSIZE} ${TR} 0 0 0 4 rj_3.hdr cp ${AFILE}.REC rj_3.img avwswapdim rj_3 x -y z rj_4; #fslview rj_4 MAG_RI=`echo ${DIMS} | awk '{print $3}'`; # echo MAG_RI: ${MAG_RI} MAG_RS=`echo ${DIMS} | awk '{print $4}'`; # echo MAG_RS: ${MAG_RS} PHASE_RI=`echo ${DIMS} | awk '{print $11}'`; # echo PHASE_RI: ${PHASE_RI} PHASE_RS=`echo ${DIMS} | awk '{print $12}'`; # echo PHASE_RS: ${PHASE_RS} avwsplit rj_4 rj # DV = PV * RS + RI avwmaths_32R rj0000 -mul ${MAG_RS} -add ${MAG_RI} rj0000 avwmaths_32R rj0001 -mul ${PHASE_RS} -add ${PHASE_RI} -mul 6.28318 rj0001 avwmerge -t rj_5 rj0000 rj0001 avwchfiletype ANALYZE rj_5 avwcreatehd ${XDIM} ${YDIM} ${SLICES} 2 ${XSIZE} ${YSIZE} ${ZSIZE} ${TR} 0 0 0 16 rj_6.hdr cp rj_5.img rj_6.img avwchfiletype NIFTI_GZ rj_6 avwsplit rj_6 rj cp rj0000.nii.gz _B0_MAG.nii.gz cp rj0001.nii.gz _B0_PHASE.nii.gz # fixit to the right directory for designdti.fsf cp /usr/local/fsl/bin/designdti.fsf local.fsf echo 'set unwarp_files(1) "'${AFOLDER}'/_B0_PHASE.nii.gz"' >> local.fsf echo 'set unwarp_files_mag(1) "'${AFOLDER}'/_B0_MAG.nii.gz"' >> local.fsf echo 'set feat_files(1) "'${AFOLDER}'/dtidata.nii.gz"' >> local.fsf # Change the working directory setup by todd cat local.fsf else echo Skipping file ${AFILE} because the REC file has 0 bytes continue fi ;; DTI) #. Protocol name : DTI_SSh_BW932_TE63_DIFFGR_32P7 SENSE #. Max. number of slices/locations : 72 #. Max. number of dynamics : 258 #. FOV (ap,fh,rl) [mm] : 240.00 144.00 240.00 # 1 1 33 1 0 1 0 16 100 128 128 0.0 2.907 1.295e-003 1064 2128 0.0 0.0 0.0 -3.3 -40.2 1.5 2.0 0.0 0 1 0 2 1.875 1.875 63.0 0.0 0.0 0.000 1 90.0 0 0 0 0 0.0 DIMS=`awk ' /1 1 1 0 1 / {print $10, $11, $12, $13, $23, $24, $29, $30, $3, $34, $46, $47, $48} ' ${AFILE}.PAR ` ; # echo VoxelInfo: $DIMS XDIM=`echo ${DIMS} | awk '{print $1}'`; echo XDIM: ${XDIM} XSIZE=`echo ${DIMS} | awk '{print $7}'`; echo XSIZE: ${XSIZE} YDIM=`echo ${DIMS} | awk '{print $2}'`; echo YDIM: ${YDIM} YSIZE=`echo ${DIMS} | awk '{print $8}'`; echo YSIZE: ${YSIZE} ZSIZE=`echo ${DIMS} | awk '{print $5+$6}'`; echo ZSIZE: ${ZSIZE} XYDIM=`echo ${DIMS} | awk '{print $1*$2}'`; echo XYDIM: ${XYDIM} VOLS=34; echo VOLS: ${VOLS} echo SLICES: ${SLICES} # create a header for xy t z fslcreatehd ${XDIM} ${YDIM} ${SLICES} ${VOLS} ${XSIZE} ${YSIZE} ${ZSIZE} ${TR} 0 0 0 16 test34 fslchfiletype ANALYZE test34 # Match this header to the input data cp ${AFILE}.REC rj_1.img rm sendname.txt echo "${AFILE}.PAR" >> sendname.txt /usr/local/fsl/bin/findbvecdonna.exe cp rj_1a.img ${AFILE}dti.img cp test34.hdr ${AFILE}dti.hdr cp bvecs.txt bvecs cp bvals.txt bvals eddy_correct ${AFILE}dti.hdr dtidata 0 ;; esac done # done with converting B0 and DTI to nifti # now process DTI data with B0 map # Todd changed this part to fix the brain cut off problem by using # bet with -f 0.3 feat local.fsf cp ./dtidata.feat/filtered_func_data.nii.gz ./unwarpdtidata.nii.gz fslroi ./unwarpdtidata ./nodif 0 1 bet ./nodif ./nodif_brain_mask1 -f 0.3 fslmaths ./nodif_brain_mask1 -bin ./nodif_brain_mask fslroi ./unwarpdtidata ./data2 0 33 dtifit -k ./data2 -m ./nodif_brain_mask -r bvecs -b bvals -o ./dti # Now back to calling folder cd ${MYLOCAT} done exit

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager