animal_warper ERROR: program failed (align centers)

Hi AFNI experts,

AFNI version info (afni -ver):
Precompiled binary linux_centos_7_64: Nov 22 2023 (Version AFNI_23.3.09 'Septimius Severus')

My script:

animal_warper                                                                                                                        \
  -input             /home/awong/Data/rawdata/bids/Monkey/MRI_TEST2/sub-Y9810009/ses-001/anat/sub-Y9810009_ses-001_run-001_T1w.nii.gz \
  -input_abbrev      T1W                                                                                                              \
  -base              /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/NMT_v2.0_sym_SS.nii.gz                               \
  -base_abbrev       NMT2                                                                                                             \
  -atlas_followers   /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/CHARM_in_NMT_v2.0_sym.nii.gz                         \
                     /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/D99_atlas_in_NMT_v2.0_sym.nii.gz                     \
  -atlas_abbrevs     CHARM  D99                                                                                                       \
  -seg_followers     /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/NMT_v2.0_sym_segmentation.nii.gz                     \
  -seg_abbrevs       SEG                                                                                                              \
  -skullstrip        /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/NMT_v2.0_sym_brainmask.nii.gz                        \
  -dset_followers    /home/awong/Data/rawdata/bids/Monkey/MRI_TEST2/sub-Y9810009/ses-001/anat/sub-Y9810009_ses-001_run-001_T2w.nii.gz \
  -dset_abbrevs      T2W                                                                                                              \
  -outdir            /home/awong/Data/derivatives/afni-23.3.09/macaque/sub-Y9810009                                                   \
  -ok_to_exist 

Outputs:

++ Start animal_warper, ver = 3.61
++ Prepare for running djunct_overlap_check (ver = 0.46)
++ 3dcalc: AFNI version=AFNI_23.3.09 (Nov 22 2023) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset /home/awong/Data/derivatives/afni-23.3.09/macaque/sub-Y9810009/QC/__workdir_olap_3LRH8ejFoo2/olapch_0_cp_ulay.nii
++ Just copy olay, bc ulay will get regridded
++ 3dcalc: AFNI version=AFNI_23.3.09 (Nov 22 2023) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset /home/awong/Data/derivatives/afni-23.3.09/macaque/sub-Y9810009/QC/__workdir_olap_3LRH8ejFoo2/olapch_1_cp_olay.nii
++ Quietly run: 3drefit -space NMT2 olapch_0_cp_ulay.nii

++ olay_alpha has known value: No

++ My command:
chauffeur_afni -ulay olapch_0_cp_ulay.nii -pass -pass -olay olapch_1_cp_olay.nii -ulay_range 0% 98% -func_range_perc_nz 98 -cbar Reds_and_Blues -pbar_posonly -set_subbricks 0 0 0 -olay_alpha No -olay_boxed No -opacity 3 -zerocolor black -prefix img00 -montx 1 -monty 1 -montgap 1 -montcolor black -save_ftype JPEG -set_xhairs OFF -label_mode 1 -label_size 4 -do_clean -pass -pass -pass -set_dicom_xyz 0 0 0

++ Using AFNI ver : AFNI_23.3.09
++ chauffeur ver : 6.61

------------------ start of optionizing ------------------

++ Found input file: olapch_0_cp_ulay.nii
++ Found input file: olapch_1_cp_olay.nii
++ Using blowup factor: 2
++ Using opacity: 3
++ Making temporary work directory to copy vis files: ./__tmp_chauf_slDFu6STeB3
++ Converted 0 to labels
++ Final subbrick indices: 0 0 0
++ Copy ulay to visualize (volumetric) within user's range:
++ Ulay to be visualized within user range:
[0%, 98%] -> [0.000000, 218.000000]
++ 3dcalc: AFNI version=AFNI_23.3.09 (Nov 22 2023) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ././__tmp_chauf_slDFu6STeB3/tmp_ulay.nii
++ 3dcalc: AFNI version=AFNI_23.3.09 (Nov 22 2023) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ././__tmp_chauf_slDFu6STeB3/tmp_olay.nii
++ For olay, the 98%ile value leads to
--> upper range value: 877.000000
++ Dimensions (xyzt): 320 320 192 1
++ (initial) Slice spacing ordered (x,y,z) is: 320 192 320
++ Will have user's chosen: SET_DICOM_XYZ 0 0 0

------------------- end of optionizing -------------------

-- trying to start Xvfb :202
[1] 3335062

+++ Command Echo:
afni -q -no1D -noplugins -no_detach -com SWITCH_UNDERLAY tmp_ulay.nii -com SWITCH_OVERLAY tmp_olay.nii -com SEE_OVERLAY + -com OPEN_WINDOW sagittalimage opacity=3 mont=1x1:320:1:black crop=0:0,0:0 -com OPEN_WINDOW coronalimage opacity=3 mont=1x1:192:1:black crop=0:0,0:0 -com OPEN_WINDOW axialimage opacity=3 mont=1x1:320:1:black crop=0:0,0:0 -com SET_PBAR_ALL +99 1 Reds_and_Blues -com DO_NOTHING -com SET_SUBBRICKS 0 0 0 -com SET_ULAY_RANGE A.all 0.000000 218.000000 -com SET_FUNC_RANGE 877.000000 -com SET_THRESHNEW 0 * -com SET_FUNC_ALPHA No -com SET_FUNC_BOXED No -com SET_FUNC_RESAM NN.NN -com SET_XHAIRS OFF -com SET_XHAIR_GAP -1 -com SET_DICOM_XYZ 0 0 0 -com SAVE_JPEG axialimage ./img00.axi blowup=2 -com SAVE_JPEG sagittalimage ./img00.sag blowup=2 -com SAVE_JPEG coronalimage ./img00.cor blowup=2 -com QUITT ./__tmp_chauf_slDFu6STeB3

+/home/awong/Data/derivatives/afni-23.3.09/macaque/sub-Y9810009/QC/__workdir_olap_3LRH8ejFoo2/__tmp_chauf_slDFu6STeB3++ Writing one 640x384 image to filter '/home/awong/Software/fsl/bin/cjpeg -quality 95 > ./img00.axi.jpg'
++ Writing one 384x640 image to filter '/home/awong/Software/fsl/bin/cjpeg -quality 95 > ./img00.sag.jpg'
++ Writing one 640x640 image to filter '/home/awong/Software/fsl/bin/cjpeg -quality 95 > ./img00.cor.jpg'

AFNI QUITTs!

+* Removing temporary image directory './__tmp_chauf_slDFu6STeB3'.

[1] Done Xvfb :202 -screen 0 1024x768x24

++ DONE (good exit)
see: ./img00*

+++ Arranging 3 images (each 640x384) into a 3x1 matrix.
+++ Transforming all input to rgb for a good reason
+++ Writing image to ../init_qc_00.input+base.T1W.jpg
You can view image ../init_qc_00.input+base.T1W.jpg with:
aiv ../init_qc_00.input+base.T1W.jpg

+* Removing temporary workdir '/home/awong/Data/derivatives/afni-23.3.09/macaque/sub-Y9810009/QC/__workdir_olap_3LRH8ejFoo2*'

++ DONE! Image output:
/home/awong/Data/derivatives/afni-23.3.09/macaque/sub-Y9810009/QC/init_qc_00.input+base.T1W

++ Using user's base abbrev: NMT2
++ 3dcopy: AFNI version=AFNI_23.3.09 (Nov 22 2023) [64-bit]
++ 3dcopy: AFNI version=AFNI_23.3.09 (Nov 22 2023) [64-bit]
++ 3dcopy: AFNI version=AFNI_23.3.09 (Nov 22 2023) [64-bit]
++ 3dcopy: AFNI version=AFNI_23.3.09 (Nov 22 2023) [64-bit]
++ Using user-entered list of atlas_follower abbrevs
++ Using user-entered list of seg_follower abbrevs
++ Using user-entered list of dset_follower abbrevs
ans: Subscript out of range.
** ERROR: program failed (align centers)

The program was aborted. What's wrong with it? Do I need to do any prior manipulations to the input dataset?

Thanks,
Angel

Hi AFNI experts,

I modified my script by turning off the align_centers_meth. I used a preprocessed T1w image as the input dataset with image cropping and intensity non-uniformity (INU) correction.

Modified script:

@animal_warper                                                                                                                        \
  -input             /home/awong/Data/derivatives/preemacs/sub-Y9810009/T1.nii.gz                                                     \
  -base              /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/NMT_v2.0_sym_SS.nii.gz                               \
  -base_abbrev       NMT2                                                                                                             \
  -atlas_followers   /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/CHARM_in_NMT_v2.0_sym.nii.gz                         \
                     /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/D99_atlas_in_NMT_v2.0_sym.nii.gz                     \
  -atlas_abbrevs     CHARM  D99                                                                                                       \
  -seg_followers     /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/NMT_v2.0_sym_segmentation.nii.gz                     \
  -seg_abbrevs       SEG                                                                                                              \
  -skullstrip        /home/awong/Templates/macaque/nmt/NMT_v2.0_sym/NMT_v2.0_sym/NMT_v2.0_sym_brainmask.nii.gz                        \
  -outdir            /home/awong/Data/derivatives/afni-23.3.09/macaque/sub-Y9810009                                                   \
  -align_centers_meth OFF                                                                                                              \
  -ok_to_exist

But it came up with another error:

ans: Subscript out of range.
** ERROR: program failed (base2osh 2)

Please kindly advise how to proceed the processing without errors.

Thanks,
Angel

Hi, Angel-

This error message in @Align_Centers:

ans: Subscript out of range.

... appears when the input dset ...doesn't actually exist. Can we verify that the path+filename is correct for the file you input via-dset_followers ...`? That is, what is the output of:

ls /home/awong/Data/rawdata/bids/Monkey/MRI_TEST2/sub-Y9810009/ses-001/anat/sub-Y9810009_ses-001_run-001_T2w.nii.gz 

?

--pt

Hi Paul,

Thanks for your reply.

The output of:

(base) [awong@localhost ~]$ ls /home/awong/Data/rawdata/bids/Monkey/MRI_TEST2/sub-Y9810009/ses-001/anat/sub-Y9810009_ses-001_run-001_T2w.nii.gz
/home/awong/Data/rawdata/bids/Monkey/MRI_TEST2/sub-Y9810009/ses-001/anat/sub-Y9810009_ses-001_run-001_T2w.nii.gz

The path+filename is correct. I directly copied it from the terminal.

If I turned off the align_centers_meth in @animal_warper, it continued to run the rest of the processing. But it ended up with another error:

ans: Subscript out of range.
** ERROR: program failed (base2osh 2)

Thanks,
Angel

Hi, Angel-

Hmmm, OK. Could you please check what shell you have with echo $0? Ignorin any - character, it should tell you whether you are using zsh, bash, tcsh, etc.

Then could you please add the following to the end of your command, to both make the output text muuuch more verbose and to log all the output text that is happening, with the syntax to use dependent on your shell:

  • if your shell is csh or tcsh:
    -echo |& tee log.aw.txt
    
  • if your shell is bash or zsh:
    -echo 2>&1 | tee log.aw.txt
    

? That will create a text file called log.aw.txt in the directory from which you run the command. It's probably a wee bit long to post here, so could you please email it to me? I will PM you my email.

thanks,
pt