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  

|
February 21, 2020 06:51AM
Hi AFNI experts,

Due to my previous questions regarding bugs in the update we realized we had not followed the development of new recommendations for a typical task pre-proc pipeline. Rick kindly refereed me to:
afni_proc.py -show_example 'example 6b'
And I also read the SSwarper documentation. All the changes make sense to me but it leaves me with a couple of questions.

Just a quick note: Using the SSwarper to pre-warp and skullstrip basically doubles the pe-proc time compared to our old afniproc scripts. This analysis took in total 73 min of which 52 min was from SSwarper on a server with 40 cpu-threads. I hope it's worth it :D.

0) As recommended I used the align option "-check_flip" to get a warning if the flipped version of the epi(?) gave a lower cost than the original unflipped EPI. The warning says that the data does not need flipping but I'm not sure weather this is due to an actual lower cost or due to the error below where it states that it can't read the cost file and gives the same cost (1000) for both flipped and unflipped data:
++ Writing -allcostX1D results to '__tt_lr_flipcosts.1D'
 +  - histogram: source clip 288.416 .. 1065.28; base clip 196.319 .. 848.294
 +  - versus source range 1.69773e-05 .. 1148.31; base range 0 .. 934.575
 + 53147 total points stored in 561 'RHDD(11.1151)' bloks
++ -allcostX1D finished
ERROR: error reading cost list file
No flip cost is 1000.000000 for lpc+zz cost function
ERROR: error reading cost list file
Flip cost is 1000.000000 for lpc+zz cost function
Data does not need flipping

1) Can you please take a look at our resulting pre-proc (task) script and see if you see any "fatal errors" in the settings?

2) I noticed that the despike block was removed in the 6b example. Did I miss the memo regarding despiking being bad?

3) As far as I understood the 6b example you only get the "anaicored" stats output since you use regress_3dD_stop. We want to get both with and without anaticor so I removed regress_3dD_stop. In a previous thread I was recommended by one of you to use -regress_anaticor_fast since it was supposed to be both faster and better but I don't see that in 6b. Is there a reason for this?

4) We have previously been using -regress_motion_types demean deriv. In 6b this is not specified and I think the default is only to use the de-meaned versions of the motion parameters. Is deriv not recommended?

5) Even though I run SSwarper with -deoblique and in I use -deobliqe on in the algin option in the following afni-proc the output of afniproc stills warns about:
++ 3dAutomask: AFNI version=AFNI_20.0.12 (Feb 19 2020) [64-bit]
++ Authored by: Emperor Zhark
*+ WARNING:   If you are performing spatial transformations on an oblique dset, 
  such as ./epi.r01+orig.BRIK,
  or viewing/combining it with volumes of differing obliquity,
  you should consider running: 
     3dWarp -deoblique
Is this just one of those AFNI-warnings that always appear or have I done something wrong? =)

The first few lines in the code are to get the slice timings from the .json generated by dcm2niix and to preform the SSwarp.

#!bin/bash

startdir=$(pwd)

for sub in 1 ; do

if [ $sub -lt 10 ] ; then
sub=0${sub}
fi

datapath=/home/robka/full_task_preproc/data/C_sub${sub}_EB
sub_id=C_sub${sub}
T1_data=$datapath/T1.nii
fmri_data=$datapath/touch1.nii
fmri_data_json=$datapath/touch1.json
stim=$datapath/stimfiles
cpu_num=30

#slice timing
slicenums="`3dinfo -nk ${fmri_data}`"
slicetimes="`less $fmri_data_json | grep -A ${slicenums} SliceTiming | grep -Eo '[0-9.]{1,}'`"
echo ${slicetimes} > $sub_id.slicetimes.1D
slicetimesfile=$startdir/$sub_id.slicetimes.1D

#preform pre-warp and skullstrip
@SSwarper  -input $T1_data -base /usr/local/abin/MNI152_2009_template_SSW.nii.gz  -subid $sub_id -deoblique -giant_move -odir $startdir/pre_warp_$sub_id


afni_proc.py -subj_id $sub_id \
    -dsets $fmri_data \
    -copy_anat pre_warp_$sub_id/anatSS.$sub_id.nii \
    -anat_has_skull no \
    -anat_follower anat_w_skull anat $T1_data \
    -blocks tshift align tlrc volreg mask scale regress \
    -radial_correlate_blocks tcat volreg \
    -tcat_remove_first_trs 0 \
    -align_opts_aea -ginormous_move -deoblique on -cost lpc+zz -check_flip \
    -tlrc_base MNI152_2009_template_SSW.nii.gz \
    -tlrc_NL_warp \
    -tlrc_NL_warped_dsets \
           pre_warp_$sub_id/anatQQ.$sub_id.nii \
           pre_warp_$sub_id/anatQQ.$sub_id.aff12.1D \
           pre_warp_$sub_id/anatQQ.${sub_id}_WARP.nii \
    -mask_epi_anat yes \
    -tshift_opts_ts -tpattern @$slicetimesfile \
    -volreg_align_to MIN_OUTLIER \
    -volreg_align_e2a \
    -volreg_tlrc_warp \
    -regress_motion_per_run \
    -regress_censor_motion 0.3 \
    -regress_censor_outliers 0.05 \
    -regress_stim_types AM1 \
    -regress_basis 'dmBLOCK' \
    -regress_stim_times $stim/* \
    -regress_stim_labels fast slow rating_ple rating_int motor_ple motor_int \
    -regress_local_times \
    -regress_opts_3dD \
       -gltsym 'SYM: +slow -fast' \
       -glt_label 1 slow_vs_fast \
       -allzero_OK \
       -GOFORIT 6 \
       -jobs $cpu_num \
    -regress_reml_exec \
    -regress_opts_reml \
       -GOFORIT 6 \
    -regress_est_blur_epits \
    -regress_est_blur_errts \
    -regress_run_clustsim no \
    -html_review_style pythonic \
    -execute
    

mv $sub_id.slicetimes.1D $sub_id.results/
mv pre_warp_$sub_id/ $sub_id.results/
mv output.proc.$sub_id $sub_id.results/
mv proc.$sub_id $sub_id.results/
done

Subject Author Posted

Updated AFNI pre-proc pipeline

Robin February 21, 2020 06:51AM

Re: Updated AFNI pre-proc pipeline

ptaylor February 21, 2020 07:17AM

Re: Updated AFNI pre-proc pipeline

Robin February 21, 2020 08:23AM

Re: Updated AFNI pre-proc pipeline

ptaylor February 21, 2020 08:42AM

Re: Updated AFNI pre-proc pipeline

Robin February 21, 2020 08:57AM

Re: Updated AFNI pre-proc pipeline

Robin February 21, 2020 09:24AM

Re: Updated AFNI pre-proc pipeline

ptaylor February 21, 2020 09:35AM

Re: Updated AFNI pre-proc pipeline Attachments

Robin February 24, 2020 04:53AM

Re: Updated AFNI pre-proc pipeline

ptaylor February 24, 2020 07:43AM

Re: Updated AFNI pre-proc pipeline

Robin February 24, 2020 07:59AM

Re: Updated AFNI pre-proc pipeline

Robin March 02, 2020 03:02AM

Re: Updated AFNI pre-proc pipeline

rick reynolds March 03, 2020 09:51AM

Re: Updated AFNI pre-proc pipeline

Robin March 03, 2020 04:15PM

Re: Updated AFNI pre-proc pipeline

krisknut March 11, 2020 02:35PM

Re: Updated AFNI pre-proc pipeline

rick reynolds March 11, 2020 04:35PM