Coregistrtaion of Freesurfer output and diffusion image

Hi Sisimo,

I use epi_reg for this purpose… I’ve found that using the white-matter-mask option helps :slight_smile: It also runs relatively quickly.

I don’t know how it compares to the ANTs method (@smeisler thanks for sharing your code - I haven’t tried this, yet, but it is always good to have options going forward :smiley: )

Here is some code that might be useful. Note that in this example, the MeanB0 is registered to the T1, and the inverse transformation is applied to transform the T1 to DWI space.

If you (or anyone else) does end up testing both epi_reg and the ANTs, I’d be interested in comparing the results of the two transformations (and maybe even adding in other registration techniques?)

# Register MeanB0 to T1 to obtain transformation matrix
epi_reg \
	--epi=${meanB0} \
	--t1=${T1_nifti} \
	--t1brain=${T1brain_nifti} \
	--wmseg=${WMseg_nifti} \
	--out=${reg_dir}MeanB0_warp.nii.gz

# convert transformation matrix to mrtrix
transformconvert ${reg_dir}MeanB0_warp.mat ${meanB0} ${T1brain_nifti} flirt_import ${reg_dir}transform_mrtrix.txt -force

# # Transform anatomical images #
mrtransform ${T1brain_nifti} ${RegisteredAnat} \
	-linear ${reg_dir}transform_mrtrix.txt \
	-inverse \
	-strides $meanB0 \
	-force

Hope this helps!

Cheers,
Arkiev