@SSwarper code running for days?

Hello AFNI,

I was hoping to get some clarification on the appropriate @SSwarper code I should be using.

I have been using the following code to run the @SSwarper:
@SSwarper
11987.anat+orig
MNI152_2009_template.nii.g
11987

However, upon corresponding with an AFNI gurus, I realized that I was running the old @SSwarper and that I could run the following code instead, so that my outputs had my subject ID in them
@SSwarper
11987.anat+orig
11987

I have noticed that when I run the “old” code, it seems to get stuck on during the “warp optimization” section and continues to runs for hours, even days (see the output below). However, when I run the “new” code, it seems to run successfully. Is there a reason why both codes are not working? Is it “okay” if I use the “old” code to run @SSwarper?

Thank you in advance for your help.

Best,
Tamara

Terminal Output of “new” code

-------- 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 = 24.7 sec
    ++ Notice SUMA_BrainWrap_ParseInput (SUMA_3dSkullStrip.c:1219 @09:37:38):
    Setting fill_hole to 10
    ++ Notice 3dSkullStrip (SUMA_3dSkullStrip.c:1529 @09:37:38):
    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 = 0x2f67ce8) (osnd = 0x413ddc8)…
    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_kM6n_IUyylrRJpsHJNwNFg.nii -1Dmatrix_save AFN_kM6n_IUyylrRJpsHJNwNFg -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_kM6n_IUyylrRJpsHJNwNFg.nii
    ++ Wrote -1Dmatrix_save AFN_kM6n_IUyylrRJpsHJNwNFg.aff12.1D
    ++ 3dAllineate: total CPU time = 0.0 sec Elapsed = 758.9
    ++ ###########################################################
    ++ # Please check results visually for alignment quality #
    ++ ###########################################################

++ 3dQwarp: replacing source dataset with 3dAllineate result junk.SSwarper.JLjQnJRzs5c_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.JLjQnJRzs5c_TAL5_Allin.nii
++ AFNI warpomatic: 240 x 274 x 235 volume ; autobbox = 30…209 31…243 30…204 [clock= 12m 41s 7ms]
lev=0 8…231 5…269 9…225: [first cost=-0.44210] … done [cost:-0.44210==>-0.55226]
lev=1 patch=181x207x177 [clock= 15m 0s 173ms]… done [cost:-0.55226==>-0.58763 ; 8 patches optimized, 0 skipped]
lev=2 patch=135x155x133 [clock= 22m 0s 790ms]… done [cost:-0.58763==>-0.65361 ; 21 patches optimized, 6 skipped]
lev=3 patch=101x117x99 [clock= 30m 44s 764ms]… done [cost:-0.65361==>-0.71383 ; 39 patches optimized, 25 skipped]
lev=4 patch=77x87x75 [clock= 38m 56s 671ms]… done [cost:-0.71383==>-0.77934 ; 80 patches optimized, 45 skipped]
lev=5 patch=57x65x57 [clock= 48m 38s 759ms]… done [cost:-0.77934==>-0.83808 ; 160 patches optimized, 92 skipped]
++ ========== total number of parameters ‘optimized’ = 7497
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_TAL5_AWARP.nii
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_TAL5.nii
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_TAL5_WARP.nii
++ Inverting warp *******…:…
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_TAL5_WARPINV.nii
++ ===== clock time = 1h 2m 1s 154ms
++ 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.JLjQnJRzs5c_MASK.nii…
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_MASK.nii
++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_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.JLjQnJRzs5c_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.JLjQnJRzs5c_TAL5mm.nii’
++ Processing -nwarp
++ Warping:.Z
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_TAL5ww.nii
++ total Elapsed time = 16.1 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.JLjQnJRzs5c_MASK.nii…
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_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.JLjQnJRzs5c_MASK.nii’
++ Processing -nwarp
++ Warping:.Z
++ Output dataset ./junk.SSwarper.JLjQnJRzs5c_MASKO.nii
++ total Elapsed time = 12.9 sec
++ 3dcalc: AFNI version=AFNI_18.1.09 (Apr 30 2018) [64-bit]
++ Authored by: A cast of thousands
*+ WARNING: dataset ‘b’=junk.SSwarper.JLjQnJRzs5c_TAL5ww.nii has an obliquity difference of 0.142653 degrees with anatS.11987.nii
*+ WARNING: dataset ‘c’=junk.SSwarper.JLjQnJRzs5c_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.JLjQnJRzs5c_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.JLjQnJRzs5c_AffSS.nii
    ++ 3dAllineate: total CPU time = 0.0 sec Elapsed = 4.7
    ++ ###########################################################
    ++ 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.JLjQnJRzs5c_AffSS.nii
    ++ AFNI warpomatic: 240 x 274 x 235 volume ; autobbox = 43…197 38…228 25…188 [clock= 4s 502ms]
    lev=3 patch=101x117x99 [clock= 5s 835ms][first cost=-1.60012] … done [cost:-1.60012==>-1.70164 ; 16 patches optimized, 11 skipped]
    lev=4 patch=77x87x75 [clock= 3m 44s 613ms][first cost=-1.49978] … done [cost:-1.70164==>-1.54957 ; 37 patches optimized, 27 skipped]
    lev=5 patch=57x65x57 [clock= 8m 34s 153ms][first cost=-1.36680] …:[cost=-1.42939]:… done [cost:-1.54957==>-1.43467 ; 241 patches optimized, 191 skipped]
    lev=6 patch=43x49x43 [clock= 27m 34s 82ms][first cost=-1.28611] …:[cost=-1.34538]:… done [cost:-1.43467==>-1.36036 ; 502 patches optimized, 394 skipped]
    lev=7 patch=33x37x31 [clock= 55m 56s 639ms][first cost=-1.25315] …:[cost=-1.30743]:… done [cost:-1.36036==>-1.29359 ; 1261 patches optimized, 1159 skipped]
    lev=8 patch=25x27x23 [clock= 1h 55m 43s 500ms][first cost=-1.23734] …:[cost=-1.29184]:… done [cost:-1.29359==>-1.23711 ; 3047 patches optimized, 2803 skipped]
    lev=9 patch=19x21x17 [clock= 4h 56m 14s 36ms][first cost=-1.24843] … done [cost:-1.23711==>-1.30319 ; 3425 patches optimized, 3358 skipped]
    lev=10 patch=13x15x13 [clock= 9h 4m 17s 462ms][first cost=-1.26157] … done [cost:-1.30319==>-1.22053 ; 9329 patches optimized, 9625 skipped]
    lev=11 patch=11x11x11 [clock= 15h 21m 58s 97ms][first cost=-1.26638] …

Hi, Tamara-

Please note that actually there is a newer (and better) syntax for using @SSwarper since the start of July, as described in this post:
https://afni.nimh.nih.gov/afni/community/board/read.php?1,158536,158536

From the pre-July version of @SSwarper’s helpfile, the syntax is:


------------------------------------------------------------------------------------------
Usage: @SSwarper T1dataset SubID [minp]

T1dataset = a T1-weighted dataset, not skull-stripped,
            with resolution about 1 mm.
SubID     = name code for output datasets (e.g., 'sub007').
minp      = optional: minimum patch size on final 3dQwarp
                      (if not given, 11 is used)
------------------------------------------------------------------------------------------

and only the specific MNI template could be used as a reference; there is no place for a reference dset to be entered, so it should not be as in your “old” syntax. Whatever the third argument is is probably being interpreted as “minpath”; in your case, what you identify as a subj id is being identified as a minpatch size, and causing woe (I guess).

Note that the modern, post-July version of @SSwarper has nicer syntax, more flexibility of choosing reference datasets, and more “-prefix” functionality:


@SSwarper          \
        -input  AA        \
        -base   BB        \
        -subid  SS        \
       {-odir OD}         \
       {-minp MP}

The processing guts of the program are the same. I would strongly consider the modern @SSwarper because of the syntax/flexibility.

–pt

Great, thank you! I updated the AFNI binaries and used the updated script (pasted below). Out of curiosity, how long does the script take to run? I have been processing this script for nearly 18 hours…

Thank you,
Tamara

Code

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

Terminal output:

-------- 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
? -input 11987.anat+orig
? -base MNI152_2009_template_SSW.nii.gz
? -subid 11987
SUBJECTS_DIR= /home/bmiadmin/subjects
++ Starting: @SSwarper.
++ OMP_NUM_THREADS is: not set by user,
so probably just using one CPU :frowning:

++ Based on input, the output directory will be:
.

++ 3dUnifize: AFNI version=AFNI_18.2.15 (Aug 28 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…UWGm
    ++ Output dataset ./anatU.11987.nii
    ++ ===== Elapsed = 28.8 sec
    ++ Notice SUMA_BrainWrap_ParseInput (SUMA_3dSkullStrip.c:1219 @13:17:37):
    Setting fill_hole to 10
    ++ Notice 3dSkullStrip (SUMA_3dSkullStrip.c:1529 @13:17:37):
    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 236
    ++mri_brainormalize: bot clip below slice 66
    ++mri_brainormalize: Rescaling.
    ++mri_brainormalize: Eroding, clustering …
  • Eroded 299768 voxels
  • Restored 281809 eroded voxels
  • Clustering voxels …
  • Largest cluster has 3614900 voxels
  • Clustering voxels …
  • Largest cluster has 2479512 voxels
    ++mri_brainormalize: Clipping extreme values.
  • scaling by fac=0.052426
    3dSkullStrip: -spatnorm: Expecting 6195700 voxels in in_vol dset (167 212 175)
    3dSkullStrip: Edge threshold set to 47.317593. (minimum acceptable was 19.238853)
    (92.000000 percentile =47.317593, 99.999001 percentile = 192.388535)
    3dSkullStrip: Prepping volume…
    SUMA_LoadPrepInVol: Volume 3693983.000000, radius 95.896378
    3dSkullStrip: Beginning brain extraction…
    3dSkullStrip: Have surface, OK for 1st entry.
    3dSkullStrip: Stretching to avoid ventricles.
    SO->Center is [1.041406 15.081905 -11.377347]
    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: 3140 troubled nodes, going for more…
    SUMA_StretchToFitLeCerveau:
    In stage 1
    SUMA_StretchToFitLeCerveau:
    Stage1: pastarea = 83820.069912
    SUMA_StretchToFitLeCerveau:
    Stage1: MaxExp = 0.706510, 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.078344 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.083621 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.021870 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.009638 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 = 0x2b14cf8) (osnd = 0x3f435b8)…
    3dSkullStrip: Coercing…
    3dSkullStrip: Writing masked volume …
    3dSkullStrip: Applying a bit of erosion and dilatation
    ++ OpenMP thread count = 8
    ++ 3dQwarp: AFNI version=AFNI_18.2.15 (Aug 28 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_SSW.nii.gz[1] -source ./anatU.11987.nii -prefix AFN_8Z6_wZTM8jgi_pO6dkI7Yw.nii -1Dmatrix_save AFN_8Z6_wZTM8jgi_pO6dkI7Yw -cmass -final wsinc5 -float -master BASE -twobest 7 -zclip -fineblur 4.44

++ ###########################################################
++ 3dAllineate: AFNI version=AFNI_18.2.15 (Aug 28 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_SSW.nii.gz
++ Loading datasets
++ 6526400 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.8432 y-shift=-20.4069 z-shift= 5.4863
    z-angle= 1.2094 x-angle= 9.3827 y-angle= 3.0211
    x-scale= 0.9033 y-scale= 0.9879 z-scale= 0.8788
    y/x-shear= 0.0150 z/x-shear= -0.0178 z/y-shear= -0.0888
    ++ Output dataset ./AFN_8Z6_wZTM8jgi_pO6dkI7Yw.nii
    ++ Wrote -1Dmatrix_save AFN_8Z6_wZTM8jgi_pO6dkI7Yw.aff12.1D
    ++ 3dAllineate: total CPU time = 0.0 sec Elapsed = 604.4
    ++ ###########################################################
    ++ # Please check results visually for alignment quality #
    ++ ###########################################################

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

  • 3dAllineate output files have been renamed

mat44 3dAllineate matrix:

  0.901673      0.026798     -0.046970      -1.843160
 -0.007067      0.974836      0.160347     -20.406900
  0.035061     -0.229067      0.852391       5.486270

++ 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_SSW.nii.gz source=./junk.SSwarper.aGKqAz94Dmb_TAL5_Allin.nii
++ AFNI warpomatic: 240 x 274 x 235 volume ; autobbox = 30…209 31…243 30…204 [clock= 10m 6s 691ms]
lev=0 8…231 5…269 9…225: [first cost=-0.44256] … done [cost:-0.44256==>-0.55219]
lev=1 patch=181x207x177 [clock= 12m 20s 641ms]… done [cost:-0.55219==>-0.58722 ; 8 patches optimized, 0 skipped]
lev=2 patch=135x155x133 [clock= 14m 58s 350ms]… done [cost:-0.58722==>-0.65454 ; 21 patches optimized, 6 skipped]
lev=3 patch=101x117x99 [clock= 18m 46s 894ms]… done [cost:-0.65454==>-0.71108 ; 39 patches optimized, 25 skipped]
lev=4 patch=77x87x75 [clock= 26m 24s 319ms]… done [cost:-0.71108==>-0.77957 ; 80 patches optimized, 45 skipped]
lev=5 patch=57x65x57 [clock= 35m 0s 294ms]… done [cost:-0.77957==>-0.84085 ; 160 patches optimized, 92 skipped]
++ ========== total number of parameters ‘optimized’ = 7497
++ Output dataset ./junk.SSwarper.aGKqAz94Dmb_TAL5_AWARP.nii
++ Output dataset ./junk.SSwarper.aGKqAz94Dmb_TAL5.nii
++ Output dataset ./junk.SSwarper.aGKqAz94Dmb_TAL5_WARP.nii
++ Inverting warp ********…:…
++ Output dataset ./junk.SSwarper.aGKqAz94Dmb_TAL5_WARPINV.nii
++ ===== clock time = 45m 39s 574ms
++ 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.aGKqAz94Dmb_MASK.nii…
++ Output dataset ./junk.SSwarper.aGKqAz94Dmb_MASK.nii
++ 3dcalc: AFNI version=AFNI_18.2.15 (Aug 28 2018) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ././junk.SSwarper.aGKqAz94Dmb_TAL5mm.nii
++ 3dNwarpApply: AFNI version=AFNI_18.2.15 (Aug 28 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.aGKqAz94Dmb_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.aGKqAz94Dmb_TAL5mm.nii’
++ Processing -nwarp
++ Warping:.Z
++ Output dataset ./junk.SSwarper.aGKqAz94Dmb_TAL5ww.nii
++ total Elapsed time = 17.6 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.aGKqAz94Dmb_MASK.nii…
++ Output dataset ./junk.SSwarper.aGKqAz94Dmb_MASK.nii
++ 3dNwarpApply: AFNI version=AFNI_18.2.15 (Aug 28 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.aGKqAz94Dmb_MASK.nii’
++ Processing -nwarp
++ Warping:.Z
++ Output dataset ./junk.SSwarper.aGKqAz94Dmb_MASKO.nii
++ total Elapsed time = 13.6 sec
++ 3dcalc: AFNI version=AFNI_18.2.15 (Aug 28 2018) [64-bit]
++ Authored by: A cast of thousands
*+ WARNING: dataset ‘b’=./junk.SSwarper.aGKqAz94Dmb_TAL5ww.nii has an obliquity difference of 0.142653 degrees with ./anatS.11987.nii
*+ WARNING: dataset ‘c’=./junk.SSwarper.aGKqAz94Dmb_MASKO.nii has an obliquity difference of 0.142653 degrees with ./anatS.11987.nii
++ Output dataset ././anatSS.11987.nii
++ 3dAllineate: AFNI version=AFNI_18.2.15 (Aug 28 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.aGKqAz94Dmb_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.aGKqAz94Dmb_AffSS.nii
    ++ 3dAllineate: total CPU time = 0.0 sec Elapsed = 4.8
    ++ ###########################################################
    ++ OpenMP thread count = 8
    ++ 3dQwarp: AFNI version=AFNI_18.2.15 (Aug 28 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_SSW.nii.gz source=./junk.SSwarper.aGKqAz94Dmb_AffSS.nii
    ++ AFNI warpomatic: 240 x 274 x 235 volume ; autobbox = 43…197 38…228 25…188 [clock= 4s 682ms]
    lev=1 patch=181x207x177 [clock= 6s 586ms][first cost=-1.88256] . done [cost:-1.88256==>-1.95521 ; 1 patches optimized, 8 skipped]
    lev=2 patch=135x155x133 [clock= 27s 11ms][first cost=-1.80056] . done [cost:-1.95521==>-1.81904 ; 1 patches optimized, 7 skipped]
    lev=3 patch=101x117x99 [clock= 42s 15ms][first cost=-1.45511] … done [cost:-1.81904==>-1.64769 ; 16 patches optimized, 11 skipped]
    lev=4 patch=77x87x75 [clock= 4m 6s 394ms][first cost=-1.43211] … done [cost:-1.64769==>-1.53197 ; 37 patches optimized, 27 skipped]
    lev=5 patch=57x65x57 [clock= 8m 31s 129ms][first cost=-1.34005] …:[cost=-1.43214]:… done [cost:-1.53197==>-1.45969 ; 241 patches optimized, 191 skipped]
    lev=6 patch=43x49x43 [clock= 28m 2s 265ms][first cost=-1.29349] …:[cost=-1.34350]:… done [cost:-1.45969==>-1.35091 ; 502 patches optimized, 394 skipped]
    lev=7 patch=33x37x31 [clock= 57m 46s 316ms][first cost=-1.24965] …:[cost=-1.30697]:… done [cost:-1.35091==>-1.27698 ; 1261 patches optimized, 1159 skipped]
    lev=8 patch=25x27x23 [clock= 1h 56m 28s 428ms][first cost=-1.23410] …:[cost=-1.29141]:… done [cost:-1.27698==>-1.22973 ; 3047 patches optimized, 2803 skipped]
    lev=9 patch=19x21x17 [clock= 4h 2m 28s 66ms][first cost=-1.24622] … done [cost:-1.22973==>-1.30171 ; 3425 patches optimized, 3358 skipped]
    lev=10 patch=13x15x13 [clock= 6h 17m 59s 942ms][first cost=-1.26016] … done [cost:-1.30171==>-1.20685 ; 9329 patches optimized, 9625 skipped]
    lev=11 patch=11x11x11 [clock= 12h 19m 35s 471ms][first cost=-1.26158] …

Hi, Tamara-

The runtime is quite varied, depending on the computer in question, the size + spatial resolution of the datasets, and the number of CPUs being used for the calcs.

@SSwarper runs a couple different iterations of 3dQwarp, which can take a while because 3dQwarp does a lot of calculations for hte nonlinear warping. However, it can be greatly sped up by using more than one CPU. There are a couple relevant lines in your output about this:


++ OMP_NUM_THREADS is: not set by user,
so probably just using one CPU :(

If you 1) have multiple CPUs on the computer in question and 2) set the OMP_NUM_THREADS environment variable in your ~/.bashrc or ~/.cshrc file, for example, then you can get much faster run times.

For example, I usuaally have a bash terminal, and in my computer’s ~/.bashrc I have :


export OMP_NUM_THREADS=8

For tcsh terminals, you could put the following in your ~/.cshrc:


setenv OMP_NUM_THREADS 8

The number you would select would be something less than the total number of CPUs on your computer, probably (could be set to all of them, but you might want to have it be less for performance of other things).

–pt

Thank you!