77#
88### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99''' Read / write access to NIfTI1 image format
10+
11+ NIfTI1 format defined at http://nifti.nimh.nih.gov/nifti-1/
1012'''
1113from __future__ import division , print_function
1214import warnings
@@ -518,10 +520,10 @@ def from_fileobj(klass, fileobj, size, byteswap):
518520
519521
520522class Nifti1Header (SpmAnalyzeHeader ):
521- ''' Class for NIFTI1 header
523+ ''' Class for NIfTI1 header
522524
523- The NIFTI1 header has many more coded fields than the simpler Analyze
524- variants. Nifti1 headers also have extensions.
525+ The NIfTI1 header has many more coded fields than the simpler Analyze
526+ variants. NIfTI1 headers also have extensions.
525527
526528 Nifti allows the header to be a separate file, as part of a nifti image /
527529 header pair, or to precede the data in a single file. The object needs to
@@ -1067,7 +1069,7 @@ def set_slope_inter(self, slope, inter=None):
10671069 self ._structarr ['scl_inter' ] = inter
10681070
10691071 def get_dim_info (self ):
1070- ''' Gets nifti MRI slice etc dimension information
1072+ ''' Gets NIfTI MRI slice etc dimension information
10711073
10721074 Returns
10731075 -------
@@ -1080,7 +1082,7 @@ def get_dim_info(self):
10801082
10811083 where ``data array`` is the array returned by ``get_data``
10821084
1083- Because nifti1 files are natively Fortran indexed:
1085+ Because NIfTI1 files are natively Fortran indexed:
10841086 0 is fastest changing in file
10851087 1 is medium changing in file
10861088 2 is slowest changing in file
@@ -1262,7 +1264,7 @@ def get_slice_duration(self):
12621264
12631265 Notes
12641266 -----
1265- The Nifti1 spec appears to require the slice dimension to be
1267+ The NIfTI1 spec appears to require the slice dimension to be
12661268 defined for slice_duration to have meaning.
12671269 '''
12681270 _ , _ , slice_dim = self .get_dim_info ()
@@ -1572,12 +1574,14 @@ def _chk_xform_code(klass, code_type, hdr, fix):
15721574
15731575
15741576class Nifti1PairHeader (Nifti1Header ):
1575- ''' Class for nifti1 pair header '''
1577+ ''' Class for NIfTI1 pair header '''
15761578 # Signal whether this is single (header + data) file
15771579 is_single = False
15781580
15791581
15801582class Nifti1Pair (analyze .AnalyzeImage ):
1583+ """ Class for NIfTI1 format image, header pair
1584+ """
15811585 header_class = Nifti1PairHeader
15821586
15831587 def __init__ (self , dataobj , affine , header = None ,
@@ -1795,6 +1799,8 @@ def set_sform(self, affine, code=None, **kwargs):
17951799
17961800
17971801class Nifti1Image (Nifti1Pair ):
1802+ """ Class for single file NIfTI1 format image
1803+ """
17981804 header_class = Nifti1Header
17991805 files_types = (('image' , '.nii' ),)
18001806
@@ -1815,7 +1821,7 @@ def update_header(self):
18151821
18161822
18171823def load (filename ):
1818- """ Load nifti1 single or pair from `filename`
1824+ """ Load NIfTI1 single or pair from `filename`
18191825
18201826 Parameters
18211827 ----------
@@ -1825,11 +1831,11 @@ def load(filename):
18251831 Returns
18261832 -------
18271833 img : Nifti1Image or Nifti1Pair
1828- nifti1 single or pair image instance
1834+ NIfTI1 single or pair image instance
18291835
18301836 Raises
18311837 ------
1832- ImageFileError: if `filename` doesn't look like nifti1
1838+ ImageFileError: if `filename` doesn't look like NIfTI1
18331839 IOError : if `filename` does not exist
18341840 """
18351841 try :
@@ -1840,7 +1846,7 @@ def load(filename):
18401846
18411847
18421848def save (img , filename ):
1843- """ Save nifti1 single or pair to `filename`
1849+ """ Save NIfTI1 single or pair to `filename`
18441850
18451851 Parameters
18461852 ----------
0 commit comments