AFNI fMRI Preprocessing / 3dWarp


I am trying to reconstruct functional MRI images using AFNI through the (siemenstoafni) commands. I am still very new to fMRI preprocessing, so I was wondering if these first steps are correct in terms of processing both my anatomical and EPI DICOMS. I want to be able to produce a niftii file for both my original anat DICOMS and my EPI DICOMS so I can conduct a coregistration check later.

siemenstoafni -norot -prefix anat ./anat/DICOM/

3dWarp -oblique2card -prefix anat1 -newgrid 3.5 anat+orig

siemenstoafni -prefix rest -rotobrick anat+orig ./epi/rs/DICOM/

Any help would be very much appreciated. Thanks!

Hmm… That program (siemenstoafni) is really old and not part of the AFNI distribution. You can see this thread[/url]. I’d recommend using the AFNI program Dimon or dcm2nii. There’s a [url=]handy blog post on this as well.

As for processing, we recommend that users take a look at the “new” script included in the distribution. The class handouts from bootcamps are helpful and can be accessed here. And of course if you have further questions, post them to the message board.


I agree with Pete.

I would point out that dcm2niix_afni exists within the AFNI distribution-- it is dcm2niix, kindly added for distribution to the AFNI distribution by Chris Rorden. Using that, you wouldn’t have to install another package/tool. And AFNI’s Dimon might also be useful.

What are your procesing goals for hte data? Dealing with obliquity/possibly obliquity can be a hassle. If at all possible, using the tool to deal with it while you do other processing steps is probably the most recommended option. But this will depend on what you want to do with the data.



Thanks for your reply. Again, I’m still very new to AFNI but what we are trying to do is to simply analyze the resting state data (does not include the other runs). We are still in the initial stages of preprocessing the Oblique T1 MPRAGE (anat data) and the resting state Oblique Axial ep2d bold data (EPI data).

Currently our issue with the first 3 lines is that we have both an oblique anat and functional dataset. From my understanding, we have to fix the obliquity of our anat and create a straight anatomical reference to enable support for our oblique functional. The -rotyourself will rotate our oblique anatomical to itself rather than a straight anatomical since we don’t have a straight anatomical reference (normally we would use -rotobrick). However, when we try to apply our oblique functional on this now “straight” anat (using the -rotobrick function to process the functional using the processed anatomical as the -rotobrick reference), an error occurs stating that: “ERROR: Failed to handle oblique (tolerance exceeded).”

We’ve already applied the maximum tolerance possible as stated, but still we are receiving these errors and preferably we would like not to use any tolerance at all.

This is all prior to performing slice timing, motion correction, spatial normalization, and smoothing. We tried experimenting with it by adding 3dWarp functions which ended up running with no problems. However, when we check for coregistration between our anat and epi, the alignment is very off so we think this issue is in regards to the obliquity at the start of our preprocessing and less to do with the slice timing, moco, normalization, etc.

Again, still very new to AFNI but I’ll check out this DIMON program and see if there is anything there that can help us with this obliquity problem. Any other tips / helpful advice would be very much appreciated!


If you use for your analyses, you shouldn’t need to worry about oblique data differences, as they will (under most circumstances) be handled by the script. It will also handle all of your other preprocessing needs!

There’s a nice introduction here.