# HCP Diffusion pipeline ````{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). Note that for the HCP-supported pipelines to run the DWI data should be acquired in 'pairs' of phase encoding reversed images. As described in detail by Glasser and colleagues, the steps of the diffusion preprocessing pipeline are: * After b0 intensity normalization, the b0 images of both phase encoding directions are used to calculate the susceptibility-induced B0 field deviations. * The full timeseries from both phase encoding directions is used in the “eddy” tool for modeling of eddy current distortions and subject motion. * Gradient distortion is corrected and the b0 image is registered to the T1w image using BBR. * The diffusion data output from eddy are then resampled into 1.25 mm native structural space and masked. * Diffusion directions and the gradient deviation estimates are also appropriately rotated and registered into structural space. In QuNex the HCP pipeline is run using the `hcp_diffusion` command. The full list of command's parameters along with example calls can be found at [`hcp_diffusion`](../../api/gmri/hcp_diffusion.rst).