@SUMA_AlignToExperiment alignment not working well

Hi there,

I am trying to align my SurfVol to my experimental anatomy but I just can’t get it to fit well enough. This is despite me nudging the SurfVol for a long time and getting it very close to the experimental anatomy.

The imaged I attached is as good as I can get (underlay: experimental anatomical (aligned to epi); overlay: SurfVol (aligned to experimental anatomy))

Background: The experimental anatomy has been aligned to my epi data (7T, partial FOV/ slab). I made my own whole brain anatomy (full field of view) with skull using 3dAllineate as afni_proc.py gives you a skull-free partial FOV anatomical when you align it to partial epi data.

To improve alignment, my colleague suggested to use a SurfVol with the skull on, but I can’t see any options in @SUMA_Make_Spec to allow this. Is this possible?

I also saw in this (https://afni.nimh.nih.gov/pub/dist/edu/latest/suma/suma.pdf) that one option if your alignment to experiment fails is to use 3dTagalign but I can’t quite work out what options I need.

I was also wondering if I could use 3dAllineate with the transformation matrix I used to align my experimental anatomy with the epi data in some way?

I have pasted my code below. Any help would be very much appreciated.

Note: the -wd flag always makes it much worse, makes SurfVol big and warped

[b]Step 1. Creating whole-brain warped experimental anatomical[b]

Create full coverage, skull on, warped anatomical

3dZeropad -I 100 -S 100 -A 100 -P 100 -L 50 -R 120
-prefix rm.{$raw_anat_name}_wholebrain_padded+orig
$raw_anat_dir/{$raw_anat_name}{$raw_anat_ext}

gunzip rm.{$raw_anat_name}_wholebrain_padded+orig.BRIK.gz

3dAllineate -source rm.{$raw_anat_name}_wholebrain_padded+orig
-final wsinc5
-1Dmatrix_apply $mat_dir/$mat_name
-prefix rm.{$raw_anat_name}_wholebrain_padded_warped+orig

gunzip rm.{$raw_anat_name}_wholebrain_padded_warped+orig.BRIK.gz

Remove excess

3dZeropad -I -0 -S -0 -A -180 -P -60 -L -200 -R -0
-prefix {$raw_anat_name}_wholebrain_unpad_warped+orig
rm.{$raw_anat_name}_wholebrain_padded_warped+orig

[b]Step 2. Align SurfVol to experimental anatomy[b]

Zeropad SurfVol

3dZeropad -I 20 -S 20 -A 20 -P 20 -L 0 -R 100
-prefix rm.{$surf_subj_num}_{$subj_init}SurfVol_padded
rm.{$surf_subj_num}
{$subj_init}_SurfVol+orig

Then open it and nudge it towards the location of the anatomical

Create a nudged surfvol in the experimental folder

3drotate -quintic -clipit -rotate 6.47I 7.64R 35.43A -ashift -3.45S -81.29L -16.76P -prefix rm.{$surf_subj_num}_{$subj_init}SurfVol_padded_nudged rm.{$surf_subj_num}{$subj_init}_SurfVol_padded+orig

Make transformation matrix

cat_matvec ‘rm.’{$surf_subj_num}‘_’{$subj_init}‘_SurfVol_padded_nudged+orig::ROTATE_MATVEC_000000’ -I
> XFORM0.1D

Use this nudged surfvol to create the surfvol aligned to experiment in next step

======================= surf (map data to surface) =======================

map EPI data to the surface domain

align the surface anatomy with the current experiment anatomy

@SUMA_AlignToExperiment
-init_xform XFORM0.1D -align_centers
-surf_anat rm.{$surf_subj_num}_{$subj_init}_SurfVol_padded+orig
-exp_anat $exp_anat
-prefix {$subj}_SurfVol_Alnd_Exp_xform2

[b]Other Step 2 attempts that did not work either[b]

wd flag

@SUMA_AlignToExperiment -exp_anat $exp_anat \

-surf_anat rm.{$surf_subj_num}_{$subj_init}_SurfVol_padded_nudged2+orig \

-align_centers \

-wd -EA_clip_below -80 \

-atlas_followers -overwrite_resp S \

-prefix {$subj}_SurfVol_Alnd_Exp_wd_EAclip

Basic version

Removed -align_centres

@SUMA_AlignToExperiment -exp_anat $exp_anat \

-surf_anat rm.{$surf_subj_num}_{$subj_init}_SurfVol_unpadded_nudged2+orig \

-atlas_followers -overwrite_resp S \

-prefix {$subj}_SurfVol_Alnd_Exp_2_unpad_no_al_centres

Old commands generated by afni_proc - don’t work

@SUMA_AlignToExperiment -exp_anat $exp_anat \

-surf_anat $surface_dir/P0{$surf_subj_num}_{$subj_init}_SurfVol+orig \

-wd -strip_skull surf_anat \

-atlas_followers -overwrite_resp S \

-prefix ${surf_subj_num}_SurfVol_Alnd_Exp

Update (in case anyone is having the same problem)

SurfVols should have skull on by default. The one I was working with did not (I inherited it from a previous lab member and there is something not right with it)

I regenerated the surface model from the anatomical from scratch using recon-all in Freesurfer, then used suma make spec hires to generate the SurfVol again. SurfVol now is correct and has a skull

Now that it has the skull the following alignment (below) works well


Copy surfvol to experimental folder

3dcopy $surface_dir/{$surf_subj_num}_{$subj_init}SurfVol+orig
$output_dir/rm.{$surf_subj_num}
{$subj_init}_SurfVol

Zeropad SurfVol

3dZeropad -I 100 -S 100 -A 100 -P 100 -L 100 -R 100
-prefix rm.{$surf_subj_num}_{$subj_init}SurfVol_padded
rm.{$surf_subj_num}
{$subj_init}_SurfVol+orig

Then open SurfVol it and nudge it towards the location of the anatomical

Create a nudged surfvol in the experimental folder

3drotate -quintic -clipit -rotate 7.50I -4.33R 30.09A -ashift -15.71S -55.16L -20.99P
-prefix rm.{$surf_subj_num}_{$subj_init}SurfVol_padded_nudged rm.{$surf_subj_num}{$subj_init}_SurfVol_padded+orig

Make transformation matrix

cat_matvec ‘rm.’{$surf_subj_num}‘_’{$subj_init}‘_SurfVol_padded_nudged+orig::ROTATE_MATVEC_000000’ -I > XFORM0.1D

======================= surf (map data to surface) =======================

map EPI data to the surface domain

align the surface anatomy with the current experiment anatomy

@SUMA_AlignToExperiment
-init_xform XFORM0.1D
-surf_anat rm.{$surf_subj_num}_{$subj_init}_SurfVol_padded+orig
-exp_anat $exp_anat
-wd
-prefix {$subj}_SurfVol_Alnd_Exp

That is great, thanks for the update!

  • rick