devel > Gifti on 64bit Architecture
Showing 1-8 of 8 posts
Display:
Results per page:
Nov 6, 2009  09:11 AM | Stephan Gerhard
Gifti on 64bit Architecture
Hi all!

Has anyone already succeeded to compile and use the gifticlib with Python bindings on a 64bit platform?

I'm using Fedora 11 and was able to compile (giftilib & niftilib), yielding among other
the libgiftiio-1.0.0.so library which are installed in /usr/lib.

Using pygiftiio or Benjamin Tyreau's Gifti code, I am able to load a Gifti file, but when
I want to access its data arrays, it terminate with a segmenatation fault or invalid pointer message.

Your help is very much appreciated.
Stephan
Nov 6, 2009  02:11 PM | Ziad Saad
RE: Gifti on 64bit Architecture
Hi Stephan,

So you suspect the segmentation fault is from gifticlib? If that is the case, upload the file to AFNI's website per the instructions on this page http://afni.nimh.nih.gov/sscc/upload . I'll try and load it on a Fedora linux 64 bit and see what happens.

Rick is out for the next 10 days. So the fix, if it is in gfticlib may take a little while.

I assume you have used the very latest version. Otherwise, please update and be sure the latest version crashes too.

cheers,
ziad
Nov 6, 2009  02:11 PM | Stephan Gerhard
RE: Gifti on 64bit Architecture
Hi Ziad,

I uploaded the file with the name Stephan.tar.gz to afni.

I used the latest version 1.0.4 for Gifti and nifticlib 1.1.0.
It could also potentially be because of conflicts in other libraries (libexpat?), I don't know.

Thanks,
Stephan
Nov 8, 2009  10:11 PM | Richard Reynolds
RE: Gifti on 64bit Architecture
Hi Stephan,

I would expect that to crash.

The underlying dataset structure has changed with the addition of the rgba array
added to giiLabelTable. The python bindings need to be updated to reflect that.

We should ask Ben if he would make such an update, maybe on the NiPy mailing list
(in case he does not see this). If no one else does, I will get in contact with
him, though probably not too soon.

- rick
Nov 9, 2009  02:11 PM | Stephan Gerhard
RE: Gifti on 64bit Architecture
Hi Rick,

I got in touch with Ben and he is trying to reproduce the bug.
We post any news here.

Stephan
Nov 9, 2009  05:11 PM | Erik Anderson
RE: Gifti on 64bit Architecture
Hi Stephan,
I have just posted the required changes to the pygiftiio bindings on the Files page. I have ran them through some preliminary tests and they have performed properly, but please feel free to let me know if you have any problems!

Thanks,
Erik
Nov 9, 2009  07:11 PM | Stephan Gerhard
RE: Gifti on 64bit Architecture
Hi Erik,
Thanks for the update. I tried the pygiftiio bindings with a compiled libgiftiio.so on a 64bit machine.
It loads well the file when I do
from pygiftiio import *
a=gifti_read_image('file.gii', 1)
I can also output the meta information.
But when I want to access the data arrays with either
a.darrays.contents or
a.darrays[0].contents
I get a:
ValueError: NULL pointer access
Do you know what went wrong?
Thanks,
Stephan
Nov 10, 2009  04:11 PM | Erik Anderson
RE: Gifti on 64bit Architecture
Hi Stephan,
I'm not sure what your problem looks like: I can do the following without any problems:

>>> import pygiftiio
>>> image = pygiftiio.gifti_read_image('test.gii', 1)
>>> darray = image.darray.contents.contents
>>> print darray.nvals
466941

Keep in mind that I am trying to leave that majority of the bindings as close as is possible to the C library so that developers can write their own wrappings for things. The GiftiImage class contains a POINTER(POINTER(GiftiDataArray)) as dictated by the underlying C-struct. This requires 2 levels of redirection to get at the GiftiDataArray class on the Python side.

Hopefully this will help!
Thanks,
Erik