AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
July 02, 2014 04:36PM
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.
Subject Author Posted

3dQwarp and skull-stripping issue

Danny June 30, 2014 02:48PM

Re: 3dQwarp and skull-stripping issue

Emperor Zhark July 01, 2014 09:07PM

Re: 3dQwarp and skull-stripping issue

Danny July 02, 2014 11:09AM

Re: 3dQwarp and skull-stripping issue

Daniel Glen July 02, 2014 04:36PM

Re: 3dQwarp and skull-stripping issue

Danny July 02, 2014 10:23PM

Re: 3dQwarp and skull-stripping issue

Daniel Glen July 03, 2014 11:07AM