diff --git a/nibabel/benchmarks/bench_streamlines.py b/nibabel/benchmarks/bench_streamlines.py index 95ba79fb61..3928fcfd4d 100644 --- a/nibabel/benchmarks/bench_streamlines.py +++ b/nibabel/benchmarks/bench_streamlines.py @@ -91,5 +91,6 @@ def bench_load_trk(): for s1, s2 in zip(scalars_new, scalars_old): assert_array_equal(s1, s2) + if __name__ == '__main__': bench_load_trk() diff --git a/nibabel/casting.py b/nibabel/casting.py index a373a91df7..caa5ead0ad 100644 --- a/nibabel/casting.py +++ b/nibabel/casting.py @@ -165,6 +165,7 @@ def shared_range(flt_type, int_type): _SHARED_RANGES[key] = (mn, mx) return mn, mx + # ---------------------------------------------------------------------------- # Routines to work out the next lowest representable integer in floating point # types. diff --git a/nibabel/imageclasses.py b/nibabel/imageclasses.py index 265e77f78a..dca230f67c 100644 --- a/nibabel/imageclasses.py +++ b/nibabel/imageclasses.py @@ -40,6 +40,7 @@ class ClassMapDict(dict): def __getitem__(self, *args, **kwargs): return super(ClassMapDict, self).__getitem__(*args, **kwargs) + class_map = ClassMapDict( analyze={'class': AnalyzeImage, # Image class 'ext': '.img', # characteristic image extension @@ -95,6 +96,7 @@ class ExtMapRecoder(Recoder): def __getitem__(self, *args, **kwargs): return super(ExtMapRecoder, self).__getitem__(*args, **kwargs) + # mapping of extensions to default image class names ext_map = ExtMapRecoder(( ('nifti_single', '.nii'), diff --git a/nibabel/orientations.py b/nibabel/orientations.py index 2567b41987..bc85173c1c 100644 --- a/nibabel/orientations.py +++ b/nibabel/orientations.py @@ -63,7 +63,7 @@ def io_orientation(affine, tol=None): RS = RZS / zooms # Transform below is polar decomposition, returning the closest # shearless matrix R to RS - P, S, Qs = npl.svd(RS) + P, S, Qs = npl.svd(RS, full_matrices=False) # Threshold the singular values to determine the rank. if tol is None: tol = S.max() * max(RS.shape) * np.finfo(S.dtype).eps diff --git a/nibabel/spm2analyze.py b/nibabel/spm2analyze.py index 75e59019e9..1b53238b44 100644 --- a/nibabel/spm2analyze.py +++ b/nibabel/spm2analyze.py @@ -130,5 +130,6 @@ class Spm2AnalyzeImage(spm99.Spm99AnalyzeImage): """ header_class = Spm2AnalyzeHeader + load = Spm2AnalyzeImage.load save = Spm2AnalyzeImage.instance_to_filename