I've tried something like this a little, though maybe the reverse of the suggestion, and it seems to work for resolving some skullstripping and alignment issues. Again, with only very few cases, I've used the following script. Processing time is about an hour for this pair of datasets, with most of the time in 3dQwarp.
#!/bin/tcsh
# qw_skullstrip.csh
# use nonlinear alignment to do skullstripping and alignment with a no-skull template
# usage:
# qw_skullstrip.csh dset template
# example:
# qw_skullstrip.csh anat+orig ~/abin/TT_N27+tlrc
set dset = $1
set template = $2
set based = `@GetAfniPrefix $dset`
set baset = `@GetAfniPrefix $template`
# remove spatial bias
3dUnifize -gm -prefix ${based}_un -input $dset
# Align data including skull affinely to template with/without skull
# using (@auto_tlrc might work here too)
align_epi_anat.py -dset1 ${based}_un+orig -dset2 $template -giant_move -suffix _al2template \
-dset1_strip None -dset2_strip None -master_dset1 BASE
#. Align nonlinearly a little. A maxlev of 0,1 or 2 might work here.
3dQwarp -maxlev 2 -iwarp -base $template -source ${based}_un_al2template+tlrc -prefix ${based}_qw
# Apply the inverse warp to the template to bring it to original affine warp space
# as in result of align_epi_anat.py above
3dNwarpApply -prefix ${baset}_aff -source $template \
-master ${based}_un_al2template+tlrc -nwarp ${based}_qw_WARPINV+tlrc
# Skullstrip the data using the inversely warped template without skull as the mask
# affine template has small value artifacts, so remove with
# a threshold of 1
# (could dilate a little here also to prevent removing brain at risk of putting skull back in)
3dcalc -a ${based}_un_al2template+tlrc -b ${baset}_aff+tlrc -expr 'a*step(b-1)' \
-prefix ${based}_cheapskull
# Continue nonlinear alignment to finer levels on skullstripped data
# starting where we left off
3dQwarp -maxlev 6 -base $template -source ${based}_cheapskull+tlrc \
-inilev 3 -iniwarp ${based}_qw_WARP+tlrc -prefix ${based}_qw_ns
Edited 1 time(s). Last edit at 07/02/2014 05:18PM by Daniel Glen.