88### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99''' Common interface for any image format--volume or surface, binary or xml.'''
1010
11- import os .path
1211import warnings
1312
14- import numpy as np
15-
1613from .externals .six import string_types
1714from .fileholders import FileHolder
1815from .filename_parser import (types_filenames , TypesFilenamesError ,
@@ -92,8 +89,8 @@ class FileBasedImage(object):
9289 * instance_to_filename(img, fname) - save ``img`` instance to
9390 filename ``fname``.
9491
95- It also has a ``header`` - some standard set of meta-data that is specific to
96- the image format, and ``extra`` - a dictionary container for any other
92+ It also has a ``header`` - some standard set of meta-data that is specific
93+ to the image format, and ``extra`` - a dictionary container for any other
9794 metadata.
9895
9996 You cannot slice an image, and trying to slice an image generates an
@@ -115,9 +112,9 @@ class FileBasedImage(object):
115112
116113 img.from_filename(fname)
117114
118- The image stores its associated files in its ``file_map`` attribute. In order
119- to just save an image, for which you know there is an associated filename, or
120- other storage, you can do::
115+ The image stores its associated files in its ``file_map`` attribute. In
116+ order to just save an image, for which you know there is an associated
117+ filename, or other storage, you can do::
121118
122119 img.to_file_map()
123120
@@ -148,6 +145,7 @@ class FileBasedImage(object):
148145 example, the Analyze data format needs an ``image`` and a ``header``
149146 file type for storage:
150147
148+ >>> import numpy as np
151149 >>> import nibabel as nib
152150 >>> data = np.arange(24, dtype='f4').reshape((2,3,4))
153151 >>> img = nib.AnalyzeImage(data, np.eye(4))
0 commit comments