# Beginner: Connectome pipeline (MRtrix3, FSL and Freesurfer)

**URL:** <https://community.mrtrix.org/t/beginner-connectome-pipeline-mrtrix3-fsl-and-freesurfer/981>\
**Category:** Uncategorized\
**Created:** [June 19, 2017, 3:48am UTC](https://community.mrtrix.org/t/beginner-connectome-pipeline-mrtrix3-fsl-and-freesurfer/981 "2017-06-19T03:48:35Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [July 6, 2017, 2:54pm UTC](https://community.mrtrix.org/t/beginner-connectome-pipeline-mrtrix3-fsl-and-freesurfer/981/6 "2017-07-06T14:54:42Z")

</div>

> [@SuperClear](#):
>
> > I note you don’t perform any correction for EPI distortions, yet use the ACT option for tckgen.
> 
> As I think dwipreproc is used to do inhomogeneity distortion correction，which is include EPI distortion. Do I misunderstand it? or I need to use FSL tool fugue to do EPR distortion correction?

`dwipreproc` _can_ be used for EPI distortion correction if supplied with matching reversed phase-encoded EPI images - this is done using [FSL’s TOPUP](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup). It looks like you don’t have suitable data for this step, and furthermore you pass the `-rpe_none` option to `dwipreproc`, which explicitly disables EPI distortion correction.

> [@SuperClear](#):
>
> what does PhaseEncodingDirection: j- mean? Does it mean all the DWI volumes are with reversed phase encode?

Well, it means all your data were acquired with the phase encode direction running along the negative _y_ axis. But what we mean when we talk of reversed phase encode images is the available of images acquired with the opposite phase encode direction to the rest of the DWI data. That would generally be a separate set of images to the main DWI series.

> [@SuperClear](#):
>
> > These nodes are anatomical parcellations based on the Deskian/Killiany atlas (by default) - there’s nothing ‘functional’ about them (?). Also not sure why you need to calculate their coordinates…? The streamlines are stored in the real/scanner/world coordinates already (?)
> 
> as shown in figure 16 to merge the node and streamline together. I want to know what the corresponding coordinates of the nodes, for I find some researchers have used the similar nodes ,and I want to repeat their work.

OK, my point was that these nodes are not defined on the basis of functionality. If you want the node coordinates, maybe the simplest thing is to generate an image of the coordinates of each voxel (you can use `warpinit` for that), and then measure the mean value within your node ROI. This depends on your ROI being a binary mask, rather than an image of integer labels. But you can convert it to a binary image using `mrcalc`.

To provide an example of what I mean, assuming your parcellation is an image of labels, and you want to extract the mean position for node index 15, first generate an image of voxel positions (you only need to do this once):

```
warpinit nodes_image.nii positions.mif

```

then compute the mean value of these positions within the voxels that have value 15:

```
mrcalc nodes_image.nii 15 -eq - | mrstats positions.mif -mask - -output mean

```

(above not tested, but hopefully close enough as a starting point…)

---

_[View the full topic](https://community.mrtrix.org/t/beginner-connectome-pipeline-mrtrix3-fsl-and-freesurfer/981)._
