Strip NiBabel objects from a dataset (in-place modification).

Prior PyMVPA version 2.4, datasets created from MRI data used to contain NiBabel objects, such as image header instances. As a consequence, re-loading such datasets from a serialized form (e.g. form HDF5 files) can suffer from NiBabel API changes, and sometimes prevent loading completely.

This function converts these NiBabel internals into a simpler form that helps to process such datasets with a much wider range of NiBabel versions, and removes the need to have NiBabel installed for simply loading such a dataset.

Run this function on a dataset to modify it in-place and make it more robust for storage in HDF5 format or other forms of serialization.

It is safe to run this function on already converted datasets. The resulting datasets require PyMVPA v2.4 or later for exporting into the NIfTI format, but are otherwise compatible with any 2.x version as well.


ds : Dataset

To be converted dataset



Modification is done in-place.