I worked this out recently, and it is a bit complicated.  Attached is a matlab function that can convert a register.dat file into a proper ras2ras transformation matrix that can be used in matlab.  Be sure to read the help (you need to provide the "optional" input for correct results).

If M is the output of fs_read_regdat, it will be the transformation matrix from the ref image (T1) to the reg image (epi).  So you would do this:

srf_epiVox = M*srfVert


> Date: Mon, 27 Jul 2009 13:05:14 -0400
> From: greve@nmr.mgh.harvard.edu
> To: praneeth.namburi@duke-nus.edu.sg
> CC: freesurfer@nmr.mgh.harvard.edu
> Subject: Re: [Freesurfer] Overlay surface onto EPI
>
> These things are devilish to figure out, but I think I would try this
> instead:
>
> srf_epiVox = inv(vox2ras_epi)*bbregMat*srfVert
>
> doug
>
>
> Praneeth Namburi wrote:
> >
> > Hello Dr. Greve,
> > I used the bbregister tool to register a BOLD EPI volume to the
> > surface with the --init-fsl option. The result looks good in
> > tkregister2. Using the resulting .dat file, I am trying to express the
> > vertex coordinates of the surface in EPI voxel space (EPI volume: 128
> > x 128 x 36 matrix, limits: -64 to 64, -64 to 64 and -18 to 18).
> >
> > Given the following 4x4 matrices,
> > vox2ras_epi : vox2ras transformation matrix from the EPI volume header
> > bbregMat : transformation matrix from the .dat file created from
> > bbregister command
> >
> > Given the vertices of the subject's surface (nVert x 4) : srfVert
> >
> > I used the following transformation to express the surface in EPI
> > voxel coordinates:
> > srf_epiVox = srfVert * inv(bbregMat) * inv(vox2ras_epi)
> >
> > When I view the results of this transformation in MATLAB, I can see
> > that the above expression is incorrect. I used imagesc to show one
> > slice of EPI and scatter to plot of all the vertices in that slice.
> >
> > Can you please let me know what the mistake is? Am I applying the
> > transformation in an incorrect coordinate space? Am I missing any
> > transformations?
> >
> > Looking forward for your reply. Thank you.
> >
> > Yours Sincerely,
> > Praneeth
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Freesurfer mailing list
> > Freesurfer@nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
> --
> Douglas N. Greve, Ph.D.
> MGH-NMR Center
> greve@nmr.mgh.harvard.edu
> Phone Number: 617-724-2358
> Fax: 617-726-7422
>
> In order to help us help you, please follow the steps in:
> surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
>
>
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. Check it out.