# Problems when working with both fMRI and dMRI data of HCP

**URL:** <https://community.mrtrix.org/t/problems-when-working-with-both-fmri-and-dmri-data-of-hcp/6500>\
**Category:** Uncategorized\
**Tags:** tractography, preprocessing\
**Created:** [March 14, 2023, 7:43am UTC](https://community.mrtrix.org/t/problems-when-working-with-both-fmri-and-dmri-data-of-hcp/6500 "2023-03-14T07:43:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZackGuo](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/z/b77776/32.png) [@ZackGuo](https://community.mrtrix.org/u/ZackGuo)\
**Post date:** [March 14, 2023, 7:43am UTC](https://community.mrtrix.org/t/problems-when-working-with-both-fmri-and-dmri-data-of-hcp/6500/1 "2023-03-14T07:43:39Z")

</div>

Dear Mrtrix experts,  
I’m processing the fMRI and dMRI data from the HCP project. The voxel sizes of the two modalities are 2 and 1.25, respectively. Both the data I used are minimally preprocessed. I have the following two questions.

1. The fMRI data has been registered to the MNI space but the dMRI data not. I want the dMRI data to also be in MNI space. How can I do?
2. The voxel sizes of fMRI and dMRI data are different, when should I resample the voxel size of the DWI data, before the start of all preprocessing steps, after the preprocessing step or something else?  
Thanks~~~

Best,  
Zack

---

<div class="post-metadata">

**Author:** ![fionaEyoung](https://community.mrtrix.org/user_avatar/community.mrtrix.org/fionaeyoung/32/3826_2.png) [@fionaEyoung](https://community.mrtrix.org/u/fionaEyoung)\
**Post date:** [March 15, 2023, 9:39am UTC](https://community.mrtrix.org/t/problems-when-working-with-both-fmri-and-dmri-data-of-hcp/6500/2 "2023-03-15T09:39:23Z")

</div>

Hello Zack

I’m going to write my answer assuming we’re thinking of the same dataset, namely the [HCP young adult 1200 subjects release](https://www.humanconnectome.org/study/hcp-young-adult/document/1200-subjects-data-release). If not, then you should probably disregard this answer as I don’t know about all the other HCP data releases…

1. The HCP data does include a transform file for registering the dMRI data to MNI space, although it’s not completely obvious. Here are two threads ([files](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122), [transform](https://community.mrtrix.org/t/clarification-on-hcp-mni-nonlinear-warps-and-tcktransform-incorrect-scaling-on-single-axis/2857)) that should help you get your dMRI data into MNI space.

2. The diffusion data is already preprocessed (incl. motion, EPI distortion, eddy current corrections etc.; the [manual](https://www.humanconnectome.org/storage/app/media/documentation/s1200/HCP_S1200_Release_Reference_Manual.pdf) has the exact details), so you shouldn’t need to do any further preprocessing. But in general, resampling should be done after preprocessing, and definitely after `dwidenoise` and `mrdegibbs`.  
If you’re referring to e.g. tensor fitting or running CSD, then I would personally resample the DWI data before any model fitting, but mainly for reasons of storage and processing efficiency (in the current case of _downsampling_ high resolution data). I’ve seen [work specifically justifying _upsampling_ before model fitting](https://www.sciencedirect.com/science/article/pii/S1053811914007472) instead of after, but I don’t know of any scientific considerations about when to downsample…

Hope that’s helpful!  
Fiona

---

<div class="post-metadata">

**Author:** ![ZackGuo](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/z/b77776/32.png) [@ZackGuo](https://community.mrtrix.org/u/ZackGuo)\
**Post date:** [March 22, 2023, 2:28am UTC](https://community.mrtrix.org/t/problems-when-working-with-both-fmri-and-dmri-data-of-hcp/6500/3 "2023-03-22T02:28:13Z")

</div>

Hello Fiona  
I’m sorry for not describing clearly the dataset I used. The dataset I used is [HCP young adult 1200 subjects release](https://www.humanconnectome.org/study/hcp-young-adult/document/1200-subjects-data-release) indeed. Your reply is very helpful for me. Thanks~~~

Zack

---

<div class="post-metadata">

**Author:** ![ZackGuo](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/z/b77776/32.png) [@ZackGuo](https://community.mrtrix.org/u/ZackGuo)\
**Post date:** [March 23, 2023, 8:54am UTC](https://community.mrtrix.org/t/problems-when-working-with-both-fmri-and-dmri-data-of-hcp/6500/4 "2023-03-23T08:54:38Z")

</div>

Hello Fiona

Thanks again for your reply~I still have some confusion When performing the transformation between diffusion space and MNI space according to the [files](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122) you provided.

In the `PreFreeSurfer` section of [HCP Pipelines](https://github.com/Washington-University/HCPpipelines), The [registration](https://github.com/Washington-University/HCPpipelines/blob/655e69b5da61464fbdb985c7e98b933dbf655388/PreFreeSurfer/scripts/AtlasRegistrationToMNI152_FLIRTandFNIRT.sh#L152) from T1w to MNI space generated two files, `acpc2MNILinear.mat` generated by `flirt` and `${OutputTransform} (i.e. acpc_dc2standard.nii.gz)` generated by `fnirt`.

A s far as I know, the file `acpc_dc2standard.nii.gz` only contains non linear transformation, and the linear transformation file is not included in folder `<subject>/MNINonLinear/xfms`. I am not familiar with `HCP Pipelines`, and some understanding may be incorrect…

And I donnot understand ““acpc\_dc”” , so could you please interpret the meaning of the term “acpc\_dc” in the context for me? Thank you again~~~

Finally, I have another [problem](https://community.mrtrix.org/t/extract-roi-time-series/6511), could you please help me resolve it if you have free time? Thanks a lot!!!

Zack

---

<div class="post-metadata">

**Author:** ![fionaEyoung](https://community.mrtrix.org/user_avatar/community.mrtrix.org/fionaeyoung/32/3826_2.png) [@fionaEyoung](https://community.mrtrix.org/u/fionaEyoung)\
**Post date:** [March 24, 2023, 4:06pm UTC](https://community.mrtrix.org/t/problems-when-working-with-both-fmri-and-dmri-data-of-hcp/6500/5 "2023-03-24T16:06:57Z")

</div>

Hello Zack

Just want to make sure I understand your question, did you try using the non-linear registration warps and the result didn’t look good? Or do you only want to do linear registration and not non-linear? Or are you simply trying to understand what’s going on before trying to run the transformation yourself?

In the latter case, if I understand correctly you’re confused about the fact that the T1w-\>MNI registration is broken into two steps (linear + non-linear) and yet you only have access to the output of the non-linear stage…

> [@ZackGuo](#):
>
> A s far as I know, the file `acpc_dc2standard.nii.gz` only contains non linear transformation, and the linear transformation file is not included in folder `<subject>/MNINonLinear/xfms`

I believe that the affine component is incorporated into the final nonlinear transformation warp outputted by `fnirt`, so that you have both steps combined. Admittedly I can’t see that stated explicitly anywhere in the [`fnirt` documentation](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FNIRT/UserGuide#A--aff), but I can only assume that’s the case, since I’ve never had issues applying these warps to non-registered (linear or otherwise) HCP T1 images, and in the HCP pipeline you linked you can see how in subsequent steps, only the warp file (`-w ${OutputTransform}` is used to transform the original input images.

If you want to only do affine registration, then you’ll need to generate those affine transformation matrices yourself (following the pipeline you linked, i.e. only the `flirt` step) if they aren’t included in the HCP data release, which shouldn’t be too difficult since affine registration is generally pretty quick.

> [@ZackGuo](#):
>
> could you please interpret the meaning of the term “acpc\_dc”

ACPC stands for “anterior commissure-posterior commisure” and refers to the native (subject specific) [coordinate system](https://www.fieldtriptoolbox.org/faq/coordsys/) which relates to the line connecting two anatomical landmark. You can think of it as a fancy way of referring to “subject space” (in contrast to a “template space”, such as MNI). My guess is “dc” stands for distortion corrected. In practice this means that as long as all of a subject’s modalities (T1w, MEG, DWI etc.) are co-aligned to the subject specific ACPC coordinate system, then the acpc\_dc2std transformation should apply to all of them.

Fiona
