Dear MRtrix-Experts,
Hello,
I am trying to register the Schaefer2018 template to DWI data, with T1-weighted images (1x1x1 mm) and DWI (2x2x2 mm).
I followed this method to register T1w to DWI. Then I registered the 2x2x2 Schaefer atlas to the T1w image and applied the T1w-to-DWI transformation to the atlas. However, the atlas was upsampled to 1x1x1 mm during atlas-to-T1w registration, and applying the T1w-to-DWI transformation kept the 1x1x1 resolution, resulting in an atlas incompatible with the DWI data.The script can be found in the T1 preprocessing and Parcellation registraion below.
Could anyone kindly provide suggestions on how to resolve this issue? Additionally, I’ve attached the full script below for your reference. Please let me know if there are any corrections or improvements I should make to the workflow.
Any advice would be greatly appreciated. Thank you in advance!
Best regards,
Changwen
My full script is as follows.
DWI preprocessing
mrconvert data.nii dwi.mif -fslgrad bvecs bvals -datatype float32 -info -nthreads 72
dwi2mask dwi.mif - | maskfilter - dilate DWI_mask.mif -nthreads 72 -npass 3 -force -info
dwidenoise dwi.mif dwi_denoised.mif -mask DWI_mask.mif -nthreads 72
mrdegibbs dwi_denoised.mif dwi_denoised_unringed.mif -nthreads 72
dwifslpreproc dwi_denoised_unringed.mif dwi_denoised_unringed_preproc.mif -pe_dir AP -rpe_none -eddy_options " --slm=linear " -nthreads 72
dwibiascorrect ants dwi_denoised_unringed_preproc.mif DWI_bias_ants.mif -bias bias_ants_field.mif -nthreads 72 -force -info
dwiextract DWI_bias_ants.mif - -bzero | mrmath - mean meanb0.nii.gz -axis 3 -force -info
T1 preprocessing
robustfov -i T1.nii -r T1_crop.nii.gz
bet T1_crop.nii T1_brain.nii.gz -R -S
flirt -in meanb0.nii.gz -ref T1_brain.nii.gz -dof 6 -omat tmp.mat
fast -t 1 -n 3 -o structural T1_brain.nii.gz
fslmaths structural_pve_2.nii.gz -thr 0.5 -bin structural_WMseg.nii.gz
flirt -in meanb0.nii.gz -ref T1_brain.nii.gz -dof 6 -cost bbr -wmseg structural_WMseg.nii.gz -init tmp.mat -omat diff_to_structural-bbr.mat -schedule $FSLDIR/etc/flirtsch/bbr.sch
transformconvert diff_to_structural-bbr.mat meanb0.nii.gz T1_brain.nii.gz flirt_import diff_to_structural-bbr-mrtrixformat.txt
mrtransform T1_crop.nii.gz -linear diff_to_structural-bbr-mrtrixformat.txt T1_realign.nii.gz -inverse -interp nearest
mrconvert T1_realign.nii.gz T1.mif
Parcellation registraion
flirt -in T1_brain.nii.gz -ref $FSLDIR/data/standard/MNI152_T1_2mm_brain.nii.gz -dof 12 -out T1toMNIlin.nii.gz -omat T1toMNIlin.mat
fnirt --ref=MNI152_T1_2mm --in=T1_brain.nii.gz --aff=T1toMNIlin.mat --config=T1_2_MNI152_2mm.cnf --iout=T1toMNInonlin.nii.gz --cout=T1toMNI_coef.nii.gz --fout=T1toMNI_warp.nii.gz
invwarp --ref=T1_brain.nii.gz --warp=T1toMNI_warp.nii.gz --out=MNItoT1_warp.nii.gz
applywarp --ref=T1_brain.nii --in=/mnt/Project/template/Schaefer2018_400Parcels_7Networks_order_FSLMNI152_2mm.nii.gz --warp=MNItoT1_warp.nii.gz --out=ind_node7_T1.nii.gz --interp=nn
mrtransform ind_node7_T1.nii.gz -linear diff_to_structural-bbr-mrtrixformat.txt ind_node7_dwi.nii.gz -inverse
mrgrid ind_node7_dwi.nii.gz regrid -voxel 2,2,2 ind_node_resampled.nii.gz -interp nearest -datatype int32
mrconvert ind_node_resampled.nii.gz ind_node7.mif
FOD and Tractography
5ttgen fsl T1.mif 5tt_coreg.mif -nthreads 72
5tt2gmwmi 5tt_coreg.mif gmwmSeed.mif -nthreads 72
dwi2response dhollander DWI_bias_ants.mif response_wm.txt response_gm.txt response_csf.txt -voxels RF_voxels.mif -nthreads 72 -force -info
ss3t_csd_beta1 DWI_bias_ants.mif response_wm.txt wmfod.mif response_gm.txt gm.mif response_csf.txt csf.mif -mask DWI_mask.mif -nthreads 72 -force -info
mtnormalise wmfod.mif wmfod_norm.mif -mask DWI_mask.mif -check_norm mtnormalise_norm.mif -check_mask mtnormalise_mask.mif -nthreads 72 -force -info
tckgen -act 5tt_coreg.mif -backtrack -seed_gmwmi gmwmSeed.mif -nthreads 72 -minlength 30 -maxlength 250 -cutoff 0.06 -select 20M wmfod_norm.mif tracks_20M.tck
tcksift2 -act 5tt_coreg.mif -out_mu sift_mu_20M.txt -out_coeffs sift_coeffs_20M.txt -nthreads 72 tracks_20M.tck wmfod_norm.mif sift_20M.txt
connectome
tck2connectome -force -symmetric -zero_diagonal -nthreads 72 -assignment_radial_search 2 -scale_invnodevol -tck_weights_in sift_20M.txt tracks_20M.tck ind_node7.mif sc.csv -out_assignment assignments_20M_node_7_20.csv