[pymvpa] How to create bold.nii.gz?

Yaroslav Halchenko debian at onerussian.com
Fri Dec 26 17:34:40 UTC 2008


On Fri, 26 Dec 2008, Yune Lee wrote:

>    many thanks always for your help, Michael

>    I have already preprocessed image files in analyze format. Should I
>    just convert them into 4D nifti in SPM5 and use it in the pyMVPA

>    or can I also load the individual .img/.hdr (total 925files) in the
>    python given it also supports analyze format?
if you are running released version (0.4.0), then you would need either to load
them manually in the loop and concatenate to provide into Dataset.

If you are running master branch then since
1947ecad0f3c6181ac8678ea36af2d5900545611 from 15th of Dec,
there is a support to provide as samples a list with filenames, where
each file is a volume)..

smth like
nds2 = NiftiDataset(samples=['file1.nii.gz', 'file2.nii.gz'],
		mask=maskfile, chunks=1, labels=1)


>    Thanks,

>    YSL


>    On Fri, Dec 26, 2008 at 11:55 AM, Michael Hanke
>    <[1]michael.hanke at gmail.com> wrote:

>    On Fri, Dec 26, 2008 at 04:12:13PM +0000, Matthew Brett wrote:
>    > Hi,

>    > On Fri, Dec 26, 2008 at 3:21 PM, Yaroslav Halchenko
>    > <[2]debian at onerussian.com> wrote:
>    > >>    I've been using analyze format (.img/.hdr) in SPM5 installed in
>    > >>    window OS and now I need to convert from analyze to nifti
>    format in
>    > >>    order to use the pyMVPA.
>    > > you do not have to -- nifti.NiftiImage used by PyMVPA is capable of
>    > > reading analyze files. It is just that NIfTI is better ;-)

>    > I assume that this is SPM's Nifti img/hdr pair though - it's an
>    > allowable version of the nifti format where the header and data are
>    in
>    > different files.  Confusingly it has the same file names as the
>    > Analyze format...

>      Both. PyNIfTI uses the nifticlib reference implementation (just as
>      FSL
>      does). It reads plain ANALYZE (without NIfTI header extension) as
>      hdr/img file pair, as well as single file nifti (commpressed and
>      uncompressed), but also nifti file pairs (also hdr/img, and
>      optionally
>      compressed as hdr.gz/nii.gz). The most recent version of PyNIfTI
>      also
>      provides memory-mapped access to uncompressed NIfTI files.
>      Cheers,

>    Michael
-- 
Yaroslav Halchenko
Research Assistant, Psychology Department, Rutgers-Newark
Student  Ph.D. @ CS Dept. NJIT
Office: (973) 353-1412 | FWD: 82823 | Fax: (973) 353-1171
        101 Warren Str, Smith Hall, Rm 4-105, Newark NJ 07102
WWW:     http://www.linkedin.com/in/yarik        



More information about the Pkg-ExpPsy-PyMVPA mailing list