"No output dataset will be calculated" while running refacer

Dear all,

I am trying to run @afni_refacer_run and running into some issues. It gives me three warnings, starting with “No output dataset will be calculated”. I think the other two are cause by the first one. There are also errors about “Xvfb – not found in path”, but as I understand this is to show some QA images, hence not relevant to processing?
The full output is below:


$ @afni_refacer_run -input dzne_MPRAGE_1iso_PAT2_s03.nii.gz -mode_reface -prefix reface.dzne.de
++ Found input file:   dzne_MPRAGE_1iso_PAT2_s03.nii.gz

++ AFNI refacer, version      = 2.31
++ AFNI MNI template dataset  = /share/apps/abin/MNI152_2009_template_SSW.nii.gz
++ AFNI refacer shell dataset = /share/apps/abin/afni_refacer_shell_sym_1.0.nii.gz
++ Mode for running           = reface

++ 3dcopy: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ 3dUnifize: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
 + Pre-processing: ADV...........UW[s138538]Gm
++ Output dataset ./tmp.01.uni.nii
++ ===== Elapsed = 24.7 sec
++ 3dAllineate: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: Zhark the Registrator
++ Option '-cmass' enables center-of-mass code = 7 = +xyz
++ Source dataset: /storage/users/username/peoples/silke/ISME/deface_test/niiMPRAGE/7197dd9cd-17_05_01/scans/__work_refacer.reface.dzne.de.Nag2GmbG7cc/tmp.01.uni.nii
++ Base dataset:   /share/apps/abin/MNI152_2009_template_SSW.nii.gz
++ Loading datasets into memory
++ Local correlation: blok type = 'TOHD(5.17699)'
*+ WARNING: No output dataset will be calculated
++ OpenMP thread count = 15
++ ======= Allineation of 1 sub-bricks using Local Pearson Correlation Abs =======
++ *** Coarse pass begins ***
++ *** Fine pass begins ***
 + Final fine fit Parameters:
       x-shift= -4.2532   y-shift=  4.3677   z-shift=-19.4002  ...  enorm= 20.3355 mm
       z-angle=  2.6489   x-angle= 17.5828   y-angle=  1.7674  ...  total= 17.9067 deg
       x-scale=  0.9060   y-scale=  0.9566   z-scale=  0.8948  ...  vol3D=  0.7755=(0.9188)^3 [base bigger than source]
++ Wrote -1Dmatrix_save tmp.02.mat_a2t.1D
++ 3dAllineate: total CPU time = 0.0 sec  Elapsed = 247.8
++ ###########################################################
++ 3dAllineate: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: Zhark the Registrator
++ Source dataset: /share/apps/abin/afni_refacer_shell_sym_1.0.nii.gz
++ Base dataset:   (not given)
++ Loading datasets into memory
*+ WARNING: -1D*_apply 'tmp.03.mat_t2a.1D': 1 isn't enough rows for source dataset -- last row will repeat
 +        -cmass x y z shifts =    0.042   -4.482   -8.437
 +  shift search range is +/- =   61.632  121.338  116.202
++ OpenMP thread count = 15
++ ========== Applying transformation to 2 sub-bricks ==========
volume 0..1
*+ WARNING: Re-using final row of -1D*_apply 'tmp.03.mat_t2a.1D' for sub-brick #1
++ Output dataset ./tmp.04.sh_t2a.nii
++ 3dAllineate: total CPU time = 0.0 sec  Elapsed = 5.1
++ ###########################################################
++ 3dcalc: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: A cast of thousands
 + removed 41 isolas from volume 0
 + removed 12 isolas from volume 1
++ Output dataset ./tmp.05.sh_t2a_thr.nii
++ 3drefit: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: RW Cox
++ Processing AFNI dataset tmp.05.sh_t2a_thr.nii
 + loading and re-writing dataset tmp.05.sh_t2a_thr.nii (/storage/users/username/peoples/silke/ISME/deface_test/niiMPRAGE/7197dd9cd-17_05_01/scans/__work_refacer.reface.dzne.de.Nag2GmbG7cc/tmp.05.sh_t2a_thr.nii in NIFTI storage)
++ 3drefit processed 1 datasets
++ Executing 3dcalc()
 argv[0]=3dcalc argv[1]=-a argv[2]=tmp.05.sh_t2a_thr.nii argv[3]=-b argv[4]=tmp.00.INPUT.nii argv[5]=-expr argv[6]=step(a-99)*b argv[7]=-session argv[8]=/tmp argv[9]=-prefix argv[10]=3dcalc_AFN_YOOiryrFHXSquoJOfMnDNQ argv[11]=-verbose
++ 3dcalc: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: A cast of thousands
++ Computing sub-brick 0
++ Computing sub-brick 1
++ Computing output statistics
++ Executing 3dcalc()
 argv[0]=3dcalc argv[1]=-a argv[2]=tmp.05.sh_t2a_thr.nii argv[3]=-expr argv[4]=step(a-99)*a argv[5]=-session argv[6]=/tmp argv[7]=-prefix argv[8]=3dcalc_AFN_PIz9OIajxhXoXn5C6O5mpQ argv[9]=-verbose
++ 3dcalc: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: A cast of thousands
++ Computing sub-brick 0
++ Computing sub-brick 1
++ Computing output statistics
+++ Proc for reface
    with subbrick 1 and list index 2
++ 3dcalc: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: A cast of thousands
 + removed 76995 isolas from volume 0
++ Output dataset ./tmp.06.reface.orig_mskd.nii
++ 3dcalc: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./tmp.07.reface.sh_t2a_thr_mskd.nii
++ 3dBlurInMask: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: RW Cox
++ Removed 3 isolas from mask dataset
++ Number of voxels in mask = 846823
++ forcing output to be stored in float format
++ mri_blur3D: #iter=9 fx=0.03560 fy=0.03560 fz=0.03560
++ Output dataset ./tmp.99.result.reface.nii
++ 3dcalc: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./tmp.99.result.reface.nii

++ Output final dsets


+++ Command Echo:
   3dcopy tmp.99.result.reface.nii ../reface.dzne.de 

++ 3dcopy: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ My command:
   @chauffeur_afni -ulay tmp.00.INPUT.nii -ulay_range 2% 98% -olay tmp.99.result.reface.nii -func_range_perc_nz 95 -cbar Plasma -pbar_posonly -opacity 9 -prefix ../reface.dzne.de_QC/reface.dzne.de -montx 5 -monty 3 -montgap 3 -set_xhairs OFF -label_mode 1 -label_size 4

++ Using AFNI ver : AFNI_22.1.02
++ chauffeur ver  : 6.31
** ERROR: Xvfb -- not found in path -- program fails

++ DONE (bad exit): check for errors

++ 3dcalc: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./../reface.dzne.de.face.nii.gz
++ My command:
   @chauffeur_afni -ulay tmp.00.INPUT.nii -ulay_range 2% 98% -olay ../reface.dzne.de.face.nii.gz -func_range_perc_nz 95 -cbar Reds_and_Blues_Inv -opacity 5 -prefix ../reface.dzne.de_QC/reface.dzne.de.face -montx 5 -monty 3 -montgap 3 -set_xhairs OFF -label_mode 1 -label_size 4

++ Using AFNI ver : AFNI_22.1.02
++ chauffeur ver  : 6.31
** ERROR: Xvfb -- not found in path -- program fails

++ DONE (bad exit): check for errors


++ Done.

After that, there are three files generated - reface.dzne.de.face.nii.gz, reface.dzne.de+orig.BRIK and reface.dzne.de+orig.HEAD.

Any suggestion what is going on? If it is indeed cause by no Xvfb, then is it possible to circumvent that? We dont want to mess with it, since apparently it can cause conflicts with xrdp.

Thank you!

Best wishes,
Renat.

Hi Renat,

This seems okay to me.

The “no output dataset” warning looks to be coming from the computation of a transformation that explicitly avoids any output dataset, so it seems okay.

The Xvfb error just means you won’t get QC images. Add -no_images to explicitly avoid attempted creation of them.

  • rick

Hi Rick,

thank you for the response and the tip about -no_images option. Now it runs through without error messages.

However, the output is the same - a face NIFTI image and a BRIK/HEAD pair. There is no NIFTI image for the output.
This happens if I specify a single mode. Interestingly, if I use -mode_all option, then it does generate NIFTI images for the output, in addition to face and face_plus NIFTI images.
This is also reflected in the final 3dcopy commands. If I run with single mode, then it is something like:


+++ Command Echo:
   3dcopy tmp.99.result.deface.nii ../dzne_MPRAGE_1iso_PAT2_s03_deface

And when I run with -mode_all option, it is:


+++ Command Echo:
   3dcopy tmp.99.result.reface_plus.nii ../dzne_MPRAGE_1iso_PAT2_s03.reface_plus.nii.gz 

++ 3dcopy: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]

+++ Command Echo:
   3dcopy tmp.99.result.reface.nii ../dzne_MPRAGE_1iso_PAT2_s03.reface.nii.gz 

++ 3dcopy: AFNI version=AFNI_22.1.02 (Apr  6 2022) [64-bit]

+++ Command Echo:
   3dcopy tmp.99.result.deface.nii ../dzne_MPRAGE_1iso_PAT2_s03.deface.nii.gz

Notice the nii.gz extension for the 3dcopy target in the latter case. This is probably the reason why there is no NIFTI output when run in single mode? Can I get it without running all three modes?

Thank you!

Best,
Renat.

Hi Renat,

I did not realize NIFTI vs. BRIK output was your concern.

Note that you can easily convert to NIFTI afterwards with something like:

3dcopy dzne_MPRAGE_1iso_PAT2_s03_deface+tlrc dzne_MPRAGE_1iso_PAT2_s03_deface.nii.gz

But looking at the help, it seems that if you want NIFTI output, specify that with -prefix, as in:

@afni_refacer_run -input dzne_MPRAGE_1iso_PAT2_s03.nii.gz -mode_reface -prefix reface.dzne.de.nii.gz

Does that seem reasonable?

  • rick

Hi Rick,

maybe a little bit of concern :slight_smile: I havent worked with AFNI in a long time.

Specifying the file extension in the prefix does seem very reasonable, since it needs to know which format to save the data in.

I have one last question, if I may. The -no_images option disables @chauffeur_afni command. Is there a way to generate the QA images, but not automatically display them? I would think, that Xvfb is needed only to display the QA images remotely. Or is Xvfb an integral part of the chauffeur function?

Thanks!

Best wishes
Renat.

Hi Renat,

Xvfb is necessary for @chauffeur_afni. Xvfb is an X11 virtual frame buffer program, making the command run “as if” there were an X11 server, but without actually needing one. That is why it can run on a remote machine, or one without any display.

In this virtual X11 environment, @chauffeur_afni can actually run afni’s graphical commands to generate and save images (used in the QC report).

So this becomes like starting afni, loading datasets, jumping to coordinates, setting overlays, threshold, clustering, making montages, etc., and then finally saving the images in the afni GUI windows to disk, and possibly even stitching them together. All of this can happen with a single such call to @chauffeur_afni. But we do not see it happening, because it is using a virtual X11 server. We just see the final images sitting on the disk.

So in the end, you cannot get the QC images with Xvfb, sorry.

  • rick

Hi, Renat-

Just to check, is it a problem to install Xvfb? Indeed, having the QC images is immensely useful.

What is the output of:


afni_system_check.py -check_all

on your system?

–pt

Hello,

well, our admin said that he would rather not mess with it, as it might have conflicts with Xrdp…
The system check output is:


-------------------------------- general ---------------------------------
architecture:         64bit ELF
system:               Linux
release:              3.10.0-1160.59.1.el7.x86_64
version:              #1 SMP Wed Feb 23 16:47:03 UTC 2022
distribution:         CentOS Linux 7.9.2009 Core
number of CPUs:       80
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /share/apps/abin/afni
afni version         : Precompiled binary linux_centos_7_64: Apr  6 2022
                     : AFNI_22.1.02 'Antoninus Pius'
AFNI_version.txt     : AFNI_22.1.02, linux_centos_7_64, Apr 06 2022
which python         : /usr/bin/python
python version       : 2.7.5
which R              : /usr/bin/R
R version            : R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
which tcsh           : /usr/bin/tcsh

instances of various programs found in PATH:
    afni    : 1   (/share/apps/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 2
      /usr/bin/python2.7
      /opt/rocks/bin/python2.7
    python2 : 2
      /usr/bin/python2.7
      /opt/rocks/bin/python2.7
    python3 : 0


testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    uber_subject.py      : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    3dMVM                : success

checking for R packages...
    rPkgsInstall -pkgs ALL -check : FAILURE

        oo Warning:
           These packages are not installed on the computer: afex!
        These packages are not installed on the computer: phia!
        These packages are not installed on the computer: snow!
        These packages are not installed on the computer: lmerTest!
        These packages are not installed on the computer: paran!
        These packages are not installed on the computer: brms!
        These packages are not installed on the computer: corrplot!
        These packages are not installed on the computer: metafor!


R RHOME : /usr/lib64/R

checking for $HOME files...
    .afnirc                   : found
    .sumarc                   : found
    .afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
++ module loaded: PyQt4
   module file : /usr/lib64/python2.7/site-packages/PyQt4/__init__.pyc

** failed to load module matplotlib.pyplot
-- matplotlib.pyplot is required

-------------------------------- env vars --------------------------------
PATH = /share/apps/freesurfer_7.1/bin:/share/apps/freesurfer_7.1/fsfast/bin:/share/apps/freesurfer_7.1/tktools:/share/apps/fsl_6.0/bin:/share/apps/freesurfer_7.1/mni/bin:/opt/openmpi/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/ganglia/bin:/opt/ganglia/sbin:/opt/pdsh/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/gridengine/bin/lx-amd64:/home/ryakupov/hydra-work/apps/QIT/qit-build-linux-latest/bin:/share/apps/abin:/home/ryakupov/hydra-work/apps/EPVS/bin:/usr/local/R2016b/bin:/share/apps/itksnap/bin:/home/ryakupov/bin:/share/apps/ashs/bin:/share/apps/ants/:/share/apps/fsl_6.0/bin:/home/ryakupov/hydra-work/scripts:/usr/local/dcmtk/3.6.0/bin:/home/ryakupov/r2_cluster_x:/home/ryakupov/cluster-work/scripts

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH = /opt/gridengine/lib/lx-amd64:/opt/openmpi/lib:/usr/local/dcmtk/3.6.0/lib64

DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas    : found TT_N27+tlrc  under /share/apps/abin

------------------------------ OS specific -------------------------------
which yum            : /usr/bin/yum
yum version          : 3.4.3


=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  'afni' executable is owned by root
*  missing R packages (see rPkgsInstall)
*  python library matplotlib is required
   (see AFNI install docs for details)
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)