Error in affine step

Hello,

I have a question regarding an error related to affine transformations (see error message below). Upon inspection I saw that this participant’s anatomical scan has a lot of movement -it is very blurry and “grainy”. I have attempted to rectify the error by following the suggestion in a related post by skipping the affine step using “-affine_input_xmat ID”; however I received an error message indicating that “awpy/anat.un.aff.Xat.1D” cannot be found. I was wondering whether there are any other steps I can do to solve this issue? I am speculating that the affine transformation errors may be due to the head motion in the anatomical scan?

Thank you so much for your assistance!
Tamara

Previous post:
https://afni.nimh.nih.gov/afni/community/board/read.php?1,150128,150134#msg-150134

Error Message with affine step:

echo auto-generated by afni_proc.py, Wed Jul 18 09:58:21 2018
auto-generated by afni_proc.py, Wed Jul 18 09:58:21 2018
echo (version 6.10, Apr 26, 2018)
(version 6.10, Apr 26, 2018)
echo execution started: date
date
execution started: Fri Aug 3 08:54:05 EDT 2018
afni -ver
Precompiled binary linux_ubuntu_16_64: Apr 30 2018 (Version AFNI_18.1.09)
afni_history -check_date 23 Mar 2018
– is current: afni_history as new as: 23 Mar 2018
most recent entry is: 29 Apr 2018
if ( 0 ) then
if ( 0 > 0 ) then
set subj = July19_Final_9409
endif
set output_dir = July19_Final_9409.results
if ( -d July19_Final_9409.results ) then
set runs = ( count -digits 2 1 4 )
count -digits 2 1 4
mkdir July19_Final_9409.results
mkdir July19_Final_9409.results/stimuli
cp /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor.txt July19_Final_9409.results/stimuli
3dcopy 9409.anat+orig July19_Final_9409.results/9409.anat
++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
3dTcat -prefix July19_Final_9409.results/pb00.July19_Final_9409.r01.tcat 9409.1+orig[0…$]
++ 3dTcat: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ elapsed time = 0.3 s
3dTcat -prefix July19_Final_9409.results/pb00.July19_Final_9409.r02.tcat 9409.2+orig[0…$]
++ 3dTcat: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ elapsed time = 0.4 s
3dTcat -prefix July19_Final_9409.results/pb00.July19_Final_9409.r03.tcat 9409.3+orig[0…$]
++ 3dTcat: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ elapsed time = 0.4 s
3dTcat -prefix July19_Final_9409.results/pb00.July19_Final_9409.r04.tcat 9409.4+orig[0…$]
++ 3dTcat: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ elapsed time = 0.3 s
set tr_counts = ( 153 153 153 153 )
cd July19_Final_9409.results
touch out.pre_ss_warn.txt
foreach run ( 01 02 03 04 )
3dToutcount -automask -fraction -polort 3 -legendre pb00.July19_Final_9409.r01.tcat+orig
++ 3dToutcount: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./pb00.July19_Final_9409.r01.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.July19_Final_9409.r01.tcat+orig.BRIK is 3.359754 degrees from plumb.
++ 107968 voxels passed mask/clip
1deval -a outcount.r01.1D -expr 1-step(a-0.1)
if ( 1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)" ) then
1deval -a outcount.r01.1D{0} -expr step(a-0.4)
end
3dToutcount -automask -fraction -polort 3 -legendre pb00.July19_Final_9409.r02.tcat+orig
++ 3dToutcount: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./pb00.July19_Final_9409.r02.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.July19_Final_9409.r02.tcat+orig.BRIK is 3.359754 degrees from plumb.
++ 108219 voxels passed mask/clip
1deval -a outcount.r02.1D -expr 1-step(a-0.1)
if ( 1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)" ) then
1deval -a outcount.r02.1D{0} -expr step(a-0.4)
end
3dToutcount -automask -fraction -polort 3 -legendre pb00.July19_Final_9409.r03.tcat+orig
++ 3dToutcount: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./pb00.July19_Final_9409.r03.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.July19_Final_9409.r03.tcat+orig.BRIK is 3.359754 degrees from plumb.
++ 108215 voxels passed mask/clip
1deval -a outcount.r03.1D -expr 1-step(a-0.1)
if ( 1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)" ) then
1deval -a outcount.r03.1D{0} -expr step(a-0.4)
end
3dToutcount -automask -fraction -polort 3 -legendre pb00.July19_Final_9409.r04.tcat+orig
++ 3dToutcount: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./pb00.July19_Final_9409.r04.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.July19_Final_9409.r04.tcat+orig.BRIK is 3.359754 degrees from plumb.
++ 107669 voxels passed mask/clip
1deval -a outcount.r04.1D -expr 1-step(a-0.1)
if ( 1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)" ) then
1deval -a outcount.r04.1D{0} -expr step(a-0.4)
end
cat outcount.r01.1D outcount.r02.1D outcount.r03.1D outcount.r04.1D
cat rm.out.cen.r01.1D rm.out.cen.r02.1D rm.out.cen.r03.1D rm.out.cen.r04.1D
foreach run ( 01 02 03 04 )
3dTshift -tzero 0 -quintic -prefix pb01.July19_Final_9409.r01.tshift pb00.July19_Final_9409.r01.tcat+orig
++ 3dTshift: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./pb00.July19_Final_9409.r01.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.July19_Final_9409.r01.tcat+orig.BRIK is 3.359754 degrees from plumb.
end
3dTshift -tzero 0 -quintic -prefix pb01.July19_Final_9409.r02.tshift pb00.July19_Final_9409.r02.tcat+orig
++ 3dTshift: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./pb00.July19_Final_9409.r02.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.July19_Final_9409.r02.tcat+orig.BRIK is 3.359754 degrees from plumb.
end
3dTshift -tzero 0 -quintic -prefix pb01.July19_Final_9409.r03.tshift pb00.July19_Final_9409.r03.tcat+orig
++ 3dTshift: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./pb00.July19_Final_9409.r03.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.July19_Final_9409.r03.tcat+orig.BRIK is 3.359754 degrees from plumb.
end
3dTshift -tzero 0 -quintic -prefix pb01.July19_Final_9409.r04.tshift pb00.July19_Final_9409.r04.tcat+orig
++ 3dTshift: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./pb00.July19_Final_9409.r04.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.July19_Final_9409.r04.tcat+orig.BRIK is 3.359754 degrees from plumb.
end
3dbucket -prefix vr_base pb01.July19_Final_9409.r04.tshift+orig[152]
++ 3dbucket: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
align_epi_anat.py -anat2epi -anat 9409.anat+orig -save_skullstrip -suffix _al_junk -epi vr_base+orig -epi_base 0 -epi_strip 3dAutomask -volreg off -tshift off
#++ align_epi_anat version: 1.58
#++ turning off volume registration
#Script is running (command trimmed):
3dAttribute DELTA ./vr_base+orig
#Script is running (command trimmed):
3dAttribute DELTA ./vr_base+orig
#Script is running (command trimmed):
3dAttribute DELTA ./9409.anat+orig
#++ Multi-cost is lpc
#++ Removing all the temporary files
#Script is running:
\rm -f ./__tt_vr_base*
#Script is running:
\rm -f ./__tt_9409.anat*
#Script is running (command trimmed):
3dcopy ./9409.anat+orig ./__tt_9409.anat+orig
++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
#++ Removing skull from anat data
#Script is running (command trimmed):
3dSkullStrip -orig_vol -input ./__tt_9409.anat+orig -prefix ./__tt_9409.anat_ns
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./__tt_9409.anat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./__tt_9409.anat+orig.BRIK is 3.359754 degrees from plumb.
#Script is running (command trimmed):
3dinfo ./__tt_9409.anat_ns+orig | \grep ‘Data Axes Tilt:’|\grep ‘Oblique’
#++ Dataset /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/__tt_9409.anat_ns+orig is oblique*
#Script is running (command trimmed):
3dAttribute DELTA ./__tt_9409.anat_ns+orig
#++ Spacing for anat to oblique epi alignment is 1.000000
#++ Matching obliquity of anat to epi
#Script is running (command trimmed):
3dWarp -verb -card2oblique ./vr_base+orig -prefix ./__tt_9409.anat_ns_ob -newgrid 1.000000 ./__tt_9409.anat_ns+orig | \grep -A 4 ‘# mat44 Obliquity Transformation ::’ > ./__tt_9409.anat_ns_obla2e_mat.1D
++ 3dWarp: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: RW Cox
++ Deobliquing original dataset before obliquing
++ Combining oblique transformations
#++ using 0th sub-brick because only one found
#Script is running (command trimmed):
3dbucket -prefix ./__tt_vr_base_ts ./vr_base+orig’[0]’
++ 3dbucket: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
#++ resampling epi to match anat data
#Script is running (command trimmed):
3dresample -master ./__tt_9409.anat_ns_ob+orig -prefix ./__tt_vr_base_ts_rs -inset ./__tt_vr_base_ts+orig’’ -rmode Cu
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./__tt_vr_base_ts+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./__tt_vr_base_ts+orig.BRIK is 3.359754 degrees from plumb.
#++ removing skull or area outside brain
#Script is running (command trimmed):
3dAutomask -apply_prefix ./__tt_vr_base_ts_rs_ns ./__tt_vr_base_ts_rs+orig
++ 3dAutomask: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: Emperor Zhark
++ Loading dataset ./__tt_vr_base_ts_rs+orig
++ Forming automask

  • Fixed clip level = 190.991699
  • Used gradual clip level = 166.982407 … 202.581894
  • Number voxels above clip level = 1290370
  • Clustering voxels …
  • Largest cluster has 1277036 voxels
  • Clustering voxels …
  • Largest cluster has 1275274 voxels
  • Filled 2908 voxels in small holes; now have 1278182 voxels
  • Filled 31021 voxels in large holes; now have 1309203 voxels
  • Clustering voxels …
  • Largest cluster has 1309187 voxels
  • Clustering non-brain voxels …
  • Clustering voxels …
  • Largest cluster has 10487293 voxels
  • Mask now has 1309187 voxels
    ++ 1309187 voxels in the mask [out of 11796480: 11.10%]
    ++ first 63 x-planes are zero [from R]
    ++ last 60 x-planes are zero [from L]
    ++ first 48 y-planes are zero [from A]
    ++ last 18 y-planes are zero [from P]
    ++ first 41 z-planes are zero [from I]
    ++ last 46 z-planes are zero [from S]
    ++ applying mask to original data
    ++ Writing masked data
    ++ CPU time = 0.000000 sec
    #++ Computing weight mask
    #Script is running (command trimmed):
    3dBrickStat -automask -percentile 90.000000 1 90.000000 ./__tt_vr_base_ts_rs_ns+orig
    #++ Applying threshold of 491.000000 on /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/__tt_vr_base_ts_rs_ns+orig
    #Script is running (command trimmed):
    3dcalc -datum float -prefix ./__tt_vr_base_ts_rs_ns_wt -a ./__tt_vr_base_ts_rs_ns+orig -expr ‘min(1,(a/491.000000))’
    ++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: A cast of thousands
    #++ Aligning anat data to epi data
    #Script is running (command trimmed):
    3dAllineate -lpc -wtprefix ./__tt_9409.anat_ns_ob_al_junk_wtal -weight ./__tt_vr_base_ts_rs_ns_wt+orig -source ./__tt_9409.anat_ns_ob+orig -prefix ./__tt_9409.anat_ns_ob_temp_al_junk -base ./__tt_vr_base_ts_rs_ns+orig -nocmass -1Dmatrix_save ./9409.anat_al_junk_e2a_only_mat.aff12.1D -master SOURCE -weight_frac 1.0 -maxrot 6 -maxshf 10 -VERB -warp aff -source_automask+4 -onepass
    ++ 3dAllineate: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: Zhark the Registrator
    ++ Source dataset: ./__tt_9409.anat_ns_ob+orig.HEAD
    ++ Base dataset: ./__tt_vr_base_ts_rs_ns+orig.HEAD
    ++ Loading datasets
    ++ 2154889 voxels in -source_automask+4
    ++ Zero-pad: not needed
    ++ 1309170 voxels [11.1%] in weight mask
    ++ Number of points for matching = 1309170
    ++ Local correlation: blok type = ‘RHDD(6.54321)’
    ++ shift param auto-range: -81.9…81.9 -76.7…76.7 -61.3…61.3
  • Range param#4 [z-angle] = -6.000000 … 6.000000
  • Range param#5 [x-angle] = -6.000000 … 6.000000
  • Range param#6 [y-angle] = -6.000000 … 6.000000
  • Range param#1 [x-shift] = -10.000000 … 10.000000
  • Range param#2 [y-shift] = -10.000000 … 10.000000
  • Range param#3 [z-shift] = -10.000000 … 10.000000
  • 12 free parameters
    ++ Normalized convergence radius = 0.001000
    ++ OpenMP thread count = 8
    ++ ======= Allineation of 1 sub-bricks using Local Pearson Correlation Signed =======
    ++ ========== sub-brick #0 ========== [total CPU to here=0.0 s]
    ++ *** Fine pass begins ***
    • Enter alignment setup routine
    • copying base image
    • copying source image
    • copying weight image
    • using 1309170 points from base image [use_all=0]
    • Exit alignment setup routine
  • 1234541 total points stored in 2308 ‘RHDD(6.54321)’ bloks
    • Initial cost = -0.317216
    • Initial fine Parameters = 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000 1.0000 1.0000 0.0000 0.0000 0.0000

    • Finalish cost = -0.517211 ; 303 funcs

    • Final cost = -0.517227 ; 136 funcs
  • Final fine fit Parameters:
    x-shift=-0.0546 y-shift= 0.8048 z-shift=-0.3872
    z-angle=-0.6566 x-angle= 0.1385 y-angle= 0.1496
    x-scale= 1.0013 y-scale= 0.9705 z-scale= 0.9997
    y/x-shear= 0.0022 z/x-shear=-0.0062 z/y-shear=-0.0267
    • Fine net CPU time = 0.0 s
      ++ Computing output image
      ++ image warp: parameters = -0.0546 0.8048 -0.3872 -0.6566 0.1385 0.1496 1.0013 0.9705 0.9997 0.0022 -0.0062 -0.0267
      ++ Wrote -1Dmatrix_save ./9409.anat_al_junk_e2a_only_mat.aff12.1D
      ++ 3dAllineate: total CPU time = 0.0 sec Elapsed = 51.0
      ++ ###########################################################
      ++ # Please check results visually for alignment quality #
      ++ ###########################################################
      ++ # ‘-autoweight’ is recommended when using -lpc or -lpa #
      ++ # If your results are not good, please try again. #
      ++ ###########################################################
      #Script is running (command trimmed):
      cat_matvec -ONELINE ./9409.anat_al_junk_e2a_only_mat.aff12.1D ./__tt_9409.anat_ns_obla2e_mat.1D -I > ./9409.anat_al_junk_mat.aff12.1D
      #++ Combining anat to epi and oblique transformations
      #Script is running (command trimmed):
      3dAllineate -base ./__tt_vr_base_ts_rs_ns+orig -1Dmatrix_apply ./9409.anat_al_junk_mat.aff12.1D -prefix ./9409.anat_al_junk -input ./__tt_9409.anat_ns+orig -master SOURCE -weight_frac 1.0 -maxrot 6 -maxshf 10 -VERB -warp aff -source_automask+4 -onepass
      ++ 3dAllineate: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
      ++ Authored by: Zhark the Registrator
      e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
      such as ./__tt_9409.anat_ns+orig.BRIK,
      or viewing/combining it with volumes of differing obliquity,
      you should consider running:
      3dWarp -deoblique
      on this and other oblique datasets in the same session.
      See 3dWarp -help for details.
      ++ Oblique dataset:./__tt_9409.anat_ns+orig.BRIK is 3.359754 degrees from plumb.
      ++ Source dataset: ./__tt_9409.anat_ns+orig.HEAD
      ++ Base dataset: ./__tt_vr_base_ts_rs_ns+orig.HEAD
      ++ Loading datasets
  • Range param#4 [z-angle] = -6.000000 … 6.000000
  • Range param#5 [x-angle] = -6.000000 … 6.000000
  • Range param#6 [y-angle] = -6.000000 … 6.000000
  • Range param#1 [x-shift] = -10.000000 … 10.000000
  • Range param#2 [y-shift] = -10.000000 … 10.000000
  • Range param#3 [z-shift] = -10.000000 … 10.000000
    ++ OpenMP thread count = 8
    ++ ========== Applying transformation to 1 sub-bricks ==========
    ++ ========== sub-brick #0 ========== [total CPU to here=0.0 s]
    • Enter alignment setup routine
    • copying base image
    • copying source image
    • no weight image
    • using 11 points from base image [use_all=0]
    • Exit alignment setup routine
      ++ using -1Dmatrix_apply
      ++ Computing output image
      ++ image warp: parameters = 1.0012 -0.0115 -0.0026 -0.1389 0.0133 0.9704 0.0023 -0.5475 -0.0039 -0.0283 0.9996 14.6615
      ++ 3dAllineate: total CPU time = 0.0 sec Elapsed = 1.9
      ++ ###########################################################
      #++ Creating final output: skullstripped anat data
      copying from dataset /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/__tt_9409.anat_ns+orig to /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/9409.anat_ns+orig
      #Script is running (command trimmed):
      3dcopy ./__tt_9409.anat_ns+orig 9409.anat_ns
      ++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
      #++ Creating final output: anat data aligned to epi

copy is not necessary

#++ Saving history
#Script is running (command trimmed):
3dNotes -h “align_epi_anat.py -anat2epi -anat 9409.anat+orig -save_skullstrip
-suffix _al_junk -epi vr_base+orig -epi_base 0 -epi_strip 3dAutomask
-volreg off -tshift off”
./9409.anat_al_junk+orig

#++ Removing all the temporary files
#Script is running:
\rm -f ./__tt_vr_base*
#Script is running:
\rm -f ./__tt_9409.anat*

Finished alignment successfully

auto_warp.py -base MNI152_T1_2009c+tlrc -input 9409.anat_ns+orig -skull_strip_input no
#++ auto_warp.py version: 0.04

Output directory /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/awpy/

#Script is running:
mkdir /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/awpy/
cd /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/awpy/
#Script is running (command trimmed):
3dcopy /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/9409.anat_ns+orig ./anat.nii
++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
#Script is running (command trimmed):
3dUnifize -GM -input ./anat.nii -prefix ./anat.un.nii
++ 3dUnifize: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./anat.nii,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./anat.nii is 3.359754 degrees from plumb.

  • Pre-processing: ADV…UWG
    ++ Output dataset ./anat.un.nii
    ++ ===== Elapsed = 15.5 sec
    #Script is running (command trimmed):
    3dcopy /home/bmiadmin/abin/MNI152_T1_2009c+tlrc ./base.nii
    ++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    #++ Aligning /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/awpy/base.nii data to /home/bmiadmin/Tamara/PRR_Analysis/9409/July19_Final_9409.results/awpy/anat.un.nii data
    #Script is running (command trimmed):
    @auto_tlrc -base ./base.nii -input ./anat.un.nii -suffix .aff -no_ss -no_pre -init_xform CENTER
    Copying NIFTI volume to ./anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA
    ++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
    such as ./anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA+orig.BRIK,
    or viewing/combining it with volumes of differing obliquity,
    you should consider running:
    3dWarp -deoblique
    on this and other oblique datasets in the same session.
    See 3dWarp -help for details.
    ++ Oblique dataset:./anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA+orig.BRIK is 3.359754 degrees from plumb.

Performing center alignment with @Align_Centers

e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
such as ./anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA+orig.BRIK is 3.359754 degrees from plumb.
++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ 3drefit: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: RW Cox
++ Processing AFNI dataset ./anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA_shft+orig

  • deoblique
    ++ 3drefit processed 1 datasets
    ++ 3drename: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ THD_rename_dataset_files: rename anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA_shft+orig.HEAD → __ats_tmp__anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA_shft+orig.HEAD
    ++ THD_rename_dataset_files: rename anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA_shft+orig.BRIK → __ats_tmp__anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA_shft+orig.BRIK
    ** THD_rename_dataset_files: old header anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA_shft+acpc.HEAD doesn’t exist!
    ** THD_rename_dataset_files: old header anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA_shft+tlrc.HEAD doesn’t exist!
    ++ 3dWarp: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: RW Cox
    e[7m*+ WARNING:e[0m If you are performing spatial transformations on an oblique dset,
    such as ./anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA+orig.BRIK,
    or viewing/combining it with volumes of differing obliquity,
    you should consider running:
    3dWarp -deoblique
    on this and other oblique datasets in the same session.
    See 3dWarp -help for details.
    ++ Oblique dataset:./anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA+orig.BRIK is 3.359754 degrees from plumb.
    ++ 3.359754 degrees from plumb.
    e[7m*+ WARNING:e[0m Deoblique datasets with 3dWarp before proceeding with other transformations
    Center distance of 0.000000 mm
    Padding …
    ++ 3dZeropad: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ output dataset: ./__ats_tmp__ref_base.nii_40pad+tlrc.BRIK
    Resampling …
    ++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: A cast of thousands
    ++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: A cast of thousands
    Clipping -0.000100 3768.040100 …
    ++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: A cast of thousands
    ++ 3drefit: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: RW Cox
    ++ Processing AFNI dataset __ats_tmp___rs_pre.anat.un_AFN_OYmeqfZ3JqF7n9LNC7gDAA+tlrc.HEAD
  • changing dataset view code
  • Changed dataset view type and filenames.
    ++ 3drefit processed 1 datasets
    ++ 3drefit: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: RW Cox
    ++ Processing AFNI dataset __ats_tmp__resamp_NN+tlrc.HEAD
  • changing dataset view code
  • Changed dataset view type and filenames.
    ++ 3drefit processed 1 datasets
    ++ 3drefit: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: RW Cox
    ++ Processing AFNI dataset __ats_tmp__resamp_edge_art+tlrc.HEAD
  • changing dataset view code
  • Changed dataset view type and filenames.
    ++ 3drefit processed 1 datasets
    Registration (linear final interpolation) …
    ++ 3dWarpDrive: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: RW Cox
    RMS[0] = 103.624 74.1942 ITER = 137/137
    103.624

Warping used up maximum iterations of 137
Convergence might not have
been reached.
Doubling number of iterations

++ 3drename: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ THD_rename_dataset_files: rename __ats_tmp__reg_warpdriveout+orig.HEAD → __ats_tmp__reg_warpdriveout_maxed_iters+orig.HEAD
++ THD_rename_dataset_files: rename __ats_tmp__reg_warpdriveout+orig.BRIK.gz → __ats_tmp__reg_warpdriveout_maxed_iters+orig.BRIK.gz
++ 3dWarpDrive: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: RW Cox
RMS[0] = 103.624 74.1942 ITER = 274/274
103.624

Warping used up maximum iterations
even after doubling number of iterations to 274.
Convergence might not have been reached.

If you find the alignment poor, try
rerunning the script with a transform
type of fewer parameters (-xform) or by using
an even higher number of iterations (-maxite).
You can also choose to continue with the
current result (dset: __ats_tmp__reg_warpdriveout+orig
by using the option: -OK_maxite

Script will stop …

#**ERROR Failed in affine step
** ERROR - script failed
3dbucket: No match.

Hi Tamara-

That’s a curious error message. Can you post your entire afni_proc.py command?

Also, it’s worth updating your binaries for a variety of reasons. But one of the main ones is that we’re currently recommending doing the nonlinear warp (and skull strip) outside of afni_proc.py using @SSwarper. An example usage is:


@SSwarper -input  9409.anat+orig -base MNI152_2009_template_SSW.nii.gz -subid 9409

You would then provide the outputs of that script to afni_proc.py:


-tlrc_NL_warp -tlrc_NL_warped_dsets anatQQ.${subj}.nii anatQQ.${subj}.aff12.1D anatQQ.${subj}_WARP.nii

-Peter

Thank you for the recommendation! I began running this analysis when the binaries were updated, so I am a bit worried about updating them now as I am in mid-analysis. Do you think I should still update them? Would it be recommended for me to re-run my analysis again?

I’ve also pasted a picture of the anatomical scan in case you wanted to look at the movement.

I have pasted my script below.

Thank you for your help!
Tamara

#!/bin/tcsh -xef

echo “auto-generated by afni_proc.py, Wed Jul 18 09:58:21 2018”
echo “(version 6.10, Apr 26, 2018)”
echo “execution started: date

execute via :

tcsh -xef proc.July19_Final_9409_test2 |& tee output.proc.July19_Final_9409_test2

=========================== auto block: setup ============================

script setup

take note of the AFNI version

afni -ver

check that the current AFNI version is recent enough

afni_history -check_date 23 Mar 2018
if ( $status ) then
echo “** this script requires newer AFNI binaries (than 23 Mar 2018)”
echo " (consider: @update.afni.binaries -defaults)"
exit
endif

the user may specify a single subject to run with

if ( $#argv > 0 ) then
set subj = $argv[1]
else
set subj = July19_Final_9409_test2
endif

assign output directory name

set output_dir = $subj.results

verify that the results directory does not yet exist

if ( -d $output_dir ) then
echo output dir “$subj.results” already exists
exit
endif

set list of runs

set runs = (count -digits 2 1 4)

create results and stimuli directories

mkdir $output_dir
mkdir $output_dir/stimuli

copy stim files into stimulus directory

cp /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor.txt
$output_dir/stimuli

copy anatomy to results dir

3dcopy 9409.anat+orig $output_dir/9409.anat

============================ auto block: tcat ============================

apply 3dTcat to copy input dsets to results dir,

while removing the first 0 TRs

3dTcat -prefix $output_dir/pb00.subj.r01.tcat 9409.1+orig'[0..]’
3dTcat -prefix $output_dir/pb00.subj.r02.tcat 9409.2+orig'[0..]’
3dTcat -prefix $output_dir/pb00.subj.r03.tcat 9409.3+orig'[0..]’
3dTcat -prefix $output_dir/pb00.subj.r04.tcat 9409.4+orig'[0..]’

and make note of repetitions (TRs) per run

set tr_counts = ( 153 153 153 153 )

-------------------------------------------------------

enter the results directory (can begin processing data)

cd $output_dir

========================== auto block: outcount ==========================

data check: compute outlier fraction for each volume

touch out.pre_ss_warn.txt
foreach run ( $runs )
3dToutcount -automask -fraction -polort 3 -legendre
pb00.$subj.r$run.tcat+orig > outcount.r$run.1D

# censor outlier TRs per run, ignoring the first 0 TRs
# - censor when more than 0.1 of automask voxels are outliers
# - step() defines which TRs to remove via censoring
1deval -a outcount.r$run.1D -expr "1-step(a-0.1)" > rm.out.cen.r$run.1D

# outliers at TR 0 might suggest pre-steady state TRs
if ( `1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)"` ) then
    echo "** TR #0 outliers: possible pre-steady state TRs in run $run" \
        >> out.pre_ss_warn.txt
endif

end

catenate outlier counts into a single time series

cat outcount.r*.1D > outcount_rall.1D

catenate outlier censor files into a single time series

cat rm.out.cen.r*.1D > outcount_${subj}_censor.1D

================================= tshift =================================

time shift data so all slice timing is the same

foreach run ( $runs )
3dTshift -tzero 0 -quintic -prefix pb01.$subj.r$run.tshift
pb00.$subj.r$run.tcat+orig
end

--------------------------------

extract volreg registration base

3dbucket -prefix vr_base pb01.$subj.r04.tshift+orig"[152]"

================================= align ==================================

for e2a: compute anat alignment transformation to EPI registration base

(new anat will be intermediate, stripped, 9409.anat_ns+orig)

align_epi_anat.py -anat2epi -anat 9409.anat+orig
-save_skullstrip -suffix _al_junk
-epi vr_base+orig -epi_base 0
-epi_strip 3dAutomask
-volreg off -tshift off

================================== tlrc ==================================

warp anatomy to standard space (non-linear warp)

auto_warp.py -base MNI152_T1_2009c+tlrc -input 9409.anat_ns+orig
-skull_strip_input no -affine_input_xmat ID

move results up out of the awpy directory

(NL-warped anat, affine warp, NL warp)

(use typical standard space name for anat)

(wildcard is a cheap way to go after any .gz)

3dbucket -prefix 9409.anat_ns awpy/9409.anat_ns.aw.nii*
mv awpy/anat.un.aff.Xat.1D .
mv awpy/anat.un.aff.qw_WARP.nii .

================================= volreg =================================

align each dset to base volume, align to anat, warp to tlrc space

verify that we have a +tlrc warp dataset

if ( ! -f 9409.anat_ns+tlrc.HEAD ) then
echo “** missing +tlrc warp dataset: 9409.anat_ns+tlrc.HEAD”
exit
endif

register and warp

foreach run ( $runs )
# register each volume to the base image
3dvolreg -verbose -zpad 1 -base vr_base+orig
-1Dfile dfile.r$run.1D -prefix rm.epi.volreg.r$run
-cubic
-1Dmatrix_save mat.r$run.vr.aff12.1D
pb01.$subj.r$run.tshift+orig

# create an all-1 dataset to mask the extents of the warp
3dcalc -overwrite -a pb01.$subj.r$run.tshift+orig -expr 1                 \
       -prefix rm.epi.all1

# catenate volreg/epi2anat/tlrc xforms
cat_matvec -ONELINE                                                       \
           anat.un.aff.Xat.1D                                             \
           9409.anat_al_junk_mat.aff12.1D -I                             \
           mat.r$run.vr.aff12.1D > mat.r$run.warp.aff12.1D

# apply catenated xform: volreg/epi2anat/tlrc/NLtlrc
# then apply non-linear standard-space warp
3dNwarpApply -master 9409.anat_ns+tlrc -dxyz 2                           \
             -source pb01.$subj.r$run.tshift+orig                         \
             -nwarp "anat.un.aff.qw_WARP.nii mat.r$run.warp.aff12.1D"     \
             -prefix rm.epi.nomask.r$run

# warp the all-1 dataset for extents masking 
3dNwarpApply -master 9409.anat_ns+tlrc -dxyz 2                           \
             -source rm.epi.all1+orig                                     \
             -nwarp "anat.un.aff.qw_WARP.nii mat.r$run.warp.aff12.1D"     \
             -interp cubic                                                \
             -ainterp NN -quiet                                           \
             -prefix rm.epi.1.r$run

# make an extents intersection mask of this run
3dTstat -min -prefix rm.epi.min.r$run rm.epi.1.r$run+tlrc

end

make a single file of registration params

cat dfile.r*.1D > dfile_rall.1D

----------------------------------------

create the extents mask: mask_epi_extents+tlrc

(this is a mask of voxels that have valid data at every TR)

3dMean -datum short -prefix rm.epi.mean rm.epi.min.r*.HEAD
3dcalc -a rm.epi.mean+tlrc -expr ‘step(a-0.999)’ -prefix mask_epi_extents

and apply the extents mask to the EPI data

(delete any time series with missing data)

foreach run ( $runs )
3dcalc -a rm.epi.nomask.r$run+tlrc -b mask_epi_extents+tlrc
-expr ‘a*b’ -prefix pb02.$subj.r$run.volreg
end

warp the volreg base EPI dataset to make a final version

cat_matvec -ONELINE
anat.un.aff.Xat.1D
9409.anat_al_junk_mat.aff12.1D -I > mat.basewarp.aff12.1D

3dNwarpApply -master 9409.anat_ns+tlrc -dxyz 2
-source vr_base+orig
-nwarp “anat.un.aff.qw_WARP.nii mat.basewarp.aff12.1D”
-prefix final_epi_vr_base

create an anat_final dataset, aligned with stats

3dcopy 9409.anat_ns+tlrc anat_final.$subj

record final registration costs

3dAllineate -base final_epi_vr_base+tlrc -allcostX
-input anat_final.$subj+tlrc |& tee out.allcostX.txt

-----------------------------------------

warp anat follower datasets (non-linear)

3dNwarpApply -source 9409.anat+orig
-master anat_final.$subj+tlrc
-ainterp wsinc5 -nwarp anat.un.aff.qw_WARP.nii anat.un.aff.Xat.1D
-prefix anat_w_skull_warped

================================== blur ==================================

blur each volume of each run

foreach run ( $runs )
3dmerge -1blur_fwhm 4.0 -doall -prefix pb03.$subj.r$run.blur
pb02.$subj.r$run.volreg+tlrc
end

================================== mask ==================================

create ‘full_mask’ dataset (union mask)

foreach run ( $runs )
3dAutomask -dilate 1 -prefix rm.mask_r$run pb03.$subj.r$run.blur+tlrc
end

create union of inputs, output type is byte

3dmask_tool -inputs rm.mask_r*+tlrc.HEAD -union -prefix full_mask.$subj

---- create subject anatomy mask, mask_anat.$subj+tlrc ----

(resampled from tlrc anat)

3dresample -master full_mask.$subj+tlrc -input 9409.anat_ns+tlrc
-prefix rm.resam.anat

convert to binary anat mask; fill gaps and holes

3dmask_tool -dilate_input 5 -5 -fill_holes -input rm.resam.anat+tlrc
-prefix mask_anat.$subj

compute tighter EPI mask by intersecting with anat mask

3dmask_tool -input full_mask.$subj+tlrc mask_anat.$subj+tlrc
-inter -prefix mask_epi_anat.$subj

compute overlaps between anat and EPI masks

3dABoverlap -no_automask full_mask.$subj+tlrc mask_anat.$subj+tlrc
|& tee out.mask_ae_overlap.txt

note Dice coefficient of masks, as well

3ddot -dodice full_mask.$subj+tlrc mask_anat.$subj+tlrc
|& tee out.mask_ae_dice.txt

---- create group anatomy mask, mask_group+tlrc ----

(resampled from tlrc base anat, MNI152_T1_2009c+tlrc)

3dresample -master full_mask.$subj+tlrc -prefix ./rm.resam.group
-input /home/bmiadmin/abin/MNI152_T1_2009c+tlrc

convert to binary group mask; fill gaps and holes

3dmask_tool -dilate_input 5 -5 -fill_holes -input rm.resam.group+tlrc
-prefix mask_group

================================= scale ==================================

scale each voxel time series to have a mean of 100

(be sure no negatives creep in)

(subject to a range of [0,200])

foreach run ( $runs )
3dTstat -prefix rm.mean_r$run pb03.$subj.r$run.blur+tlrc
3dcalc -a pb03.$subj.r$run.blur+tlrc -b rm.mean_r$run+tlrc
-c mask_epi_extents+tlrc
-expr ‘c * min(200, a/b*100)*step(a)*step(b)’
-prefix pb04.$subj.r$run.scale
end

================================ regress =================================

compute de-meaned motion parameters (for use in regression)

1d_tool.py -infile dfile_rall.1D -set_nruns 4
-demean -write motion_demean.1D

compute motion parameter derivatives (for use in regression)

1d_tool.py -infile dfile_rall.1D -set_nruns 4
-derivative -demean -write motion_deriv.1D

convert motion parameters for per-run regression

1d_tool.py -infile motion_demean.1D -set_nruns 4
-split_into_pad_runs mot_demean

1d_tool.py -infile motion_deriv.1D -set_nruns 4
-split_into_pad_runs mot_deriv

create censor file motion_${subj}_censor.1D, for censoring motion

1d_tool.py -infile dfile_rall.1D -set_nruns 4
-show_censor_count -censor_prev_TR
-censor_motion 2 motion_${subj}

combine multiple censor files

1deval -a motion_{subj}_censor.1D -b outcount_{subj}censor.1D
-expr “a*b” > censor
${subj}_combined_2.1D

note TRs that were not censored

set ktrs = 1d_tool.py -infile censor_${subj}_combined_2.1D \ -show_trs_uncensored encoded

------------------------------

run the regression analysis

3dDeconvolve -input pb04.subj.r*.scale+tlrc.HEAD \ -censor censor_{subj}_combined_2.1D
-polort 3
-num_stimts 64
-stim_times_AM1 1 stimuli/NonRevP_learn_corr_fed.txt ‘dmBLOCK’
-stim_label 1 NonRevP_learn_corr_fed
-stim_times_AM1 2 stimuli/NonRevP_learn_corr.txt ‘dmBLOCK’
-stim_label 2 NonRevP_learn_corr
-stim_times_AM1 3 stimuli/NonRevP_learn_incor_fed.txt ‘dmBLOCK’
-stim_label 3 NonRevP_learn_incor_fed
-stim_times_AM1 4 stimuli/NonRevP_learn_incor.txt ‘dmBLOCK’
-stim_label 4 NonRevP_learn_incor
-stim_times_AM1 5 stimuli/NonRevP_perf_corr_fed.txt ‘dmBLOCK’
-stim_label 5 NonRevP_perf_corr_fed
-stim_times_AM1 6 stimuli/NonRevP_perf_corr.txt ‘dmBLOCK’
-stim_label 6 NonRevP_perf_corr
-stim_times_AM1 7 stimuli/NonRevP_perf_incor_fed.txt ‘dmBLOCK’
-stim_label 7 NonRevP_perf_incor_fed
-stim_times_AM1 8 stimuli/NonRevP_perf_incor.txt ‘dmBLOCK’
-stim_label 8 NonRevP_perf_incor
-stim_times_AM1 9 stimuli/RevP_acq_corr_fed.txt ‘dmBLOCK’
-stim_label 9 RevP_acq_corr_fed
-stim_times_AM1 10 stimuli/RevP_acq_corr.txt ‘dmBLOCK’
-stim_label 10 RevP_acq_corr
-stim_times_AM1 11 stimuli/RevP_acq_incor_fed.txt ‘dmBLOCK’
-stim_label 11 RevP_acq_incor_fed
-stim_times_AM1 12 stimuli/RevP_acq_incor.txt ‘dmBLOCK’
-stim_label 12 RevP_acq_incor
-stim_times_AM1 13 stimuli/RevP_rev_corr_fed.txt ‘dmBLOCK’
-stim_label 13 RevP_rev_corr_fed
-stim_times_AM1 14 stimuli/RevP_rev_corr.txt ‘dmBLOCK’
-stim_label 14 RevP_rev_corr
-stim_times_AM1 15 stimuli/RevP_rev_incor_fed.txt ‘dmBLOCK’
-stim_label 15 RevP_rev_incor_fed
-stim_times_AM1 16 stimuli/RevP_rev_incor.txt ‘dmBLOCK’
-stim_label 16 RevP_rev_incor
-stim_file 17 mot_demean.r01.1D’[0]’ -stim_base 17 -stim_label 17 roll_01
-stim_file 18 mot_demean.r01.1D’[1]’ -stim_base 18 -stim_label 18
pitch_01
-stim_file 19 mot_demean.r01.1D’[2]’ -stim_base 19 -stim_label 19 yaw_01
-stim_file 20 mot_demean.r01.1D’[3]’ -stim_base 20 -stim_label 20 dS_01
-stim_file 21 mot_demean.r01.1D’[4]’ -stim_base 21 -stim_label 21 dL_01
-stim_file 22 mot_demean.r01.1D’[5]’ -stim_base 22 -stim_label 22 dP_01
-stim_file 23 mot_demean.r02.1D’[0]’ -stim_base 23 -stim_label 23 roll_02
-stim_file 24 mot_demean.r02.1D’[1]’ -stim_base 24 -stim_label 24
pitch_02
-stim_file 25 mot_demean.r02.1D’[2]’ -stim_base 25 -stim_label 25 yaw_02
-stim_file 26 mot_demean.r02.1D’[3]’ -stim_base 26 -stim_label 26 dS_02
-stim_file 27 mot_demean.r02.1D’[4]’ -stim_base 27 -stim_label 27 dL_02
-stim_file 28 mot_demean.r02.1D’[5]’ -stim_base 28 -stim_label 28 dP_02
-stim_file 29 mot_demean.r03.1D’[0]’ -stim_base 29 -stim_label 29 roll_03
-stim_file 30 mot_demean.r03.1D’[1]’ -stim_base 30 -stim_label 30
pitch_03
-stim_file 31 mot_demean.r03.1D’[2]’ -stim_base 31 -stim_label 31 yaw_03
-stim_file 32 mot_demean.r03.1D’[3]’ -stim_base 32 -stim_label 32 dS_03
-stim_file 33 mot_demean.r03.1D’[4]’ -stim_base 33 -stim_label 33 dL_03
-stim_file 34 mot_demean.r03.1D’[5]’ -stim_base 34 -stim_label 34 dP_03
-stim_file 35 mot_demean.r04.1D’[0]’ -stim_base 35 -stim_label 35 roll_04
-stim_file 36 mot_demean.r04.1D’[1]’ -stim_base 36 -stim_label 36
pitch_04
-stim_file 37 mot_demean.r04.1D’[2]’ -stim_base 37 -stim_label 37 yaw_04
-stim_file 38 mot_demean.r04.1D’[3]’ -stim_base 38 -stim_label 38 dS_04
-stim_file 39 mot_demean.r04.1D’[4]’ -stim_base 39 -stim_label 39 dL_04
-stim_file 40 mot_demean.r04.1D’[5]’ -stim_base 40 -stim_label 40 dP_04
-stim_file 41 mot_deriv.r01.1D’[0]’ -stim_base 41 -stim_label 41 roll_05
-stim_file 42 mot_deriv.r01.1D’[1]’ -stim_base 42 -stim_label 42 pitch_05
-stim_file 43 mot_deriv.r01.1D’[2]’ -stim_base 43 -stim_label 43 yaw_05
-stim_file 44 mot_deriv.r01.1D’[3]’ -stim_base 44 -stim_label 44 dS_05
-stim_file 45 mot_deriv.r01.1D’[4]’ -stim_base 45 -stim_label 45 dL_05
-stim_file 46 mot_deriv.r01.1D’[5]’ -stim_base 46 -stim_label 46 dP_05
-stim_file 47 mot_deriv.r02.1D’[0]’ -stim_base 47 -stim_label 47 roll_06
-stim_file 48 mot_deriv.r02.1D’[1]’ -stim_base 48 -stim_label 48 pitch_06
-stim_file 49 mot_deriv.r02.1D’[2]’ -stim_base 49 -stim_label 49 yaw_06
-stim_file 50 mot_deriv.r02.1D’[3]’ -stim_base 50 -stim_label 50 dS_06
-stim_file 51 mot_deriv.r02.1D’[4]’ -stim_base 51 -stim_label 51 dL_06
-stim_file 52 mot_deriv.r02.1D’[5]’ -stim_base 52 -stim_label 52 dP_06
-stim_file 53 mot_deriv.r03.1D’[0]’ -stim_base 53 -stim_label 53 roll_07
-stim_file 54 mot_deriv.r03.1D’[1]’ -stim_base 54 -stim_label 54 pitch_07
-stim_file 55 mot_deriv.r03.1D’[2]’ -stim_base 55 -stim_label 55 yaw_07
-stim_file 56 mot_deriv.r03.1D’[3]’ -stim_base 56 -stim_label 56 dS_07
-stim_file 57 mot_deriv.r03.1D’[4]’ -stim_base 57 -stim_label 57 dL_07
-stim_file 58 mot_deriv.r03.1D’[5]’ -stim_base 58 -stim_label 58 dP_07
-stim_file 59 mot_deriv.r04.1D’[0]’ -stim_base 59 -stim_label 59 roll_08
-stim_file 60 mot_deriv.r04.1D’[1]’ -stim_base 60 -stim_label 60 pitch_08
-stim_file 61 mot_deriv.r04.1D’[2]’ -stim_base 61 -stim_label 61 yaw_08
-stim_file 62 mot_deriv.r04.1D’[3]’ -stim_base 62 -stim_label 62 dS_08
-stim_file 63 mot_deriv.r04.1D’[4]’ -stim_base 63 -stim_label 63 dL_08
-stim_file 64 mot_deriv.r04.1D’[5]’ -stim_base 64 -stim_label 64 dP_08
-fout -tout -x1D X.xmat.1D -xjpeg X.jpg
-x1D_uncensored X.nocensor.xmat.1D
-fitts fitts.subj \ -errts errts.{subj}
-bucket stats.$subj

if 3dDeconvolve fails, terminate the script

if ( $status != 0 ) then
echo ‘---------------------------------------’
echo ‘** 3dDeconvolve error, failing…’
echo ’ (consider the file 3dDeconvolve.err)’
exit
endif

display any large pairwise correlations from the X-matrix

1d_tool.py -show_cormat_warnings -infile X.xmat.1D |& tee out.cormat_warn.txt

create an all_runs dataset to match the fitts, errts, etc.

3dTcat -prefix all_runs.$subj pb04.$subj.r*.scale+tlrc.HEAD

--------------------------------------------------

create a temporal signal to noise ratio dataset

signal: if ‘scale’ block, mean should be 100

noise : compute standard deviation of errts

3dTstat -mean -prefix rm.signal.all all_runs.$subj+tlrc"[ktrs]" 3dTstat -stdev -prefix rm.noise.all errts.{subj}+tlrc"[$ktrs]"
3dcalc -a rm.signal.all+tlrc
-b rm.noise.all+tlrc
-c full_mask.$subj+tlrc
-expr ‘c*a/b’ -prefix TSNR.$subj

---------------------------------------------------

compute and store GCOR (global correlation average)

(sum of squares of global mean of unit errts)

3dTnorm -norm2 -prefix rm.errts.unit errts.${subj}+tlrc
3dmaskave -quiet -mask full_mask.$subj+tlrc rm.errts.unit+tlrc
> gmean.errts.unit.1D
3dTstat -sos -prefix - gmean.errts.unit.1D' > out.gcor.1D
echo “-- GCOR = cat out.gcor.1D

---------------------------------------------------

compute correlation volume

(per voxel: average correlation across masked brain)

(now just dot product with average unit time series)

3dcalc -a rm.errts.unit+tlrc -b gmean.errts.unit.1D -expr ‘a*b’ -prefix rm.DP
3dTstat -sum -prefix corr_brain rm.DP+tlrc

create ideal files for fixed response stim types

1dcat X.nocensor.xmat.1D’[16]’ > ideal_NonRevP_learn_corr_fed.1D
1dcat X.nocensor.xmat.1D’[17]’ > ideal_NonRevP_learn_corr.1D
1dcat X.nocensor.xmat.1D’[18]’ > ideal_NonRevP_learn_incor_fed.1D
1dcat X.nocensor.xmat.1D’[19]’ > ideal_NonRevP_learn_incor.1D
1dcat X.nocensor.xmat.1D’[20]’ > ideal_NonRevP_perf_corr_fed.1D
1dcat X.nocensor.xmat.1D’[21]’ > ideal_NonRevP_perf_corr.1D
1dcat X.nocensor.xmat.1D’[22]’ > ideal_NonRevP_perf_incor_fed.1D
1dcat X.nocensor.xmat.1D’[23]’ > ideal_NonRevP_perf_incor.1D
1dcat X.nocensor.xmat.1D’[24]’ > ideal_RevP_acq_corr_fed.1D
1dcat X.nocensor.xmat.1D’[25]’ > ideal_RevP_acq_corr.1D
1dcat X.nocensor.xmat.1D’[26]’ > ideal_RevP_acq_incor_fed.1D
1dcat X.nocensor.xmat.1D’[27]’ > ideal_RevP_acq_incor.1D
1dcat X.nocensor.xmat.1D’[28]’ > ideal_RevP_rev_corr_fed.1D
1dcat X.nocensor.xmat.1D’[29]’ > ideal_RevP_rev_corr.1D
1dcat X.nocensor.xmat.1D’[30]’ > ideal_RevP_rev_incor_fed.1D
1dcat X.nocensor.xmat.1D’[31]’ > ideal_RevP_rev_incor.1D

--------------------------------------------------------

compute sum of non-baseline regressors from the X-matrix

(use 1d_tool.py to get list of regressor colums)

set reg_cols = 1d_tool.py -infile X.nocensor.xmat.1D -show_indices_interest
3dTstat -sum -prefix sum_ideal.1D X.nocensor.xmat.1D"[$reg_cols]"

also, create a stimulus-only X-matrix, for easy review

1dcat X.nocensor.xmat.1D"[$reg_cols]" > X.stim.xmat.1D

============================ blur estimation =============================

compute blur estimates

touch blur_est.$subj.1D # start with empty file

create directory for ACF curve files

mkdir files_ACF

– estimate blur for each run in epits –

touch blur.epits.1D

restrict to uncensored TRs, per run

foreach run ( $runs )
set trs = 1d_tool.py -infile X.xmat.1D -show_trs_uncensored encoded \ -show_trs_run $run
if ( $trs == “” ) continue
3dFWHMx -detrend -mask full_mask.$subj+tlrc
-ACF files_ACF/out.3dFWHMx.ACF.epits.r$run.1D
all_runs.$subj+tlrc"[$trs]" >> blur.epits.1D
end

compute average FWHM blur (from every other row) and append

set blurs = ( 3dTstat -mean -prefix - blur.epits.1D'{0..$(2)}'\' )
echo average epits FWHM blurs: $blurs
echo “$blurs # epits FWHM blur estimates” >> blur_est.$subj.1D

compute average ACF blur (from every other row) and append

set blurs = ( 3dTstat -mean -prefix - blur.epits.1D'{1..$(2)}'\' )
echo average epits ACF blurs: $blurs
echo “$blurs # epits ACF blur estimates” >> blur_est.$subj.1D

– estimate blur for each run in errts –

touch blur.errts.1D

restrict to uncensored TRs, per run

foreach run ( $runs )
set trs = 1d_tool.py -infile X.xmat.1D -show_trs_uncensored encoded \ -show_trs_run $run
if ( $trs == “” ) continue
3dFWHMx -detrend -mask full_mask.$subj+tlrc
-ACF files_ACF/out.3dFWHMx.ACF.errts.r$run.1D
errts.${subj}+tlrc"[$trs]" >> blur.errts.1D
end

compute average FWHM blur (from every other row) and append

set blurs = ( 3dTstat -mean -prefix - blur.errts.1D'{0..$(2)}'\' )
echo average errts FWHM blurs: $blurs
echo “$blurs # errts FWHM blur estimates” >> blur_est.$subj.1D

compute average ACF blur (from every other row) and append

set blurs = ( 3dTstat -mean -prefix - blur.errts.1D'{1..$(2)}'\' )
echo average errts ACF blurs: $blurs
echo “$blurs # errts ACF blur estimates” >> blur_est.$subj.1D

================== auto block: generate review scripts ===================

generate a review script for the unprocessed EPI data

gen_epi_review.py -script @epi_review.$subj
-dsets pb00.$subj.r*.tcat+orig.HEAD

generate scripts to review single subject results

(try with defaults, but do not allow bad exit status)

gen_ss_review_scripts.py -mot_limit 2.0 -out_limit 0.1 -exit0

========================== auto block: finalize ==========================

remove temporary files

\rm -fr rm.* awpy

if the basic subject review script is here, run it

(want this to be the last text output)

if ( -e @ss_review_basic ) ./@ss_review_basic |& tee out.ss_review.$subj.txt

return to parent directory

cd …

echo “execution finished: date

==========================================================================

script generated by the command:

afni_proc.py -subj_id July19_Final_9409_test2 -script proc.July19_Final_9409_test2 -scr_overwrite \

-blocks tshift align tlrc volreg blur mask scale regress -copy_anat \

/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.anat+orig -dsets \

/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.1+orig.HEAD \

/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.2+orig.HEAD \

/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.3+orig.HEAD \

/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.4+orig.HEAD \

-tcat_remove_first_trs 0 -tlrc_base MNI152_T1_2009c+tlrc -tlrc_NL_warp \

-volreg_align_to last -volreg_align_e2a -volreg_tlrc_warp -blur_size \

4.0 -regress_stim_times \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor.txt \

-regress_stim_labels NonRevP_learn_corr_fed NonRevP_learn_corr \

NonRevP_learn_incor_fed NonRevP_learn_incor NonRevP_perf_corr_fed \

NonRevP_perf_corr NonRevP_perf_incor_fed NonRevP_perf_incor \

RevP_acq_corr_fed RevP_acq_corr RevP_acq_incor_fed RevP_acq_incor \

RevP_rev_corr_fed RevP_rev_corr RevP_rev_incor_fed RevP_rev_incor \

-regress_basis dmBLOCK -regress_stim_types AM1 -regress_censor_motion \

2.0 -regress_censor_outliers 0.1 -regress_apply_mot_types demean deriv \

-regress_motion_per_run -regress_make_ideal_sum sum_ideal.1D \

-regress_est_blur_epits -regress_est_blur_errts -regress_run_clustsim no

Anat.PNG

Hi Tamara,

If there is difficulty with an affine registration with that anatomy,
the non-linear one would not be reliable, and it could well be
disasterous. It would indeed be a good idea to at least try
@SSwarper, to see how it does.

Another option might be to run 3danisosmooth on the anat, and
see whether that helps in the registration.

  • rick

Thank you Rick. I ran @SSwarper and the jpeg files look reasonable. When I tried to feed the inputs back into my afni_proc.py script however, it resulted in an error message indicating that the +tlrc warp dataset was missing. It seems afni_proc.py was trying to find the file “anatQQ.MNI152_2009_template_SSW.nii.gz+tlrc” which I don’t have.

Would it be safe to replace the endings ( “+tlrc” with “.nii”) as the anatQQ.MNI152_2009_template_SSW.nii.gz.nii is the skull stripped and warped file?

afni_proc.py script I altered:

-tcat_remove_first_trs 0 -tlrc_base MNI152_2009_template_SSW.nii.gz -tlrc_NL_warp -tlrc_NL_warped_dsets anatQQ.MNI152_2009_template_SSW.nii.gz.nii anatQQ.MNI152_2009_template_SSW.nii.gz.aff12.1D anatQQ.MNI152_2009_template_SSW.nii.gz_WARP.nii
-volreg_align_to last -volreg_align_e2a -volreg_tlrc_warp -blur_size
4.0 -regress_stim_times \

Thank you!
Tamara

Hi, Tamara-

I think I have run into that error due to the ordering of the blocks when using -volreg_tlrc_warp. What is your full afni_proc.py command?

Here is just the @SSwarper and the alignment parts of an afni_proc.py script I had run-- note the order of “align tlrc volreg” blocks with the present flags.


\mkdir -p $owarp

@SSwarper                   \
    -input  $anat           \
    -base   $templ          \
    -subid  $subj           \
    -odir   $owarp

# run afni_proc
afni_proc.py -subj_id TEST$subj                                  \
        -script test_b0.$subj -scr_overwrite                     \
        -blocks  align tlrc volreg                               \
        -copy_anat   $owarp/anatSS.${subj}.nii                   \
        -dsets       $inb0                                       \
        -anat_has_skull no                                       \
        -volreg_align_to first                                   \
        -volreg_align_e2a -volreg_tlrc_warp                      \
        -tlrc_base $templ                                        \
        -tlrc_NL_warp                                            \
        -tlrc_NL_warped_dsets                                    \
             $owarp/anatQQ.${subj}.nii                           \
             $owarp/anatQQ.${subj}.aff12.1D                      \
             $owarp/anatQQ.${subj}_WARP.nii                      \
        -execute

Please check that with the ordering of your blocks.

–pt

Below is my full script. I tried to re-order my blocks by putting the volreg blocks prior to the tlrc_NL blocks but I am still receiving the same error message

Script:

afni_proc.py -subj_id SSwarp_proc_9409 -script SSwarp_proc_9409
-scr_overwrite -blocks tshift align tlrc volreg blur mask scale regress
-copy_anat /home/bmiadmin/Tamara/PRR_Analysis/9409/9409.anat+orig
-dsets /home/bmiadmin/Tamara/PRR_Analysis/9409/9409.1+orig.HEAD
/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.2+orig.HEAD
/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.3+orig.HEAD
/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.4+orig.HEAD
-tcat_remove_first_trs 0
-volreg_align_to last -volreg_align_e2a -volreg_tlrc_warp
-tlrc_base MNI152_2009_template_SSW.nii.gz
-tlrc_NL_warp -tlrc_NL_warped_dsets
anatQQ.MNI152_2009_template_SSW.nii.gz.nii
anatQQ.MNI152_2009_template_SSW.nii.gz.aff12.1D
anatQQ.MNI152_2009_template_SSW.nii.gz_WARP.nii
-blur_size 4.0 -regress_stim_times
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor_fed.txt
/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor.txt
-regress_stim_labels NonRevP_learn_corr_fed NonRevP_learn_corr
NonRevP_learn_incor_fed NonRevP_learn_incor NonRevP_perf_corr_fed
NonRevP_perf_corr NonRevP_perf_incor_fed NonRevP_perf_incor
RevP_acq_corr_fed RevP_acq_corr RevP_acq_incor_fed RevP_acq_incor
RevP_rev_corr_fed RevP_rev_corr RevP_rev_incor_fed RevP_rev_incor
-regress_basis dmBLOCK -regress_stim_types AM1 -regress_censor_motion
2.0 -regress_censor_outliers 0.1 -regress_apply_mot_types demean deriv
-regress_motion_per_run -regress_make_ideal_sum sum_ideal.1D
-regress_est_blur_epits -regress_est_blur_errts -regress_run_clustsim no

Hi, Tamara-

It would be useful to have the exact, copy+pasted error message you are receiving, actually.

@SSwarper outputs *.nii files (and aff12.1D files), and I have used its results fine in afni_proc.py previously, so I don’t think that naming should be a problem.

Some notes on that afni_proc.py command:

First, a sidenote: Probably it would be preferable to use MIN_OUTLIERS as the “-volreg_align_to …” value:


-volreg_align_to MIN_OUTLIERS

since that should hopefully be a non-corrupted volume in general.

After running @SSwarper, your “-copy_anat …” should be the thing output by @SSwarper; probably based on your other SSwarper output file names, I’m guessing:


anatSS.MNI152_2009_template_SSW.nii

Does that exist?

And then you would want to include this:


-anat_has_skull no                                       \

because you have run the skullstripping program already on the input.

Is it possible that it can’t find the MNI152_2009_template_SSW.nii.gz template file-- is that in a different directory, and not somewhere automatic that AFNI can find it? What is the output of:


@FindAfniDsetPath MNI152_2009_template_SSW.nii.gz

–pt

Thank you for your reply. I think it has to do with my @SSwarper script possibly?

I downloaded the MNI152_2009_template_SSW.nii.gz template and put it into the subjects folder. This is where I am running my @SSwarper code.

This is the current code I am using for @SSwarper.
@SSwarper
9409.anat+orig
MNI152_2009_template_SSW.nii.gz
9409

Thank you again for your assistance. I really appreciate it.

Best,
Tamara

Hi, Tamara-

Could you please paste the full output of the errors that afni_proc.py is giving you?

Please also paste what is returned by:


afni -ver

Without these outputs, it will be impossible to know what afni_proc.py is having troubles with.

If @SSwarper has run, then its outputs should be usable by afni_proc.py fine.

Another sidenote for future reference:
@SSwarper’s syntax has changed. It used to be that the user only input the anatomical and possibly a prefix, and one specific MNI template was used. Now, to increase flexibility, it uses command line options to input a reference “base” data set (each of those includes “SSW” in the name, to flag their significance for this purpose), specify the input data set, etc. These option flags are:


-base   -input  -minp   -odir   -subid

So, if you ran @SSwarper successfully without those, that is fine-- the output data sets are the same as before, it’s just that now you can send outputs to a different directory, etc. The switch to @SSwarper was advertised in the “AFNI_DIGEST” list email (which every AFNI user should subscribe to, in my opinion) a month before the change, and then the new version with options was added to AFNI on July 1, 2018.

Part of the reason I mention the old-vs-new @SSwarper is because it looks like you are trying to combine “new” @SSwarper usage (specifying the reference base data set) wtih the old program; in the present case, “MNI152_2009_template_SSW.nii.gz” is being treated as a subject-ID by @SSwarper, not a target. That is why the output files have that in it, and the extensions look a bit funny: “.nii.gz.nii”

–pt

Thank you for the clarification! I will subscript to the email list so I am up to date with AFNI software.

When I run afni -ver I get the following output:

Precompiled binary linux_ubuntu_16_64: Apr 30 2018 (Version AFNI_18.1.09)

My afni_proc.py script is:

script generated by the command:

afni_proc.py -subj_id SSwarp_proc_9409_aug30 -script SSwarp_proc_9409_aug30 \

-scr_overwrite -blocks tshift align tlrc volreg blur mask scale regress \

-copy_anat \

/home/bmiadmin/Tamara/PRR_Analysis/9409/anatSS.MNI152_2009_template_SSW.nii.gz.nii \

-dsets /home/bmiadmin/Tamara/PRR_Analysis/9409/9409.1+orig.HEAD \

/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.2+orig.HEAD \

/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.3+orig.HEAD \

/home/bmiadmin/Tamara/PRR_Analysis/9409/9409.4+orig.HEAD \

-anat_has_skull no -tcat_remove_first_trs 0 -volreg_align_to last \

-volreg_align_e2a -volreg_tlrc_warp -tlrc_base \

MNI152_2009_template_SSW.nii -tlrc_NL_warp -tlrc_NL_warped_dsets \

anatQQ.MNI152_2009_template_SSW.nii.gz.nii \

anatQQ.MNI152_2009_template_SSW.nii.gz.aff12.1D \

anatQQ.MNI152_2009_template_SSW.nii.gz_WARP.nii -blur_size 4.0 \

-regress_stim_times \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor_fed.txt \

/home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor.txt \

-regress_stim_labels NonRevP_learn_corr_fed NonRevP_learn_corr \

NonRevP_learn_incor_fed NonRevP_learn_incor NonRevP_perf_corr_fed \

NonRevP_perf_corr NonRevP_perf_incor_fed NonRevP_perf_incor \

RevP_acq_corr_fed RevP_acq_corr RevP_acq_incor_fed RevP_acq_incor \

RevP_rev_corr_fed RevP_rev_corr RevP_rev_incor_fed RevP_rev_incor \

-regress_basis dmBLOCK -regress_stim_types AM1 -regress_censor_motion \

2.0 -regress_censor_outliers 0.1 -regress_apply_mot_types demean deriv \

-regress_motion_per_run -regress_make_ideal_sum sum_ideal.1D \

-regress_est_blur_epits -regress_est_blur_errts -regress_run_clustsim no

The Error Message in the terminal:

-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /usr/local/freesurfer
FSFAST_HOME /usr/local/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR /home/bmiadmin/subjects
MNI_DIR /usr/local/freesurfer/mni
SUBJECTS_DIR= /home/bmiadmin/subjects
mitchelllab-linux:~/Tamara/PRR_Analysis/9409> tcsh -xef SSwarp_proc_9409_aug30 |& tee output.SSwarp_proc_9409_aug30
echo auto-generated by afni_proc.py, Thu Aug 30 09:45:30 2018
auto-generated by afni_proc.py, Thu Aug 30 09:45:30 2018
echo (version 6.10, Apr 26, 2018)
(version 6.10, Apr 26, 2018)
echo execution started: date
date
execution started: Thu Aug 30 09:55:40 EDT 2018
afni -ver
Precompiled binary linux_ubuntu_16_64: Apr 30 2018 (Version AFNI_18.1.09)
afni_history -check_date 23 Mar 2018
– is current: afni_history as new as: 23 Mar 2018
most recent entry is: 29 Apr 2018
if ( 0 ) then
if ( 0 > 0 ) then
set subj = SSwarp_proc_9409_aug30
endif
set output_dir = SSwarp_proc_9409_aug30.results
if ( -d SSwarp_proc_9409_aug30.results ) then
set runs = ( count -digits 2 1 4 )
count -digits 2 1 4
mkdir SSwarp_proc_9409_aug30.results
mkdir SSwarp_proc_9409_aug30.results/stimuli
cp /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_corr.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_learn_incor.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_corr.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/NonRevP_perf_incor.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_corr.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_acq_incor.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_corr.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor_fed.txt /home/bmiadmin/Tamara/PRR_Analysis/9409/RevP_rev_incor.txt SSwarp_proc_9409_aug30.results/stimuli
3dcopy anatSS.MNI152_2009_template_SSW.nii.gz.nii SSwarp_proc_9409_aug30.results/anatSS.MNI152_2009_template_SSW.nii.gz
++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
3dcopy anatQQ.MNI152_2009_template_SSW.nii.gz.nii SSwarp_proc_9409_aug30.results/anatQQ.MNI152_2009_template_SSW.nii.gz
++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
3dcopy anatQQ.MNI152_2009_template_SSW.nii.gz.aff12.1D SSwarp_proc_9409_aug30.results/anatQQ.MNI152_2009_template_SSW.nii.gz.aff12.1D
++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
3dcopy anatQQ.MNI152_2009_template_SSW.nii.gz_WARP.nii SSwarp_proc_9409_aug30.results/anatQQ.MNI152_2009_template_SSW.nii.gz_WARP.nii
++ 3dcopy: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
3dTcat -prefix SSwarp_proc_9409_aug30.results/pb00.SSwarp_proc_9409_aug30.r01.tcat 9409.1+orig[0…$]
++ 3dTcat: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ elapsed time = 0.2 s
3dTcat -prefix SSwarp_proc_9409_aug30.results/pb00.SSwarp_proc_9409_aug30.r02.tcat 9409.2+orig[0…$]
++ 3dTcat: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ elapsed time = 0.2 s
3dTcat -prefix SSwarp_proc_9409_aug30.results/pb00.SSwarp_proc_9409_aug30.r03.tcat 9409.3+orig[0…$]
++ 3dTcat: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ elapsed time = 0.2 s
3dTcat -prefix SSwarp_proc_9409_aug30.results/pb00.SSwarp_proc_9409_aug30.r04.tcat 9409.4+orig[0…$]
++ 3dTcat: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ elapsed time = 0.2 s
set tr_counts = ( 153 153 153 153 )
cd SSwarp_proc_9409_aug30.results
touch out.pre_ss_warn.txt
foreach run ( 01 02 03 04 )
3dToutcount -automask -fraction -polort 3 -legendre pb00.SSwarp_proc_9409_aug30.r01.tcat+orig
++ 3dToutcount: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./pb00.SSwarp_proc_9409_aug30.r01.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.SSwarp_proc_9409_aug30.r01.tcat+orig.BRIK is 3.359754 degrees from plumb.
++ 107968 voxels passed mask/clip
1deval -a outcount.r01.1D -expr 1-step(a-0.1)
if ( 1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)" ) then
1deval -a outcount.r01.1D{0} -expr step(a-0.4)
end
3dToutcount -automask -fraction -polort 3 -legendre pb00.SSwarp_proc_9409_aug30.r02.tcat+orig
++ 3dToutcount: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./pb00.SSwarp_proc_9409_aug30.r02.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.SSwarp_proc_9409_aug30.r02.tcat+orig.BRIK is 3.359754 degrees from plumb.
++ 108219 voxels passed mask/clip
1deval -a outcount.r02.1D -expr 1-step(a-0.1)
if ( 1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)" ) then
1deval -a outcount.r02.1D{0} -expr step(a-0.4)
end
3dToutcount -automask -fraction -polort 3 -legendre pb00.SSwarp_proc_9409_aug30.r03.tcat+orig
++ 3dToutcount: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./pb00.SSwarp_proc_9409_aug30.r03.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.SSwarp_proc_9409_aug30.r03.tcat+orig.BRIK is 3.359754 degrees from plumb.
++ 108215 voxels passed mask/clip
1deval -a outcount.r03.1D -expr 1-step(a-0.1)
if ( 1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)" ) then
1deval -a outcount.r03.1D{0} -expr step(a-0.4)
end
3dToutcount -automask -fraction -polort 3 -legendre pb00.SSwarp_proc_9409_aug30.r04.tcat+orig
++ 3dToutcount: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./pb00.SSwarp_proc_9409_aug30.r04.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.SSwarp_proc_9409_aug30.r04.tcat+orig.BRIK is 3.359754 degrees from plumb.
++ 107669 voxels passed mask/clip
1deval -a outcount.r04.1D -expr 1-step(a-0.1)
if ( 1deval -a outcount.r$run.1D"{0}" -expr "step(a-0.4)" ) then
1deval -a outcount.r04.1D{0} -expr step(a-0.4)
end
cat outcount.r01.1D outcount.r02.1D outcount.r03.1D outcount.r04.1D
cat rm.out.cen.r01.1D rm.out.cen.r02.1D rm.out.cen.r03.1D rm.out.cen.r04.1D
foreach run ( 01 02 03 04 )
3dTshift -tzero 0 -quintic -prefix pb01.SSwarp_proc_9409_aug30.r01.tshift pb00.SSwarp_proc_9409_aug30.r01.tcat+orig
++ 3dTshift: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./pb00.SSwarp_proc_9409_aug30.r01.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.SSwarp_proc_9409_aug30.r01.tcat+orig.BRIK is 3.359754 degrees from plumb.
end
3dTshift -tzero 0 -quintic -prefix pb01.SSwarp_proc_9409_aug30.r02.tshift pb00.SSwarp_proc_9409_aug30.r02.tcat+orig
++ 3dTshift: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./pb00.SSwarp_proc_9409_aug30.r02.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.SSwarp_proc_9409_aug30.r02.tcat+orig.BRIK is 3.359754 degrees from plumb.
end
3dTshift -tzero 0 -quintic -prefix pb01.SSwarp_proc_9409_aug30.r03.tshift pb00.SSwarp_proc_9409_aug30.r03.tcat+orig
++ 3dTshift: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./pb00.SSwarp_proc_9409_aug30.r03.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.SSwarp_proc_9409_aug30.r03.tcat+orig.BRIK is 3.359754 degrees from plumb.
end
3dTshift -tzero 0 -quintic -prefix pb01.SSwarp_proc_9409_aug30.r04.tshift pb00.SSwarp_proc_9409_aug30.r04.tcat+orig
++ 3dTshift: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./pb00.SSwarp_proc_9409_aug30.r04.tcat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./pb00.SSwarp_proc_9409_aug30.r04.tcat+orig.BRIK is 3.359754 degrees from plumb.
end
3dbucket -prefix vr_base pb01.SSwarp_proc_9409_aug30.r04.tshift+orig[152]
++ 3dbucket: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
align_epi_anat.py -anat2epi -anat anatSS.MNI152_2009_template_SSW.nii.gz+orig -suffix _al_junk -epi vr_base+orig -epi_base 0 -epi_strip 3dAutomask -anat_has_skull no -volreg off -tshift off
#++ align_epi_anat version: 1.58
#++ turning off volume registration
** ERROR: Could not find anat / dset1 dataset
/home/bmiadmin/Tamara/PRR_Analysis/9409/SSwarp_proc_9409_aug30.results/anatSS.MNI152_2009_template_SSW.nii.gz+orig
** ERROR - script failed
mitchelllab-linux:~/Tamara/PRR_Analysis/9409>

Hi, Tamara-

Thanks very much for posting those details-- I do see what the problem is right now. I think it is extremely subtle.

I think it has to do with the fact that the outputs of @SSwarper in this case have a funny name ending with multiple volumetric file extensions: instead of being just “.nii.gz” or “.nii”, they are “.nii.gz.nii”.

afni_proc.py can find the initial datasets and copy them-- at this stage, it is trying to change them to BRIK/HEAD format (because that is what afni_proc.py uses), but the “SS” anat here is staying NIFTI because it has two layers of NIFTI extensions!

OK, so to solve this in the present case, you should be able to rename the files that have 2 layers of extensions. I will suggest:


3dcopy anatSS.MNI152_2009_template_SSW.nii.gz.nii anatSS.fixedname.nii
3dcopy anatQQ.MNI152_2009_template_SSW.nii.gz.nii anatQQ.fixedname.nii

Note that that I don’t think the other two files from SSwarper need to be renamed:

  • “anatQQ.MNI152_2009_template_SSW.nii.gz.aff12.1D” is just a text file of linear affine transformation values-- doesn’t get renamed
  • “anatQQ.MNI152_2009_template_SSW.nii.gz_WARP.nii” still has a funny name with the NIFTI extensions buried inside, but at the end it only has one extension (because the “_WARP” string is sitting there).

Once you have renamed the two problematic files and replaced their name in the afni_proc.py script, you should be good to go.

Note also that in the future, using @SSwarper you can avoid this problem with the newer version of @SSwarper, which makes clearer what parts of the inputs are file names and what are paths/etc. In your present/old version, the syntax for inputs is:


@SSwarper T1dataset SubID [minp]

so you can see that the 2nd argument for the program is not the name of a target file, but instead the “subject ID”.

–pt

That worked! Thank you so much!! I assume that since I have the old @SSwarper, I am utilizing the MNI152_2009_template.nii.gz which has 1 volume instead of the MNI152_2009_template_SSW.nii.gz which has several?

Interestingly, I did try using the “old” syntax and @SSwarper wouldn’t run. It seemed to be taking an awfully long time and produced several “junk” files. I have pasted the code I used and the terminal output below. If it is not an issue to use the “new” code, changing the name of my output files and then running afni_proc.py, I will continue doing this.

Thank you again for your assistance!

SSwarper code:

@SSwarper
11987.anat+orig
11987

SSwarper output (not working)

-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /usr/local/freesurfer
FSFAST_HOME /usr/local/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR /home/bmiadmin/subjects
MNI_DIR /usr/local/freesurfer/mni
SUBJECTS_DIR= /home/bmiadmin/subjects
mitchelllab-linux:~/Tamara/PRR_Analysis/11987> @SSwarper
? 11987.anat+orig
? 11987
SUBJECTS_DIR= /home/bmiadmin/subjects
++ 3dUnifize: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./11987.anat+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./11987.anat+orig.BRIK is 0.142653 degrees from plumb.

  • Pre-processing: ADV…UWG
    ++ Output dataset ./anatU.11987.nii
    ++ ===== Elapsed = 23.3 sec
    ++ Notice SUMA_BrainWrap_ParseInput (SUMA_3dSkullStrip.c:1219 @14:36:45):
    Setting fill_hole to 10
    ++ Notice 3dSkullStrip (SUMA_3dSkullStrip.c:1529 @14:36:45):
    Loading dset, performing Spatial Normalization
    *+ WARNING: If you are performing spatial transformations on an oblique dset,
    such as anatU.11987.nii,
    or viewing/combining it with volumes of differing obliquity,
    you should consider running:
    3dWarp -deoblique
    on this and other oblique datasets in the same session.
    See 3dWarp -help for details.
    ++ Oblique dataset:anatU.11987.nii is 0.142653 degrees from plumb.
    3dSkullStrip:
    Original resolution 1.000002, -1.000002, 1.000003
    SpatNorm resolution 1.000002, 1.000002, 1.000003
    ++mri_brainormalize: normalizing
    ++mri_brainormalize: top clip above slice 254
    ++mri_brainormalize: bot clip below slice 84
    ++mri_brainormalize: Rescaling.
    ++mri_brainormalize: Eroding, clustering …
  • Eroded 362572 voxels
  • Restored 300359 eroded voxels
  • Clustering voxels …
  • Largest cluster has 3188439 voxels
  • Clustering voxels …
  • Largest cluster has 2979588 voxels
    ++mri_brainormalize: Clipping extreme values.
  • scaling by fac=0.0524691
    3dSkullStrip: -spatnorm: Expecting 6195700 voxels in in_vol dset (167 212 175)
    3dSkullStrip: Edge threshold set to 47.128998. (minimum acceptable was 22.842131)
    (92.000000 percentile =47.128998, 99.999001 percentile = 228.421310)
    3dSkullStrip: Prepping volume…
    SUMA_LoadPrepInVol: Volume 3213642.000000, radius 91.545380
    3dSkullStrip: Beginning brain extraction…
    3dSkullStrip: Have surface, OK for 1st entry.
    3dSkullStrip: Stretching to avoid ventricles.
    SO->Center is [1.055698 16.702696 -12.525011]
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: satiated, low MaxExp
    SUMA_StretchToFitLeCerveau:
    reducing tightness, applying touchup with Stage2Type = 1
    SUMA_StretchToFitLeCerveau:
    Stage 2, type 1: 3650 troubled nodes, going for more…
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: satiated, low MaxExp
    SUMA_StretchToFitLeCerveau:
    reducing tightness, applying touchup with Stage2Type = 1
    SUMA_StretchToFitLeCerveau:
    Stage 2, type 1: 0.100822 change in troubled nodes.
    SUMA_StretchToFitLeCerveau:
    Continuing with Stage.
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: pastarea = 79507.312004
    SUMA_StretchToFitLeCerveau:
    Stage1: MaxExp = 0.683446, darea = 0.000000, going for more…
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: satiated, small area differential.
    SUMA_StretchToFitLeCerveau:
    reducing tightness, applying touchup with Stage2Type = 1
    SUMA_StretchToFitLeCerveau:
    Stage 2, type 1: 0.086837 change in troubled nodes.
    SUMA_StretchToFitLeCerveau:
    Continuing with Stage.
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: satiated, small area differential.
    SUMA_StretchToFitLeCerveau:
    reducing tightness, applying touchup with Stage2Type = 1
    SUMA_StretchToFitLeCerveau:
    Stage 2, type 1: 0.025359 change in troubled nodes.
    SUMA_StretchToFitLeCerveau:
    Continuing with Stage.
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: satiated, small area differential.
    SUMA_StretchToFitLeCerveau:
    reducing tightness, applying touchup with Stage2Type = 1
    SUMA_StretchToFitLeCerveau:
    Stage 2, type 1: 0.039028 change in troubled nodes.
    SUMA_StretchToFitLeCerveau:
    Continuing with Stage.
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: satiated, small area differential.
    SUMA_StretchToFitLeCerveau:
    reducing tightness, applying touchup with Stage2Type = 1
    SUMA_StretchToFitLeCerveau:
    Stage 2, type 1: 0.014250 change in troubled nodes.
    SUMA_StretchToFitLeCerveau:
    Continuing with Stage.
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: satiated, small area differential.
    SUMA_StretchToFitLeCerveau:
    reducing tightness, applying touchup with Stage2Type = 1
    SUMA_StretchToFitLeCerveau:
    Stage 2, type 1: 0.000723 change in troubled nodes.
    SUMA_StretchToFitLeCerveau:
    Stage converged. Moving to new Stage or Type.
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: satiated, small area differential.
    SUMA_StretchToFitLeCerveau:
    Stage 3, type 2: 1.000000 change in troubled nodes.
    SUMA_StretchToFitLeCerveau:
    Continuing with Stage.
    3dSkullStrip: Checking for self intersection…
    3dSkullStrip: No intersections found.
    3dSkullStrip: Final smoothing of 72
    3dSkullStrip: Touchup correction, pass 1 …
    3dSkullStrip: The beauty treatment smoothing.
    3dSkullStrip: Locating voxels inside surface …
    3dSkullStrip: Setting output to orig_vol (iset = 0x2baece8) (osnd = 0x3d84c98)…
    3dSkullStrip: Coercing…
    3dSkullStrip: Writing masked volume …
    3dSkullStrip: Applying a bit of erosion and dilatation
    ++ OpenMP thread count = 8
    ++ 3dQwarp: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: Zhark the (Hermite) Cubically Warped
    *+ WARNING: If you are performing spatial transformations on an oblique dset,
    such as anatU.11987.nii,
    or viewing/combining it with volumes of differing obliquity,
    you should consider running:
    3dWarp -deoblique
    on this and other oblique datasets in the same session.
    See 3dWarp -help for details.
    ++ Oblique dataset:anatU.11987.nii is 0.142653 degrees from plumb.
    ++ Starting 3dAllineate (affine register) command:
    3dAllineate -base /home/bmiadmin/abin/MNI152_2009_template.nii.gz[1] -source anatU.11987.nii -prefix AFN_vA68B827xfMNFbMsh9wpPA.nii -1Dmatrix_save AFN_vA68B827xfMNFbMsh9wpPA -cmass -final wsinc5 -float -master BASE -twobest 7 -zclip -fineblur 4.44

++ ###########################################################
++ 3dAllineate: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: Zhark the Registrator
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as anatU.11987.nii,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:anatU.11987.nii is 0.142653 degrees from plumb.
++ Source dataset: ./anatU.11987.nii
++ Base dataset: /home/bmiadmin/abin/MNI152_2009_template.nii.gz
++ Loading datasets
++ 6527249 voxels in source_automask+0
++ Zero-pad: ybot=0 ytop=1
++ Computing -autobox
++ 8007930 voxels [93.5%] in weight mask
++ Number of points for matching = 3763727
++ NOTE: base and source coordinate systems have different handedness

  •   Orientations: base=Right handed (LPI); source=Left handed (ASR)
    

++ OpenMP thread count = 8
++ ======= Allineation of 1 sub-bricks using Hellinger metric =======
++ *** Coarse pass begins ***
++ *** Fine pass begins ***

  • Final fine fit Parameters:
    x-shift=-1.8165 y-shift=-20.5583 z-shift= 5.4606
    z-angle= 1.1994 x-angle= 9.2621 y-angle= 2.9879
    x-scale= 0.9036 y-scale= 0.9894 z-scale= 0.8789
    y/x-shear= 0.0144 z/x-shear=-0.0205 z/y-shear=-0.0852
    ++ Output dataset ./AFN_vA68B827xfMNFbMsh9wpPA.nii
    ++ Wrote -1Dmatrix_save AFN_vA68B827xfMNFbMsh9wpPA.aff12.1D
    ++ 3dAllineate: total CPU time = 0.0 sec Elapsed = 379.2
    ++ ###########################################################
    ++ # Please check results visually for alignment quality #
    ++ ###########################################################

++ 3dQwarp: replacing source dataset with 3dAllineate result junk.SSwarper.HCjcBWREg5A_TAL5_Allin.nii

  • 3dAllineate output files have been renamed

mat44 3dAllineate matrix:

  0.901998      0.026467     -0.046485      -1.816440
 -0.007442      0.976627      0.158569     -20.558300
  0.031974     -0.224018      0.853645       5.460660

++ Dataset zero-pad: xbot=24 xtop=23 ybot=18 ytop=27 zbot=24 ztop=18 voxels
++ +++++++++++ Begin warp optimization: base=/home/bmiadmin/abin/MNI152_2009_template.nii.gz source=./junk.SSwarper.HCjcBWREg5A_TAL5_Allin.nii
++ AFNI warpomatic: 240 x 274 x 235 volume ; autobbox = 30…209 31…243 30…204 [clock= 6m 21s 916ms]
lev=0 8…231 5…269 9…225: [first cost=-0.44210] … done [cost:-0.44210==>-0.55226]
lev=1 patch=181x207x177 [clock= 8m 24s 617ms]… done [cost:-0.55226==>-0.58763 ; 8 patches optimized, 0 skipped]
lev=2 patch=135x155x133 [clock= 13m 59s 902ms]… done [cost:-0.58763==>-0.65361 ; 21 patches optimized, 6 skipped]
lev=3 patch=101x117x99 [clock= 20m 15s 777ms]… done [cost:-0.65361==>-0.71383 ; 39 patches optimized, 25 skipped]
lev=4 patch=77x87x75 [clock= 24m 58s 612ms]… done [cost:-0.71383==>-0.77934 ; 80 patches optimized, 45 skipped]
lev=5 patch=57x65x57 [clock= 29m 25s 560ms]… done [cost:-0.77934==>-0.83808 ; 160 patches optimized, 92 skipped]
++ ========== total number of parameters ‘optimized’ = 7497
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_TAL5_AWARP.nii
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_TAL5.nii
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_TAL5_WARP.nii
++ Inverting warp *******…:…
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_TAL5_WARPINV.nii
++ ===== clock time = 33m 44s 865ms
++ no -frac option: defaulting to -union
++ processing 1 input datasets…
++ padding all datasets by 1 (for dilations)
++ frac 0 over 1 volumes gives min count 0
++ voxel limits: 0 clipped, 2000189 survived, 6529832 were zero
++ writing result junk.SSwarper.HCjcBWREg5A_MASK.nii…
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_MASK.nii
++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_TAL5mm.nii
++ 3dNwarpApply: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: Zhark the Warped
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as anatS.11987.nii,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:anatS.11987.nii is 0.142653 degrees from plumb.
++ -master dataset is ‘anatS.11987.nii’
** AFNI converts NIFTI_datatype=2 (UINT8) in file junk.SSwarper.HCjcBWREg5A_TAL5mm.nii to FLOAT32
Warnings of this type will be muted for this session.
Set AFNI_NIFTI_TYPE_WARN to YES to see them all, NO to see none.
++ opened source dataset ‘junk.SSwarper.HCjcBWREg5A_TAL5mm.nii’
++ Processing -nwarp
++ Warping:.Z
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_TAL5ww.nii
++ total Elapsed time = 13.5 sec
++ no -frac option: defaulting to -union
++ processing 1 input datasets…
++ padding all datasets by 2 (for dilations)
++ frac 0 over 1 volumes gives min count 0
++ voxel limits: 0 clipped, 2117569 survived, 6412452 were zero
++ writing result junk.SSwarper.HCjcBWREg5A_MASK.nii…
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_MASK.nii
++ 3dNwarpApply: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: Zhark the Warped
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as anatS.11987.nii,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:anatS.11987.nii is 0.142653 degrees from plumb.
++ -master dataset is ‘anatS.11987.nii’
++ opened source dataset ‘junk.SSwarper.HCjcBWREg5A_MASK.nii’
++ Processing -nwarp
++ Warping:.Z
++ Output dataset ./junk.SSwarper.HCjcBWREg5A_MASKO.nii
++ total Elapsed time = 11.0 sec
++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: A cast of thousands
*+ WARNING: dataset ‘b’=junk.SSwarper.HCjcBWREg5A_TAL5ww.nii has an obliquity difference of 0.142653 degrees with anatS.11987.nii
*+ WARNING: dataset ‘c’=junk.SSwarper.HCjcBWREg5A_MASKO.nii has an obliquity difference of 0.142653 degrees with anatS.11987.nii
++ Output dataset ./anatSS.11987.nii
++ 3dAllineate: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: Zhark the Registrator
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as anatSS.11987.nii,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:anatSS.11987.nii is 0.142653 degrees from plumb.
** AFNI converts NIFTI_datatype=2 (UINT8) in file junk.SSwarper.HCjcBWREg5A_TAL5mm.nii to FLOAT32
Warnings of this type will be muted for this session.
Set AFNI_NIFTI_TYPE_WARN to YES to see them all, NO to see none.
++ Source dataset: ./anatSS.11987.nii
++ Base dataset: (not given)
++ Loading datasets
++ OpenMP thread count = 8
++ ========== Applying transformation to 1 sub-bricks ==========
++ wsinc5 interpolation setup:

  • taper function = Min sidelobe 3 term
  • taper cut point = 0.000
  • window radius = 5 voxels
  • window shape = Cubical
  • The above can be altered via the AFNI_WSINC5_* environment variables.
  • (To avoid this message, ‘setenv AFNI_WSINC5_SILENT YES’.)
  • wsinc5 CUBE(5) mask has 1000 points
    ++ Output dataset ./junk.SSwarper.HCjcBWREg5A_AffSS.nii
    ++ 3dAllineate: total CPU time = 0.0 sec Elapsed = 3.5
    ++ ###########################################################
    ++ OpenMP thread count = 8
    ++ 3dQwarp: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
    ++ Authored by: Zhark the (Hermite) Cubically Warped
    ++ Dataset zero-pad: xbot=24 xtop=23 ybot=18 ytop=27 zbot=24 ztop=18 voxels
    ++ Weightizing the base image
    ++ +++++++++++ Begin warp optimization: base=/home/bmiadmin/abin/MNI152_2009_template.nii.gz source=./junk.SSwarper.HCjcBWREg5A_AffSS.nii
    ++ AFNI warpomatic: 240 x 274 x 235 volume ; autobbox = 43…197 38…228 25…188 [clock= 4s 379ms]
    lev=3 patch=101x117x99 [clock= 5s 628ms][first cost=-1.60012] … done [cost:-1.60012==>-1.70164 ; 16 patches optimized, 11 skipped]
    lev=4 patch=77x87x75 [clock= 2m 20s 979ms][first cost=-1.49978] … done [cost:-1.70164==>-1.54957 ; 37 patches optimized, 27 skipped]
    lev=5 patch=57x65x57 [clock= 4m 44s 493ms][first cost=-1.36680] …:[cost=-1.42939]:… done [cost:-1.54957==>-1.43467 ; 241 patches optimized, 191 skipped]
    lev=6 patch=43x49x43 [clock= 10m 51s 733ms][first cost=-1.28611] …:[cost=-1.34538]:… done [cost:-1.43467==>-1.36036 ; 502 patches optimized, 394 skipped]
    lev=7 patch=33x37x31 [clock= 16m 4s 742ms][first cost=-1.25315] …:[cost=-1.30743]:… done [cost:-1.36036==>-1.29359 ; 1261 patches optimized, 1159 skipped]
    lev=8 patch=25x27x23 [clock= 21m 45s 351ms][first cost=-1.23734] …:[cost=-1.29184]:… done [cost:-1.29359==>-1.23711 ; 3047 patches optimized, 2803 skipped]
    lev=9 patch=19x21x17 [clock= 27m 42s 299ms][first cost=-1.24843] … done [cost:-1.23711==>-1.30319 ; 3425 patches optimized, 3358 skipped]
    lev=10 patch=13x15x13 [clock= 31m 28s 631ms][first cost=-1.26157] …