nipy/nibabel — Issue #77: Nibabel Nifti and Analyze images do not pickle
Author: GaelVaroquaux
Created: 2011-12-28 11:06:52+00:00
State: open

In [1]: import nibabel

In [2]: img = nibabel.load('/usr/share/fsl/data/standard/MNI152_T1_1mm.nii.gz')

In [3]: import pickle

In [4]: s = pickle.dumps(img)
PicklingError: Can't pickle : it's not found as nibabel.analyze.ImageArrayProxy

Pickling is useful for many operations in Python frameworks, for instance hashing with an MD5, or parallel computing (e.g. with multiprocessing).