The main motivation for this function is to cross-check BrainVoyager's registration quality with that of SPM (once again cross-checked with manual inspection, of course).
For this function to work, either SPM5 or SPM8 must be available on the path. For SPM8, it is important that all required subfolders (e.g. matlabbatch, etc.) are already on the path. If in doubt, use
spm fmri prior to calling this function (this call adds all required sub-folders of SPM to the path).
Also, Matlab must have write access to the temporary folder (on Unix-ish systems, that usually is
/tmp) to write out the VMRs as Analyze files.
W.r.t. to the VMRs, you must have two objects loaded which you want to bring into the same space (whereas the reference/secondary VMR is the stationary one!)
vmrspmcoreg - apply SPM's coregistration to two VMRs FORMAT: vmrtrf = vmrspmcoreg(srcvmr, refvmr) Input fields: srcvmr VMR to coregister (primary VMR) refvmr reference (stationary/secondary VMR) Output fields: vmrtrf BV compatible TRF object
These are the steps taken by vmrspmcoreg:
For an example, check the reference page of vmr.ApplyTRF, which also explains how to then apply the obtained TRF object to actually re-sample the source VMR into the target space.