Alternatively, is it possible to pass bbregister a different target volume that's in register with the surfaces?

On Thu, Aug 17, 2017 at 6:10 PM, Michael Waskom <mwaskom@nyu.edu> wrote:
Hi Doug,

I'd like to use the registration matrix from bbregister to transform functional data into a cropped FOV that corresponds with the anatomy.

I thought that bbregister outputs a ras2ras transform, so if I could crop the anatomical volume with a correct header vox2ras, things should be fine. Is my thinking here wrong?

Here is roughly what I have done:

1. Generate a registration matrix to the full anatomy

bbregister --s subj --mov func.nii --reg reg.dat --t2

2. Crop the anatomy:

mri_convert brain.mgz brain.nii
fslroi brain.nii brain_crop.nii 50 150 50 150 50 150

(I know this is an fsl tool but I couldn't find an option to do exactly this in mri_convert)

3. Check the output -- looks fine so far

tkregister2 --mov brain-crop.nii --regheader --s subj --surfs --reg /dev/null

4. Resample the functional volume

mri_vol2vol --mov func.nii --targ brain_crop.nii --reg reg.dat --o func_xfm.nii

5. Check the output

tkregister2 --mov func_xfm.nii --regheader --s subj --surfs --reg /dev/null

The resulting functional image is shifted superior about ~20cm

What am I missing in my understanding of the bbregister and header transformation matrices?

Thanks!
Michael