how to restrict 3ddelay output time (or recompile source code in Ubuntu)

Dear AFNI expert,

I used the 3ddelay to estimate the lag time between ideal time course with resting state BOLD signals, in most case the lag time is reasonable (0-10s), but sometimes the lag time is too large (60 s) and it’s not reasonable. So I would like to restrict the delay time in 10s. Could you please provide some ways to restrict the output of 3ddelay?

The parameters of fMRI: TR = 1s, number of TR = 800.

I checked the source code of 3ddelay.c . And 3ddelay invoked the ‘hilbertdelay_V2’ which include the following code:
‘’’ maxdel = lng/2; /* delays should not exceed one third of the segment length (and that’s pushing it !)*/ ‘’‘’

Maybe one way is to modify the code to ‘‘maxdel = 10 TR’’ and then recompile the source code. But I don’t know how to recompile the 3ddelay in Ubuntu. Could you please help me to fix these two problem?


If you want to compile on your own, you can compile the source yourself and edit it, sure. You can find a link for the source code tarball here, under section “C”:
After downloading the tarball where you wish, then open the tarball:
$ tar -xf afni_src.tgz
and you can move into the directory:
$ cd afni_src/

For building on Ubuntu, you can look in the source code’s “afni_src/other_builds/” directory-- there is an OS_notes.linux_ubuntu_12_64 text file that describes using aptitude commands to help you prepare for building-- it should work on many Ubuntu versions, such as 12.* and 14.* (and possibly later versions). Then, you can copy the Makefile.linux_ubuntu_12_64 or Makefile.linux_ubuntu_12_64_OMP (the latter if you want OpenMP capability, which might be recommended, but choose at your own wont) to be the Makefile in your afni_src/ directory, and build everything with:
$ make vastness
(or, potentially, you can put a ‘sudo’ at the start of that command, depending on your system setup).

After that, you should just be able to make an individual function like 3ddelay with the following in the afni_src/ directory:
$ make 3ddelay
and then move the created binary to the binary directory:
$ mv 3ddelay linux_ubuntu_12_64/.

… and this assumes that the [SOME_LOCATION]/afni_src/linux_ubuntu_12_64/ directory is set to be included in your $PATH.


Hi ptaylor,

Appreciate. It works very well.

Have a nice day.


OK, great, glad that worked.

I didn’t address the other part of your question, but perhaps someone else will chime in with an opinion on that.