Friday, December 28, 2012


Back in the good old days, we would create our scripts ex nihilo; out of nothingness would we construct gigantic, Babel-esque scripts that nobody - to be honest, not even we - could understand. We would pore over FMRI textbooks and fumble around with commands and tools we thought were germane, only to have everything collapse all around us when it came time for execution. I remember with painful clarity the moment when I finally hit upon the idea of looping over subjects for each iteration of the script; I thought I was a creative genius.

Lawless, ruthless, and terrifying; those days were like the wild west. Nobody knew what the hell was going on; you might come across a block of analysis script posted by some group in Singapore, compare it to your own, and wonder how your two labs could ever come to the same conclusion about anything, given how radically different your scripts were. Your script would call for slice timing correction, followed by coregistration and normalization, while their script would call for a cup of chopped onions and a clove of chopped garlic. Then, slowly, you would realize that what you were looking at was a recipe for chicken cacciatore or something, and you would feel like an idiot. Overall, those days were not good.

Fortunately for us, these days we now have a script called, which takes care of generating analysis scripts quickly and easily. AFNI script ex machina, as it were. If you have programs and binaries from the past couple of years or so (and there's no reason you shouldn't; if you haven't updated in a while, a quick '@update.afni.binaries -d', without the quotes, should do the trick), you will have If you type it from the command line - and your python libraries are current and functional (see here for a message board thread if you have trouble with this) - then a graphical user interface will pop up, prompting you to input parameters such as smoothing kernel size, number of regressors, relationship status, and so forth, until you have a completely idiosyncratic script to fit your needs. Overall it has worked very well for me so far, and word is that it will be integrated with an even higher level script called I've had some issues getting it to work, so instead of trying to fix it, I have taken the path of least resistance and settled for You will be glad that you did as well.


  1. That's it. If I read one more good post out of you, I'm going to stop responding anonymously. You have been warned!

    1. Dear stalker,

      I am flattered - truly - that my posts are to your liking. Of course, I believe that my writing is flawless, but I do not always expect everyone else to see it the same way.

      In all seriousness, I really do appreciate getting positive feedback, and it motivates me to write more. Just remember to pass this around to all your friends, and remember to allow the sidebar ads to arouse your desire for more possessions, or perhaps pique your curiosity to learn that one weird trick to boost testosterone.



    2. Hi Dear Andy,

      I have problems with "QFileSystemWatcher: failed to add paths: " this horrible command line. And I tried many many things almost my computer started started to make hands :D I use Windows10/BashOnUbuntu and ı wanna make resting state analysis on AFNI with your guidance but cannot pass the first step. Can u help me please ..

    3. Hey Abdullah, for that kind of error your best bet is writing to the AFNI message board. They are very quick to respond, and will know how to help you!

      Good luck,


    4. Thanks for your help Andy. I will take your advice.


  2. And after that it throws an error when ı compute which is 3dDespike: error while loading shared libraries: cannot open shared object file: No such file or directory