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 20, 2022 09:39PM
Hi-

I would just like to reformat the afni_proc.py command a bit to help for readability (and ease for adding/editing options). This might help viewing a bit:
afni_proc.py                                                                 \
    -subj_id                  $subj                                          \
    -script                   proc.$subj                                     \
    -scr_overwrite                                                           \
    -blocks                   despike tshift align tlrc volreg blur mask     \
                              scale regress                                  \
    -copy_anat                $anat_dir/anatSS.${subj}.nii                   \
    -anat_has_skull           no                                             \
    -tcat_remove_first_trs    0                                              \
    -tshift_opts_ts           -tpattern seqplus                              \
    -dsets                    $epi_dir/${subj}.MID.epi+orig.                 \
    -volreg_align_to          MIN_OUTLIER                                    \
    -tlrc_base                $top_dir/nlWarp/MNI152_2009_template_SSW.nii.gz \
    -volreg_align_e2a                                                        \
    -volreg_tlrc_warp                                                        \
    -tlrc_NL_warp                                                            \
    -tlrc_NL_warped_dsets     $anat_dir/anatQQ.${subj}.nii                   \
                              $anat_dir/anatQQ.${subj}.aff12.1D              \
                              $anat_dir/anatQQ.${subj}_WARP.nii              \
    -blur_size                5.0                                            \
    -mask_epi_anat            yes                                            \
    -regress_stim_times       $stim_dir/loss_0_ant.txt                       \
                              $stim_dir/loss_1_ant.txt                       \
                              $stim_dir/loss_5_ant.txt                       \
                              $stim_dir/loss_ant.txt $stim_dir/win_0_ant.txt \
                              $stim_dir/win_1_ant.txt                        \
                              $stim_dir/win_5_ant.txt $stim_dir/win_ant.txt  \
                              $stim_dir/fix.txt $stim_dir/win_fb_hit.txt     \
                              $stim_dir/win_fb_nhit.txt                      \
                              $stim_dir/loss_fb_hit.txt                      \
                              $stim_dir/loss_fb_nhit.txt                     \
    -regress_stim_labels      L0ANT L1ANT L5ANT LANT W0ANT W1ANT W5ANT WANT  \
                              FIX WFB_HIT WFB_NHIT LFB_HIT LFB_NHIT          \
    -regress_basis_multi      'GAM' 'GAM' 'GAM' 'GAM' 'GAM' 'GAM' 'GAM'      \
                              'GAM' 'GAM' 'GAM' 'GAM' 'GAM' 'GAM'            \
    -regress_stim_types       times times times times times times times      \
                              times times times times times times            \
    -regress_censor_motion    0.3                                            \
    -regress_apply_mot_types  demean deriv                                   \
    -regress_motion_per_run                                                  \
    -regress_opts_3dD         -num_glt 10                                    \
                              -gltsym 'SYM: 1.0*WANT -1.0*W0ANT'             \
                              -glt_label 1 ANT_WIN_VS_NOWIN                  \
                              -gltsym 'SYM: 1.0*LANT -1.0*L0ANT'             \
                              -glt_label 2 ANT_LOSS_VS_NOLOSS-gltsym         \
                              'SYM: 1.0*WANT -1.0*LANT'                      \
                              -glt_label 3 ANT_WIN_VS_LOSS                   \
                              -gltsym                                        \
                              'SYM: 0.5*WANT 0.5*LANT -0.5*W0ANT -0.5*L0ANT' \
                              -glt_label 4 ANT_W15L15_VS_W0L0                \
                              -gltsym 'SYM: WFB_HIT -WFB_NHIT'               \
                              -glt_label 5 WINHIT_VS_MISS                    \
                              -gltsym 'SYM: LFB_HIT -LFB_NHIT'               \
                              -glt_label 6 LOSSHIT_VS_MISS                   \
                              -gltsym 'SYM: 1.0*W1ANT -1.0*W0ANT'            \
                              -glt_label 7 ANT_WIN1_VS_NOWIN                 \
                              -gltsym 'SYM: 1.0*W5ANT -1.0*W0ANT'            \
                              -glt_label 8 ANT_WIN5_VS_NOWIN                 \
                              -gltsym 'SYM: 1.0*L1ANT -1.0*L0ANT'            \
                              -glt_label 9 ANT_LOSS1_VS_NOLOSS               \
                              -gltsym 'SYM: 1.0*L5ANT -1.0*L0ANT'            \
                              -glt_label 10 ANT_LOSS5_VS_NOLOSS              \
    -regress_anaticor_fast                                                   \
    -regress_reml_exec                                                       \
    -regress_make_ideal_sum   sum_ideal.1D                                   \
    -regress_est_blur_epits                                                  \
    -regress_est_blur_errts                                                  \
    -regress_run_clustsim     no



With that being done, I might suggest:
+ reordering slightly so all sub-options are grouped a bit (for ease of reading)
+ adding some "-align_* ..." options, to help EPI-anatomical alignment and QC
-align_opts_aea           -cost lpc+ZZ                                   \
                              -giant_move                                    \
                              -check_flip                                    \
+ add in some more options for QC viewing, including TSNR estimation after volreg and the radcor block:
-volreg_compute_tsnr      yes                                            \
   -radial_correlate_blocks  tcat volreg                                    \
+ add in Python QC HTML creation (which is now the default, but I am not sure what version of AFNI you have):
-html_review_style pythonic
... after which, this is the command:
afni_proc.py                                                                 \
    -subj_id                  $subj                                          \
    -script                   proc.$subj                                     \
    -scr_overwrite                                                           \
    -blocks                   despike tshift align tlrc volreg blur mask     \
                              scale regress                                  \
    -copy_anat                $anat_dir/anatSS.${subj}.nii                   \
    -anat_has_skull           no                                             \
    -dsets                    $epi_dir/${subj}.MID.epi+orig.                 \
    -tcat_remove_first_trs    0                                              \
    -tshift_opts_ts           -tpattern seqplus                              \
    -radial_correlate_blocks  tcat volreg                                    \
    -align_opts_aea           -cost lpc+ZZ                                   \
                              -giant_move                                    \
                              -check_flip                                    \
    -volreg_align_to          MIN_OUTLIER                                    \
    -volreg_align_e2a                                                        \
    -volreg_tlrc_warp                                                        \
    -volreg_compute_tsnr      yes                                            \
    -tlrc_NL_warp                                                            \
    -tlrc_base                $top_dir/nlWarp/MNI152_2009_template_SSW.nii.gz \
    -tlrc_NL_warped_dsets     $anat_dir/anatQQ.${subj}.nii                   \
                              $anat_dir/anatQQ.${subj}.aff12.1D              \
                              $anat_dir/anatQQ.${subj}_WARP.nii              \
    -blur_size                5.0                                            \
    -mask_epi_anat            yes                                            \
    -regress_stim_times       $stim_dir/loss_0_ant.txt                       \
                              $stim_dir/loss_1_ant.txt                       \
                              $stim_dir/loss_5_ant.txt                       \
                              $stim_dir/loss_ant.txt $stim_dir/win_0_ant.txt \
                              $stim_dir/win_1_ant.txt                        \
                              $stim_dir/win_5_ant.txt $stim_dir/win_ant.txt  \
                              $stim_dir/fix.txt $stim_dir/win_fb_hit.txt     \
                              $stim_dir/win_fb_nhit.txt                      \
                              $stim_dir/loss_fb_hit.txt                      \
                              $stim_dir/loss_fb_nhit.txt                     \
    -regress_stim_labels      L0ANT L1ANT L5ANT LANT W0ANT W1ANT W5ANT WANT  \
                              FIX WFB_HIT WFB_NHIT LFB_HIT LFB_NHIT          \
    -regress_basis_multi      'GAM' 'GAM' 'GAM' 'GAM' 'GAM' 'GAM' 'GAM'      \
                              'GAM' 'GAM' 'GAM' 'GAM' 'GAM' 'GAM'            \
    -regress_stim_types       times times times times times times times      \
                              times times times times times times            \
    -regress_censor_motion    0.3                                            \
    -regress_apply_mot_types  demean deriv                                   \
    -regress_motion_per_run                                                  \
    -regress_opts_3dD         -num_glt 10                                    \
                              -gltsym 'SYM: 1.0*WANT -1.0*W0ANT'             \
                              -glt_label 1 ANT_WIN_VS_NOWIN                  \
                              -gltsym 'SYM: 1.0*LANT -1.0*L0ANT'             \
                              -glt_label 2 ANT_LOSS_VS_NOLOSS-gltsym         \
                              'SYM: 1.0*WANT -1.0*LANT'                      \
                              -glt_label 3 ANT_WIN_VS_LOSS                   \
                              -gltsym                                        \
                              'SYM: 0.5*WANT 0.5*LANT -0.5*W0ANT -0.5*L0ANT' \
                              -glt_label 4 ANT_W15L15_VS_W0L0                \
                              -gltsym 'SYM: WFB_HIT -WFB_NHIT'               \
                              -glt_label 5 WINHIT_VS_MISS                    \
                              -gltsym 'SYM: LFB_HIT -LFB_NHIT'               \
                              -glt_label 6 LOSSHIT_VS_MISS                   \
                              -gltsym 'SYM: 1.0*W1ANT -1.0*W0ANT'            \
                              -glt_label 7 ANT_WIN1_VS_NOWIN                 \
                              -gltsym 'SYM: 1.0*W5ANT -1.0*W0ANT'            \
                              -glt_label 8 ANT_WIN5_VS_NOWIN                 \
                              -gltsym 'SYM: 1.0*L1ANT -1.0*L0ANT'            \
                              -glt_label 9 ANT_LOSS1_VS_NOLOSS               \
                              -gltsym 'SYM: 1.0*L5ANT -1.0*L0ANT'            \
                              -glt_label 10 ANT_LOSS5_VS_NOLOSS              \
    -regress_anaticor_fast                                                   \
    -regress_reml_exec                                                       \
    -regress_make_ideal_sum   sum_ideal.1D                                   \
    -regress_est_blur_epits                                                  \
    -regress_est_blur_errts                                                  \
    -regress_run_clustsim     no                                             \
    -html_review_style        pythonic

There may be other suggestions for task modeling and things, too.

--pt
Subject Author Posted

afni_proc script help with contrasts

hmolla July 20, 2022 12:40PM

Re: afni_proc script help with contrasts

rick reynolds July 20, 2022 01:02PM

Re: afni_proc script help with contrasts

hmolla July 20, 2022 01:54PM

Re: afni_proc script help with contrasts

ptaylor July 20, 2022 09:39PM

Re: afni_proc script help with contrasts

ptaylor July 20, 2022 09:43PM

Re: afni_proc script help with contrasts

rick reynolds July 21, 2022 09:52PM