Skip to content

epi_reg

epi_reg is a script designed to register EPI images (typically functional or diffusion) to structural (e.g. T1-weighted) images. The pre-requisites to use this method are: (1) a structural image that can be segmented to give a good white matter boundary; and (2) an EPI that contains some intensity contrast between white matter and grey matter (though it does not have to be enough to get a segmentation).

This script will either use an existing white-matter segmentation of the structural image, or create one itself, to define a white-matter boundary. To use an existing white-matter segmentation you can use the --wmseg option. Alternately, there needs to be an image with the same basename as the input --t1brain image, but ending with _wmseg. We recommend that the structural image is bias-corrected separately beforehand if there is obvious bias field present.

The script is also capable of using fieldmaps to perform simultaneous registration and EPI distortion-correction. For this it requires extra images (in the format as given by fsl_prepare_fieldmap) as well as extra information about the EPI sequence (which your operator/radiographer/technician should be able to provide, but make sure you record the values). The inputs echospacing and pedir both refer to the EPI image (not the fieldmap) and are the same as required for FEAT, but be careful to use the correct units.

Command-line usage is as follows:

Usage: epi_reg [options] --epi=<EPI image> --t1=<wholehead T1 image> --t1brain=<brain extracted T1 image> --out=<output name>

Optional arguments
  --fmap=<image>         : fieldmap image (in rad/s)
  --fmapmag=<image>      : fieldmap magnitude image - wholehead extracted
  --fmapmagbrain=<image> : fieldmap magnitude image - brain extracted
  --gdc=<image>          : Gradient-distortion corection warpfield
  --wmseg=<image>        : white matter segmentation of T1 image
  --echospacing=<val>    : Effective EPI echo spacing (sometimes called dwell time) - in seconds
  --pedir=<dir>          : phase encoding direction, dir = x/y/z/-x/-y/-z
  --weight=<image>       : weighting image (in T1 space)
  --nofmapreg            : do not perform registration of fmap to T1 (use if fmap already registered)
  --noclean              : do not clean up intermediate files
  -v                     : verbose output
  -h                     : display this help message

e.g.:

epi_reg --epi=example_func --t1=struct --t1brain=struct_brain --out=epi2struct --fmap=fmap_rads --fmapmag=fmap_mag --fmapmagbrain=fmap_mag_brain --echospacing=0.0005 --pedir=-y

Note that if parallel acceleration is used in the EPI acquisition then the *effective* echo spacing is the actual echo spacing between acquired lines in k-space divided by the acceleration factor.