Hi Sally, I'm not an expert myself but I use just one 3D image as input to epi_reg, for example, epi_reg --epi=func_meanvol ... --out=epi2struct Then, you can combine epi2struct_warp with the struct2standard warp (previously computed with flirt/fnirt) using convertwarp. After that, I also combine this with each volume's transformation from mcflirt so that I can use applywarp to warp each volume of the time series directly to standard space with one transformation. You could also take a look at the relevant scripts in the HCP pipelines, where this is being done in a similar way, I believe. I don't remember if they use fsl_prepare_fieldmap and epi_reg, though. Cheers, Kris Quoting Sally Grace <[log in to unmask]>: > Hi experts, > > I have previously analysed my EPI resting-state data with the following > pipeline using command line tools, but I would like to add distortion > correction and I am unsure at what stage to perform slice timer, motion > correction (mcflirt), and distortion correction. > > *Old pipeline:* > > 1. STRUCTURAL PREPROCESSING (Input is T1 image) > 1. fslreorient2std > 2. BET brain extraction on T1's > 3. FLIRT (register T1 to standard space and generate and affine) > 4. FNIRT (coregister T1 native to standard space) > 2. FUNCTIONAL PREPROCESSING (input is resting-state EPI) > 1. fslreorient2std > 2. slicetimer > 3. mcflirt > 4. fslmaths -Tmean to get a merged and average .nii using the mean > across time > 3. functional FLIRT (-in = is fslmaths'd output, -ref = bet'd T1) > 4. applywarp based on native T1 (--in= mcflirt'd functional --premat = > affine from flirt) > > > My question is, at what stage in the above pipeline could I perform > distortion correction? Below are my steps to perform distortion correcton > which works well. However, I would like to also perform slice timer and > motion correction so I have attempted to input the mcflirt'd output into > epi_reg but that does not work. > > 1. *fsl_prepare_fieldmap* > 2. *epi_reg: *epi_reg --epi=ep2d_3_3iso_Resting.nii --t1=t1.nii.gz > --t1brain=bet_brain.nii.gz --fmap=fieldmap.nii.gz > --fmapmag=fieldmap_mag.nii --fmapmagbrain=fieldmap_mag_BET.nii.gz > --echospacing=0.00035 --pedir=-y --out=epi2struc > 3. *structural flirt:* flirt -in myStructuralImage -ref > myStandardSpaceImage -omat struct2standard.mat > 4. *functional flirt:* flirt -in epi2struc.nii.gz -ref > myStandardSpaceImage -out epi2standard -applyxfm -init struct2standard.mat > > Any help is greatly appreciated. Thank you! > > Kind regards, > Sally.