@@ -105,7 +105,7 @@ def __init__(self,
105105 hdr = np .ndarray (shape = (),
106106 dtype = self .template_dtype ,
107107 buffer = binaryblock )
108- #if goodRASFlag, discard delta, Mdc and c_ras stuff
108+ # if goodRASFlag, discard delta, Mdc and c_ras stuff
109109 if int (hdr ['goodRASFlag' ]) < 0 :
110110 hdr = self ._set_affine_default (hdr )
111111 self ._header_data = hdr .copy ()
@@ -179,15 +179,14 @@ def from_fileobj(klass, fileobj, check=True):
179179 # dimensions from the header, skip over and then read the footer
180180 # information
181181 hdr_str = fileobj .read (klass ._hdrdtype .itemsize )
182- hdr_str_to_np = np .ndarray (shape = (),
183- dtype = klass ._hdrdtype ,
184- buffer = hdr_str )
182+ hdr_str_to_np = np .ndarray (shape = (), dtype = klass ._hdrdtype ,
183+ buffer = hdr_str )
185184 if not np .all (hdr_str_to_np ['dims' ]):
186185 raise MGHError ('Dimensions of the data should be non-zero' )
187186 tp = int (hdr_str_to_np ['type' ])
188- fileobj .seek (DATA_OFFSET + \
189- int (klass ._data_type_codes .bytespervox [tp ]) * \
190- np .prod (hdr_str_to_np ['dims' ]))
187+ fileobj .seek (DATA_OFFSET +
188+ int (klass ._data_type_codes .bytespervox [tp ]) *
189+ np .prod (hdr_str_to_np ['dims' ]))
191190 ftr_str = fileobj .read (klass ._ftrdtype .itemsize )
192191 return klass (hdr_str + ftr_str , check )
193192
@@ -344,7 +343,7 @@ def set_data_shape(self, shape):
344343 def get_data_bytespervox (self ):
345344 ''' Get the number of bytes per voxel of the data
346345 '''
347- return int (self ._data_type_codes .bytespervox [ \
346+ return int (self ._data_type_codes .bytespervox [
348347 int (self ._header_data ['type' ])])
349348
350349 def get_data_size (self ):
@@ -483,10 +482,10 @@ def from_file_map(klass, file_map, mmap=True):
483482 mmap : {True, False, 'c', 'r'}, optional, keyword only
484483 `mmap` controls the use of numpy memory mapping for reading image
485484 array data. If False, do not try numpy ``memmap`` for data array.
486- If one of {'c', 'r'}, try numpy memmap with ``mode=mmap``. A `mmap`
487- value of True gives the same behavior as ``mmap='c'``. If image
488- data file cannot be memory-mapped, ignore `mmap` value and read
489- array from file.
485+ If one of {'c', 'r'}, try numpy memmap with ``mode=mmap``. A
486+ `mmap` value of True gives the same behavior as ``mmap='c'``. If
487+ image data file cannot be memory-mapped, ignore `mmap` value and
488+ read array from file.
490489 '''
491490 if not mmap in (True , False , 'c' , 'r' ):
492491 raise ValueError ("mmap should be one of {True, False, 'c', 'r'}" )
@@ -513,10 +512,10 @@ def from_filename(klass, filename, mmap=True):
513512 mmap : {True, False, 'c', 'r'}, optional, keyword only
514513 `mmap` controls the use of numpy memory mapping for reading image
515514 array data. If False, do not try numpy ``memmap`` for data array.
516- If one of {'c', 'r'}, try numpy memmap with ``mode=mmap``. A `mmap`
517- value of True gives the same behavior as ``mmap='c'``. If image
518- data file cannot be memory-mapped, ignore `mmap` value and read
519- array from file.
515+ If one of {'c', 'r'}, try numpy memmap with ``mode=mmap``. A
516+ `mmap` value of True gives the same behavior as ``mmap='c'``. If
517+ image data file cannot be memory-mapped, ignore `mmap` value and
518+ read array from file.
520519
521520 Returns
522521 -------
0 commit comments