Hi,
I’m trying to warp my functional dataset to standard space.
The code I’m running is:
@auto_tlrc -base MNI152_T1_2009c+tlrc -suffix _tl -input {$subj}_2_t1+orig
@auto_tlrc -apar {$subj}_2_t1_tl+tlrc -suffix _tl -input {$subj}_vwfa_beta+orig -dxyz 1.5
But I got the following error message:
Applying tlrc warp from ./C01_2_t1_tl+tlrc to C01_vwfa_beta+orig …
Padding the input data before warping
++ 3dZeropad: AFNI version=AFNI_20.0.23 (Mar 27 2020) [64-bit]
++ output dataset: ./__ats_tmp__ipad+orig.BRIK
Creating grid at (1.5 1.5 1.5)mm RAI resolution…
*** failure while reading from brick file ./C01_2_t1_tl+tlrc.BRIK
*** desired 17060042 bytes but only got 1805258
*** Unix error message: Undefined error: 0
THD_load_datablock
AFNI_dataset_slice
3dresample
** Command line was:
3dresample -master C01_2_t1_tl+tlrc -dxyz 1.5 1.5 1.5 -prefix ./__ats_tmp__warp_grid -inset C01_2_t1_tl+tlrc -rmode Linear
*** failure while reading from brick file ./C01_2_t1_tl+tlrc.BRIK
*** desired 17060042 bytes but only got 1805258
*** Unix error message: Undefined error: 0
THD_load_datablock
AFNI_dataset_slice
3dresample
** Command line was:
3dresample -master C01_2_t1_tl+tlrc -dxyz 1.5 1.5 1.5 -prefix ./__ats_tmp__warp_grid -inset C01_2_t1_tl+tlrc -rmode Linear
r_fill_resampled_data_brick: failure to compute dataset slice 0
failure to resample dataset, exiting…
Failed to resample
I would really appreciate any suggestions you have! Thank you!
-Joy
Hi, Joy-
First point: I assume it is the 2nd command there giving that error? That makes it look like the “-input …” file is damaged/corrupted; you can check that in a Reynoldsian way with seeing what this produces:
3dBrickStat -slow -min -max C01_2_t1_tl+tlrc
Does that produce an error?
Second point: for warping to standard space, using @auto_tlrc would not be our preferred method; we typically recommend using @SSwarper before afni_proc.py to perform both skullstripping (SS) and nonlinear warping to standard space. The results of that warping are provided inputs to afni_proc.py-- the helpfile of the @SSwarper program shows how that is done, as do some of the afni_proc.py examples. Do you have a particular reason for wanting to use @auto_tlrc, and also for applying it outside of afni_proc.py (we also recommend putting the warp-to-standard-space step inside of afni_proc.py, so that only a single warping/regridding step is applied to your EPI information, to avoid having unnecessary smoothing added to it).
So, while it would be good to sort out what is happening in the first point, it would be good to hear your thoughts on the considerations of the second point, too.
–pt
Hi Paul,
First point:
You are right. This produces an error:
3dBrickStat -slow -min -max C01_2_t1_tl+tlrc
*** failure while reading from brick file ./C01_2_t1_tl+tlrc.BRIK
*** desired 17060042 bytes but only got 1805258
*** Unix error message: Undefined error: 0
THD_load_datablock
Max_func
3dBrickStat main
** Command line was:
3dBrickStat -slow -min -max C01_2_t1_tl+tlrc
Fatal Signal 11 (SIGSEGV) received
Max_func
3dBrickStat main
Bottom of Debug Stack
** Command line was:
3dBrickStat -slow -min -max C01_2_t1_tl+tlrc
** AFNI version = AFNI_20.0.23 Compile date = Mar 27 2020
** [[Precompiled binary macos_10.12_local: Mar 27 2020]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /Users/bl/.afni.crashlog
Second point:
I don’t have a particular reason for using @auto_tlrc and outside the afni_proc.py for these epi runs, so I will check the @SSwarper. Thank you!
However, I have a separate set of epi runs for representational similarity analysis, so for those datasetsI need to do preprocessing and GLM in native space and then do RSA searchlight for each individual subject. After that. I will need to normalize the searchlight results to standard space. Is it appropriate to use @auto_tlrc in that situation?
Thank you very much!
-Joy
Hi Pual,
I tried @SSwarper script but got error messages about starting Xvfb like these:
++ SSW Step 7
– trying to start Xvfb :177
[1] 6174
[1] + Exit 1 Xvfb :177 -screen 0 1024x768x24 >& /dev/null
No matching processes belonging to you were found
…
– trying to start Xvfb :957
[1] 6338
[1] + Exit 1 Xvfb :957 -screen 0 1024x768x24 >& /dev/null
No matching processes belonging to you were found
** ERROR: can’t start Xvfb – exiting
…
\n------------------- end of optionizing -------------------\n
– trying to start Xvfb :115
[1] 6526
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn’t already running(EE)
[1] + Exit 1 Xvfb :115 -screen 0 1024x768x24
Do you know how to fix the problem?
In the end the output it suggests me to check the QC images but I couldn’t find them in the directory.
Here is the script I ran:
set btemplate = MNI152_2009_template_SSW.nii.gz
set tpath = @FindAfniDsetPath ${btemplate}
if( “$tpath” == “” ) exit 1
set subj = C01
@SSwarper
-input {$subj}_2_t1+orig
-base $btemplate
-subid $subj \
Thank you!
Joy
Emmm…I ran the script again. Now there is no error message and I’m able to find the QC images.
Thanks,
Joy
Hi, Joy-
Perhaps during your previous @SSwarper run where you got those Xvfb error messages, there was still an Xvfb command running from a previous call? Sometimes that can cause the error message you see.
Xvfb is a dependency you install when setting up AFNI. What Xvfb is (from that program’s help):
Xvfb - virtual framebuffer X server for X Version 11
Xvfb is an X server that can run on machines with no display hardware and no physical
input devices. It emulates a dumb framebuffer using virtual memory.
It is used by several of the “automatic image generating” programs, such as @snapshot_volreg (possibly the first in AFNI to do so) and @chauffeur_afni. We use it to be able to open the AFNI GUi in a virtual environment, so you don’t see the GUI and image windows open on your computer; that way, the GUi can be “driven” to make images even on remote machines, where a GUI can’t open.
How to check for “stale” Xvfb sessions in a terminal: type “ps” in the terminal, and you will see a table listing all processes running. The first column is the “process ID”, and the last column is the “command”. You can end any of those with Xvfb or xvfb if you think they are stale (e.g., a previous command using it got interrupted while Xvfb had started by not closed, so now it keeps running in the background), by “killing” it based on its process ID. For example, run ps:
$ ps
PID TTY TIME CMD
13022 pts/9 00:00:00 Xvfb
13040 pts/9 00:00:00 ps
17746 pts/9 00:00:00 bash
… and then kill the Xvfb:
kill 13022
It is a little bit hard to know if this was the problem you had when you first ran @SSwarper, but that might have been… Having an existing Xvfb session running in the background can clash with starting a new Xvfb session, but it might not always do so. But if you do have to interrupt an @chauffeur_afni command in the terminal, then you might want to check if the Xvfb session didn’t get a chance to close, and then “kill” it based on its PID, as shown above.
–pt
Thank you very much!
Do you have any suggestion for warping to standard space in the situation I described in earlier reply? If I have to complete preprocessing and GLM in native space and then do some other analyses using another software for each subject, is it appropriate to use @auto_tlrc when I want to warp the outcome of the analyses to standard space?
Hi, Joy-
The problem with chopping up the alignment to final/standard space into multiple steps, each creating intermediate datasets, is that smoothing occurs at each regridding process. So, you introduce unnecessary smoothing at each point. That is why we put all the stages into afni_proc.py, and the final transformation from EPI to final space is performed at once (all intermediate alignments are concatenated and applied in one go, rather than trickling through separately).
I am not sure why a GLM would need to be performed in native space?
For going to standard space, using nonlinear alignment will give much better correspondence across a group analysis than using @auto_tlrc (which is linear affine, only). Using @SSwarper would be a better way to go.
–pt
Hi Paul,
I am getting the similar error when trying to use the @chauffeur_afni inside fat_proc_axialize_anat command. I have checked for your suggestion and ps table doesnt show me any process that uses Xvbf. Do you have any other suggestion to try on for this error?
Thanks
Shervin
Hi Paul,
I have encountered the same problem when running @sswarpper. But the system has no Xvbf process running. I tried on another computer and get the same errors. Could you please help?
The error message I got:
-- trying to start Xvfb :193
[1] 8818
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)
[1] + Exit 1 Xvfb :193 -screen 0 1024x768x24
The result of $ps
PID TTY TIME CMD
6452 ttys000 0:00.13 -bash
The code.
@SSwarper \
-input "$i".T1.padded180.nii \
-base TT_N27_SSW.nii.gz \
-subid "$i"
Thank you!
Hi-
I believe the error is described here, with a solution:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/programs/alpha/%40chauffeur_afni_sphx.html#troubleshooting
The following has appears to be a good solution (NB: it does
require having administrative or sudo privileges):
mkdir /tmp/.X11-unix
sudo chmod 1777 /tmp/.X11-unix
sudo chown root /tmp/.X11-unix/
This is described more here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/tutorials/auto_image/auto_%40chauffeur_afni.html#troubleshooting
Please let us know if that sorts things out.
--pt
1 Like
Hi Paul,
Yes, it works! Thank you!