I think there is a bug with the post_matrix option in the align_epi_anat.py script. I kept getting an error with the subroutine 'align_epi2anat' that said 'str' object had no input attribute, when it was trying to apply the concatenated transformation to the epi, so I changed it starting at line 1637 from :
if(ps.tlrc_apar!=""):
tlrc_dset = afni_name("%s_tlrc%s" % (self.epi.out_prefix(), suf))
tlrc_dset.view = '+tlrc'
if tlrc_dset.exist():
tlrc_dset.delete(ps.oexec)
atlrcpost = tlrc_dset
self.info_msg("Applying transformation of epi to anat tlrc parent")
else:
tlrc_orig_dset = afni_name("%s_post%s" % (self.epi.out_prefix(), suf))
tlrc_orig_dset.view = '+orig'
if tlrc_orig_dset.exist():
tlrc_orig_dset.delete(ps.oexec)
atlrcpost = tlrc_orig_dset
self.info_msg("Applying post transformation matrix to epi");
com = shell_com( \
"3dAllineate -base %s -1Dmatrix_apply %s " \
"-prefix %s -input %s -verb %s" % \
( ps.tlrc_apar.input(), epi_mat, atlrcpost.input(), e.input(),\
ps.master_tlrc_option), ps.oexec)
com.run()
to instead:
if(ps.tlrc_apar!=""):
tlrc_dset = afni_name("%s_tlrc%s" % (self.epi.out_prefix(), suf))
tlrc_dset.view = '+tlrc'
if tlrc_dset.exist():
tlrc_dset.delete(ps.oexec)
atlrcpost = tlrc_dset
self.info_msg("Applying transformation of epi to anat tlrc parent")
com = shell_com( \
"3dAllineate -base %s -1Dmatrix_apply %s " \
"-prefix %s -input %s -verb %s" % \
( ps.tlrc_apar.input(), epi_mat, atlrcpost.input(), e.input(),\
ps.master_tlrc_option), ps.oexec)
else:
tlrc_orig_dset = afni_name("%s_post%s" % (self.epi.out_prefix(), suf))
tlrc_orig_dset.view = '+orig'
if tlrc_orig_dset.exist():
tlrc_orig_dset.delete(ps.oexec)
atlrcpost = tlrc_orig_dset
self.info_msg("Applying post transformation matrix to epi");
com = shell_com( \
"3dAllineate -1Dmatrix_apply %s " \
"-prefix %s -input %s -verb %s" % \
( epi_mat, atlrcpost.input(), e.input(),\
ps.master_tlrc_option), ps.oexec)
com.run()
so that it wouldn't try to use any talairach base set in the 3dAllineate step, if you were just doing a post_matrix transformation, and that worked.
Matt