# HCP deformation files for registration in MNI template

**URL:** <https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122>\
**Category:** Uncategorized\
**Created:** [October 18, 2022, 12:03pm UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122 "2022-10-18T12:03:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TommasoGerussi](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/51bf81/32.png) [@TommasoGerussi](https://community.mrtrix.org/u/TommasoGerussi)\
**Post date:** [October 18, 2022, 12:03pm UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/1 "2022-10-18T12:03:14Z")

</div>

Dear MRtrix community,

I created with MRtrix a template FOD from a dataset of 5 subjects taken from the HCP, and I also have an MNI template of 2mm. I would like to register the FOD and the tck files already created to the MNI space but following this guide [Warping FOD and tck files to MNI template](https://community.mrtrix.org/t/warping-fod-and-tck-files-to-mni-template/2049) I discovered there are 2 files (standard2acpc\_dc.nii.gz and acpc\_dc2standard.nii.gz) which I don’t find in their website.

Can some of you kindly send me those files via email/wetranfer or suggest to me the link where I can download them?

Thanks a lot.

Tommaso

---

<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:** [October 19, 2022, 10:30am UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/2 "2022-10-19T10:30:47Z")

</div>

Hi Tommaso

They’re a bit tricky to find, but those files should be available in the folder `<subject>/MNINonLinear/xfms`:

```bash
$ aws s3 ls s3://hcp-openaccess/HCP_1200/111009/MNINonLinear/xfms/         
2018-08-16 11:24:53 3013206 NonlinearRegJacobians.nii.gz
2018-08-16 11:24:53 9761230 acpc_dc2standard.nii.gz
2018-08-16 11:24:53 8777653 standard2acpc_dc.nii.gz

```

(I use [aws](https://wiki.humanconnectome.org/display/PublicData/How+To+Connect+to+Connectome+Data+via+AWS) to access HCP data from the command line, but you should be able to see the same directory structure in the online download interface)

hope that helps!

Fiona

---

<div class="post-metadata">

**Author:** ![TommasoGerussi](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/51bf81/32.png) [@TommasoGerussi](https://community.mrtrix.org/u/TommasoGerussi)\
**Post date:** [October 20, 2022, 3:06pm UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/3 "2022-10-20T15:06:16Z")

</div>

Hi Fiona,

Thanks a lot for your help! I found the files you meant following your suggestion but I thought these files were not present in each subject but one general which summarized all the data. Because I tried to follow the steps for the registration of both tracts and FOD to MNI but doesn’t work at all 😕 maybe i am doing something wrong.

THanks again

Tommaso

---

<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:** [October 20, 2022, 3:29pm UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/4 "2022-10-20T15:29:26Z")

</div>

> [@TommasoGerussi](#):
>
> one general which summarized all the data.

Hmm, I’m not sure what you mean by this I’m afraid.

> [@TommasoGerussi](#):
>
> I tried to follow the steps for the registration of both tracts and FOD to MNI but doesn’t work at all

Could you be more specific about how it doesn’t work? Are there errors or the results just don’t look right? There’s another thread [here](https://community.mrtrix.org/t/clarification-on-hcp-mni-nonlinear-warps-and-tcktransform-incorrect-scaling-on-single-axis/2857) about trying to use those transformation files, does that look like the same problem you are facing? If so, the [solution](https://community.mrtrix.org/t/clarification-on-hcp-mni-nonlinear-warps-and-tcktransform-incorrect-scaling-on-single-axis/2857/5) at the end of the thread might help you 🙂

---

<div class="post-metadata">

**Author:** ![StarVolcano](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@StarVolcano](https://community.mrtrix.org/u/StarVolcano)\
**Post date:** [November 3, 2022, 3:20pm UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/5 "2022-11-03T15:20:31Z")

</div>

Hi Fiona,

I also faced this problem.  
Thanks for your guidance, I checked the topic you recommended, however, I found that the solution mentioned may not be adaptable from now on.  
I ran the command and got the error below:

```auto
mrconvert standard2acpc_dc.nii.gz tmp-[].nii -force
zsh: no matches found: tmp-[].nii

```

Have you met this problem? How do you solve it?

In my opinion, this command aims to separate the standard2acpc\_dc.nii.gz into three temporary nii each contains one axis. So I try running the following commands to do the same(just my thought…) thing.

```auto
mrconvert standard2acpc_dc.nii.gz -coord 3 0 -axes 0,1,2 tmp_1.nii
mrconvert standard2acpc_dc.nii.gz -coord 3 1 -axes 0,1,2 tmp_2.nii
mrconvert standard2acpc_dc.nii.gz -coord 3 2 -axes 0,1,2 tmp_3.nii

mv tmp_1.nii x.nii
mrcalc x.nii -neg tmp_1.nii -force
mrcat tmp_?.nii tmp.nii
warpconvert tmp.nii displacement2deformation mni2acpc_mrtrix.nii.gz -force
rm x.nii tmp_?.nii

tcktransform fibs_1M_act_sift.tck mni2acpc_mrtrix.nii.gz fibs_1M_act_sift_MNI.tck

```

If we just assess the result, I think it makes sense. However, I’m not sure whether it’s an appropriate method.

I’d appreciate if you could provide some comments.

Best,  
Volcano

---

<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:** [November 3, 2022, 3:31pm UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/6 "2022-11-03T15:31:06Z")

</div>

> [@StarVolcano](#):
>
> I ran the command and got the error below:
> 
> ```auto
> mrconvert standard2acpc_dc.nii.gz tmp-[].nii -force
> zsh: no matches found: tmp-[].nii
> 
> ```
> 
> Have you met this problem? How do you solve it?

OK, this is due to macOS deciding to move to the `zsh` shell, rather than the default `bash` shell found in most other flavours of Unix (and previous version of macOS). We just need to ‘tell’ `zsh` not to try to interpret the square brackets, which should hopefully be possible with a simple pair of inverted commas:

```auto
mrconvert standard2acpc_dc.nii.gz 'tmp-[].nii' -force

```

---

<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:** [November 3, 2022, 3:44pm UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/7 "2022-11-03T15:44:23Z")

</div>

yep, while I do love `zsh` the nomatch behaviour is très annoying. You can disable it with

```bash
setopt +o nomatch
# To revert change:
#setopt -o nomatch  

```

and then the `-[]` syntax should work as-is. (This will affect other globbing behaviours you may or may not be used to so worth reading up to be sure.) Or use quotes as Donald suggests.

In any case, your workaround looks fine to me 🙂

---

<div class="post-metadata">

**Author:** ![StarVolcano](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@StarVolcano](https://community.mrtrix.org/u/StarVolcano)\
**Post date:** [November 4, 2022, 1:50am UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/8 "2022-11-04T01:50:20Z")

</div>

Thanks for your simple and effective solution!  
I did ignore that the error is about `zsh`, next time I’ll check more carefully.

---

<div class="post-metadata">

**Author:** ![StarVolcano](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@StarVolcano](https://community.mrtrix.org/u/StarVolcano)\
**Post date:** [November 4, 2022, 1:59am UTC](https://community.mrtrix.org/t/hcp-deformation-files-for-registration-in-mni-template/6122/9 "2022-11-04T01:59:08Z")

</div>

Thanks for your quick reply and for sharing your solution!  
I tried your and Dr.Tournier’s solution, and both of them works.
