Importing NIFTI data

214 views
Skip to first unread message

Olga Lositsky

unread,
Dec 29, 2010, 1:18:03 PM12/29/10
to mvpa-t...@googlegroups.com
Dear MVPA Team,

I am trying to import an epi pattern from a NIFTI file as well as export MVPA toolbox data to NIFTI files for processing in FSL. So far, I have been using the already existing functions load_afni_mask and load_spm_pattern, but I've realized that the SPM functions rely on spm_read_vols and spm_vol, which require the user to have SPM. Since the exercises I'm preparing are for a class, I don't think we would want the students to have to install SPM in order to import NIFTI patterns. I tried using load_afni_pattern for this, but it seems like BrikInfo is not recognizing my NIFTI file (bold.nii), since it looks for a HEAD file and outputs that bold.nii.HEAD does not exist. I have been looking through previous posts, but haven't been able to find a function that imports NIFTI patterns without using SPM. Does anyone know if this has been done before? I'd really appreciate any pointers!

Thanks a lot in advance!
Olga

Greg Detre

unread,
Dec 30, 2010, 7:21:18 PM12/30/10
to mvpa-t...@googlegroups.com
hey olga,

a few thoughts:

1) i thought i remembered thinking that BrikLoad can deal with Nifti
files (as well as Briks).

[BrikLoad is part of the afni-matlab library written by Ziad Saad that
we bundle (with permission) along with the MVPA toolbox - it does all
the hard work for load_afni_*.m]

ah, i just had a look at BrikLoad.m. i think this is the latest version:

http://afni.nimh.nih.gov/pub/dist/matlab/matlab/BrikLoad.m

it does indeed deal with nifti files, but only by calling afni's
'3dcopy' on the command-line behind the scenes to convert nifti -> brik.
this was going to be my next suggestion anyway. however, this requires
that you have a working copy of AFNI on that machine, which might not be
an easy option if you're running Windows.

1b) are you sure you couldn't set up a linux server somewhere that
people could access purely for the purposes of conversion? or
pre-convert the files on linux and save yourself the trouble of dealing
with nifti?

2) install SPM. definitely easier than installing AFNI, though you say
you'd rather not do that. ok - next idea :)

3) in a separate email, you mention a load_nii.m function. i haven't
heard of this. but if you can use it to load in the data as a 4D matrix,
then core/io/load_matrix_pattern.m will help you reshape and store that
matrix in the toolbox subj structure.

garrett might know better than me, since he's worked more on SPM and
file formats. also, the AFNI message board isn't a bad place to try,
since Ziad & the AFNI crew are experts in all things AFNI, NIFTI and Matlab.

g

> --
> You received this message because you are subscribed to the Google
> Groups "Princeton MVPA Toolbox for Matlab" group.
> To post to this group, send email to mvpa-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> mvpa-toolbox...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mvpa-toolbox?hl=en.

Reply all
Reply to author
Forward
0 new messages