[pymvpa] Fwd: Data import with pynifti

Yaroslav Halchenko debian at onerussian.com
Wed Mar 30 12:38:03 UTC 2011


I thought you ran


for f in *.img; do python -c "import sys, nifti as n; h=n.NiftiImage(sys.argv[1]).header; print h['scl_slope'], h['scl_inter']" $f; done

to print out those scl_* fields and they came out different.  Could you just
may be share 2 of those files (the one which was reported to have different
value from the rest and some other)?

On Wed, 30 Mar 2011, Roberto Guidotti wrote:

>    Well, I opened some images with MRICro, and the scaling parameters are
>    setted like first one (17.0, 19.0) and also with SPM and Matlab I have
>    for each image the same values.
>    Probably the Nifti-Python library store only the first image value for
>    all the others, but practically I'm sure that my data are managed
>    correctly! :)
>    RG

>    2011/3/29 Yaroslav Halchenko <[1]debian at onerussian.com>

>      interesting how come they got different scaling parameters... I
>      assume
>      if prior conversion/preprocessing was somewhat uniform they all
>      should
>      have had either set them to some values (like the 1st one) or just
>      to 0
>      (like the rest).  probably all others were simply resliced into the
>      first one ;)
>      and each image corresponds just to a single volume, thus not to a
>      "chunk" thus previously you had 0th sample as an outlier -- its
>      values
>      were not scaled properly upon providing its NiftiImage into
>      NiftiDataset.  now things should be better (I hope ;) )

>    On Tue, 29 Mar 2011, Roberto Guidotti wrote:

>    >    I'm so interested in the discussion, I hope you are not bored!! ;)
>    >    The output of line code you post is:
>    >    17.0 19.0
>    >    0.0 0.0
>    >    0.0 0.0
>    >    [and other couple of zeros!!]
>    >    So I open file as NiftiImage and append every *.img in a list and
>    then
>    >    load into a NiftiDataset!!!
>    >    RG
-- 
=------------------------------------------------------------------=
Keep in touch                                     www.onerussian.com
Yaroslav Halchenko                 www.ohloh.net/accounts/yarikoptic



More information about the Pkg-ExpPsy-PyMVPA mailing list