-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Save SpatialImages into HDF5 files. #215
base: master
Are you sure you want to change the base?
Conversation
First commit: functions to save a Nifti1Image into a HDF5 file group and retrieve it back.
Using a "with" statement to open the hdf files. To access the dataset values ".values" is old, changed to [()].
Thanks for this. I had a quick look. If I understand right, you just save the data, affine, extra components as I guess we lose The advantage over MINC2, as I understand it, is that you can store more than This idea makes me think again about whether we want our own data format to save I mean a format that could capture what we need from Nifti, MINC, DICOM and save I realize the question's a bit general - I'll try and post to the list with more |
Hi, I'm sorry for not replying previously. I'm using the code I uploaded here and had to do one change lately. If you like it I can develop this idea more. Thanks! Kind regards, Alexandre Manhães Savio [email protected] On 12 December 2013 01:54, Matthew Brett [email protected] wrote:
|
Thanks for reminding me. Sorry, I got submerged under a sea of Christmas and New Year comestibles. I will post to the list in a day or two. The reason I'm being slow is because I'm trying to think what our own image format would look like, and that will take some serious work and thinking that I haven't been able to do yet. |
Hi, Thanks for your reply! I was planning to use this as a tool for compression, help in the Using nipype lately, I have been thinking on programming an HDFDataSource HDF may be a good support for all this, or not... Cheers, Alexandre Manhães Savio [email protected] On 14 January 2014 16:54, Matthew Brett [email protected] wrote:
|
Oops - got buried again when traveling. I need to clear my inbox, but I hope to get to this by the beginning of next week. The NI-DM looks pretty intimidating. |
No sweat. Thx. Intimidating, yes indeed. Alexandre Manhães Savio [email protected] On 23 January 2014 22:33, Matthew Brett [email protected] wrote:
|
If someone wants to resurrect this at some point, I wrote some code that allows saving Python objects to HDF5: https://github.com/LABSN/expyfun/blob/master/expyfun/io/_hdf5.py It can handle lists, strings, floats, ints, ndarrays, dicts, etc. and nesting of these types. There are some minor restrictions right now (e.g., all dict keys must be strings), but it might nonetheless be useful. |
I looked this over, and this seems more useful for defining datasets, rather than individual images. I think of Perhaps something useful would be to have a website example of how to use HDF5 to store an entire dataset in a single HDF5 file (which is what the pymvpa folks did for the Haxby 2001 and 2011 datasets). |
Ben - can you give links to the PyMVPA hdf5 datasets? |
@matthew-brett please use http://data.pymvpa.org/datasets/hyperalignment_tutorial_data/hyperalignment_tutorial_data_2.4.hdf5.gz. If you'd like code for downloading and loading the file, please install nidata and run: |
First commit: functions to save a Nifti1Image into a HDF5 file group and retrieve it back.