If you’re doing ECOG, you might consider using the ALICE package that uses AFNI to align CT and MRI. Basically it’s the same method as yours except the MRI is inverted first to help make the MRI skull match the CT skull better. The thin dark layer in a T1-weighted dataset is actually the skull, and the skull is one of the few clearly identifiable structures in the CT. If the data header is correct, and the data is not distorted, then the -rigid_body option you used is one I would also recommend. The image shows some distortion on the CT, so I would check on that. The feature_size for the nmi cost function effectively controls the blurring radius (feature_size*2) for the first pass of the alignment. The default in align_epi_anat.py/3dAllineate without settings would be about 11mm radius.
https://doi.org/10.1016/j.jneumeth.2017.10.022
#!/bin/tcsh
mask the T1 mri
3dAutomask -prefix mri_am -dilate 5 -clfrac 0.35 anat+orig.
get the maximum value from the T1 dataset
set max = 3dBrickStat -max anat+orig.
invert values in the dataset 0-max → max-0
3dcalc -a anat+orig. -b mri_am+orig. -expr “step(b)*($max-a)” -prefix mri_rev
align MRI and CT
align_epi_anat.py -dset1 mri_rev+orig -dset2 CT.nii.gz -cost nmi -suffix _al2mri_rigid
-dset1_strip None -dset2_strip None -giant_move -rigid_body -dset2to1