To follow up on my previous question, can it be that the obliquety causes this problem?
And to ask a more general question: how can I transform freesurfer surfaces to the original EPI space?. For some reason I do not get the surface in the original space; it's slightly off (in a similar way as the nifti files).
In short, I took the following steps:
1) align anatomical (anat+orig) to epi using align_epi_anat.py, resulting in anat_al+orig
2) convert anat_al+orig to .nii and then to .mgh, then do surface reconstruction and do suma file conversion.
3) run 3dAllineate with anat_al+orig and the SurfVol+orig and save the affine transformation matrix
4) apply the transformation matrix to the original surface (.e.g lh.pial.asc) with ConvertSurface -xmat, resulting in lh.pial_lh.asc.
The original surface and SurfVol are perfectly aligned, but the aligned surface (lh.pial_lh.asc) and volume (anat_al+orig) are not aligned. I thought that maybe the ALLINEATE_MATVEC_{B2S,S2B}_000000 matrices are responsible, thus tried to remove these and incorporate it in IJK_TO_DICOM_REAL, using:
anatin="anat_al"
anatout="${anatin}_nob2s"
cat_matvec ${anatin}+orig::ALLINEATE_MATVEC_B2S_000000 ${anatin}+orig::IJK_TO_DICOM_REAL >al_ijk2d.aff12.1D
rm ${anatout}+orig.????
3dcopy -overwrite ${anatin}+orig $anatout
id="1 0 0 0 0 1 0 0 0 0 1 0"
transform=`cat al_ijk2d.aff12.1D`
3drefit -atrfloat IJK_TO_DICOM_REAL "${transform}" -atrfloat ALLINEATE_MATVEC_B2S_000000 "${id}" -atrfloat ALLINEATE_MATVEC_S2B_000000 "${id}" ${anatout}+orig
which causes the anat_al_nob2s file and anat_al to perfectly overlap; however, applying step 3 using anat_al_nob2s does not work for the surfaces either. Any ideas what transformation to apply to the freesurfer surface files to align them with the original EPIs?
any help would be highly appreciated!
Nick