# Diffusion weighted imaging (DWI) 'legacy' data preprocessing ````{admonition} Prerequisites * [HCP PreFreeSurfer](../UsageDocs/HCPPreFreeSurfer) ```` For all HCP pipeline steps please refer to [Running the HCP pipeline](../UsageDocs/RunningPreprocessHCP). For an overview on how to prepare data and run the HCP preprocessing steps, see [Overview of steps for running the HCP pipeline](../UsageDocs/HCPPreprocessing). ## Overview Prior to [DWI analyses](../UsageDocs/DWIAnalyses), DWI data must be preprocessed. For multi-shell phase-encoding reversed DWI data please refer to the [HCP preprocessing via QuNex](../UsageDocs/HCPPreprocessing "QuNex HCP workflow"). If the DWI data has not been phase-encoding reversed and/or is missing a field map (i.e. pre-HCP 'legacy' acquisitions), then use the [`dwi_legacy_gpu`](../../api/gmri/dwi_legacy_gpu.rst) command. Specifically, this workflow is a modification of `hcp_diffusion` that is compatible with 'legacy' data, which have been acquired without a pair of phase-encoding direction reversed images. `dwi_legacy_gpu` runs a modified version of the [HCP Diffusion preprocessing pipeline](http://www.sciencedirect.com/science/article/pii/S1053811913005053 "Glasser, 2013"), using the "[eddy](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/eddy "FSL: eddy")" tool to correct for eddy-current induced field inhomogeneities and head motion, and skipping the "[topup](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup "FSL: topup")" step performed in `hcp_diffusion` which would require a pair of phase-encoding reversed images. ````{admonition} Prerequisites * `dwi_legacy_gpu` can be run after completion of the [`hcp_pre_freesurfer`](../../api/gmri/hcp_pre_freesurfer.rst) command, and may be run before FreeSurfer (see instructions here for [HCP preprocessing via QuNex](../UsageDocs/HCPPreprocessing "QuNex HCP workflow")). * At minimum, the pipeline requires a native-space DWI image (single-shell or multi-shell) and a corresponding T1w image, both organized in the standard HCP file hierarchy within the individual session directories (see [Data Hierarchy Specification](../Overview/DataHierarchy)) * For data collected on a Siemens scanner, a standard set of fieldmap images (magnitude and phase) can be used to better correct for field inhomogeneity distortion. However, if fieldmaps are missing the command will omit them. ```` For detailed instructions on how to use the listed commands, please refer to their online help (by visiting [`dwi_legacy_gpu`](../../api/gmri/dwi_legacy_gpu.rst)) or embedded help (e.g. by running `qunex dwi_legacy_gpu`). For information on other aspects of preprocessing, or for non-legacy DWI data, please consult the [HCP preprocessing](../UsageDocs/HCPPreprocessing "HCP preprocessing workflow") page.