A Sunday 31 October 2010 11:38:21 Stephan Gerhard escrigué:
> Hi Francesc,
> 
> We are trying use PyTables to store fiber data from Neuroimaging in
> HDF5. We have a Python list of Numpy arrays, where each array is of a
> different first dimension N (N,3). We would like to store this data
> in an HDF5 file. We tried to convert it to dtype object, but this
> seems to be not supported by HDF5.
> 
> Do you have any idea how we could convert the data into a structure
> that is possible to save in HDF5, or maybe using some other feature
> of Tables? We need to do random access on a _fiber_ (list element
> level) and retrieve its corresponding (N,3) array fast.

Hmm, I'm afraid that PyTables does not have support for writing this 
into an HDF5-compliant file.  However, you may want to use a VLArray 
object in combination with a ObjectAtom.  This will allow you to do what 
you want, but serializing the list first via Python's cPickle module.

The disadvantage of this method is that you won't be able to retrieve 
the values from a non-python HDF5 application (pickle is a serialization 
method only available in Python).

Finally, if you want to reply to this, please subscribe first to the 
pytables-users list in:

https://lists.sourceforge.net/lists/listinfo/pytables-users

and the reply to the list.  This may let others to learn (and 
participate!) from the discussion.

Cheers,

-- 
Francesc Alted

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to