AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
Ziad Saad
August 08, 2003 04:40PM
Hello Kay,

This was my first exposure to SPM datasets and I do not have a very solid idea of how the data is stored. However, I did manage to put them in the correct orientation and align the anatomicals for surface mapping with SUMA.

The current ANALYZE format does not completely describe the spatial properties of the data set so it is not possible for the 3dANALYZEtoAFNI program to orient the output data correctly without additional information (usually added via the command line options). This problem is made more difficult by the changing standards of various FMRI analysis packages. The ANALYZE format is being modified to include the missing information so hopefully these problems will be minimized in the future. (See Bob's comments on the message board under the title: ANALYZE format and AFNI orientation)

In addition to the orientation of the dataset, there are also matrices that are used to transform a data set's alignment and geometry. In AFNI, those transforms are stored in the header file, in FSL and SPM (apparently) they are in separate files.

For the data you sent me, to create AFNI data in the correct orientation you will need to use these matrices. Bob has recently modified 3dWarp to accept FSL matrices and it looks like SPM's matrices are pretty similar (you'll need afni version 2.55c or newer). The only difference I found was in the format of the files containing these matrices. SPM uses matlab's binary format while FSL uses an ASCII file. To transform SPM's .mat files to ASCII, I wrote a matlab function called writeSPMmat.m (available from: [afni.nimh.nih.gov]). Once you create the ASCII version of the .mat file, you can use it with 3dWarp to create an AFNI dataset.
There is more help on using 3dWarp here: [afni.nimh.nih.gov] (search for 3dWarp).

Here what I did to align your data and map function to the surface models with SUMA.

I had three data sets (renamed slightly):
xm000.hdr, xm000.img and xm000.mat : High resolution anatomical data set
binNretino.hdr, binNretino.img and binNretino.mat : Functional data set
SurfVol+orig.HEAD SurfVol+orig.BRIK the Surface Volume Dataset created by @SUMA_MakeSpec_FS

First create ASCII versions of the .mat files using writeSPMmat then run the following:

3dWarp -prefix xm000 -matvec_in2out xm000.mat -gridset SurfVol+orig. -fsl_matvec xm000.hdr
This creates an AFNI dataset of the high-res anatomical underlay.

3dWarp -prefix binNretino -matvec_in2out xm000.mat -gridset SurfVol+orig. -fsl_matvec binNretino-areas_n1_s10_fa7_fs2_ans6+stat.hdr
This creates an AFNI data set of the functional data set. Note that I used xm000.mat and NOT binNretino.mat. Do not ask me why, that's the transform that worked. CHECK THE ALIGNMENT IN AFNI.

For mapping data on the surface model, I used @SUMA_AlignToExp to align SurfVol to xm000:
@SUMA_AlignToExperiment xm000+orig. SurfVol+orig.
This command creates SurfVol_Alnd_Exp+orig.

Now run SUMA as such:
suma -spec YourSpecFile.spec -sv SurfVol_Alnd_Exp+orig.

talk to AFNI and verify that all is well.

BTW: You might want to consider the more sophisticated volume to mapping options now available in SUMA. Look at 3dVol2Surf -help and the section titled: "Mapping from volume to surface domains" at [afni.nimh.nih.gov] .

cheers,
-ziad
Subject Author Posted

Problems With Analyze (again)

Kay Bente July 31, 2003 09:16AM

Re: Problems With Analyze (again)

Ziad Saad July 31, 2003 06:20PM

Re: Problems With Analyze (again)

Kay Bente August 04, 2003 09:36AM

Re: Problems With Analyze (again)

Ziad Saad August 08, 2003 04:40PM

Re: Problems With Analyze (again)

Kay Bente August 11, 2003 05:26AM

SPM .mat files to AFNI

Shaunna November 04, 2003 02:45PM