Applywarp issue with dHCP release 2.0

Hi all,

I have been having troubles to use the warp fields provided with the second dHCP release. For instance, when using applywarp to register the T1w images to the 40wk GA template image:

applywarp -i sub-CC00060XX03_ses-12501_desc-restore_space-T2w_T1w.nii.gz -o T1_warped -r ~/dHCP/Templates/40wk_ga/template_t2.nii.gz -w …/xfm/sub-CC00060XX03_ses-12501_from-T2w_to-template40wk_mode-image.nii.gz

I will get the following result:

I have downloaded the template file from here:

Many thanks,


Continuing the discussion from Applywarp issue with dHCP release 2.0:

Hi Arash

I presume you are using the warp generated by the structural pipeline:


If so, I can replicate the problem you are seeing. I will contact the structural pipeline team for advice.

In the interim, you can use the warp generated by the fMRI pipeline:


This works fine with applywarp:

applywarp -i derivatives/dhcp_anat_pipeline/sub-{subid}/ses-{subid}/anat/sub-{subid}_ses-{subid}_desc-restore_T2w.nii.gz -o T2_warped -r template_t2.nii.gz -w derivatives/dhcp_fmri_pipeline/sub-{subid}/ses-{subid}/xfm/sub-{subid}_ses-{subid}_from-T2w_to-template40wk_mode-image.nii.gz

Cheers, Sean

Hi, thank you for providing the workaround Sean.

I’ve started looking into this from the struct pipeline point of view.

I also see the problem with this example. I’ve tried FSL5, FSL6 and different versions of the atlas, and the origin always ends up in the wrong place (as you say).

I’m currently rerunning the pipeline for this subject so I can see all of the temporary files. Hopefully I can then trace back and see at what point the error occurs.


Hello Seanfits,

Just to clarify your previous response:
The functional pipeline’s file sub- ses- from-T2w to-template40wk mode-image.nii.gz is not necessarily the same as the file in the structural pipeline, and they might be different?

And another question about this file:
This transformation (in either functional or structural pipeline) is not a straight transformation from native space to 40W, and it’s equivalent to a transformation from native space to subject’s age_template, followed by a transformation from the subject’s age_template to 40W template. Is that correct?

Best Regards,

Hi @Roxana_Namiranian,

I will leave the first question to @seanfitz but I can answer the second. Yes, the align_to_template script at @EmmaR’s GitHub here first registers the native subject surface to a local template. Then using wb_command -surface-sphere-project-unproject, the subject surface in local template space is registered to the 40-week template. I should state that this is only for the warps available as part of the third release only.

Best wishes,


1 Like

Hi @Roxana_Namiranian

They will be different.

The warp in the structural pipeline is named xfm/sub-{subid}_ses-{sesid}_from-T2w_to-serag40wk_mode-image.nii.gz and it aligns the native T2w space with the Serag atlas:

The warp in the functional pipeline is named sub-*_ses-*_from-T2w_to-extdhcp40wk_mode-image.nii.gz and it aligns the native T2w space with the extended dHCP volumetric atlas:

cheers, Sean

@lzjwilliams and @seanfitz
I appreciate your help. Thank you.