@@ -82,9 +82,9 @@ def make_montage(filename, fnames, orientation='h', colorbar=None,
82
82
# dimension-dependent-attributeerror-in-pil-fromarray-function
83
83
fnames = [f if isinstance (f , string_types ) else f .copy () for f in fnames ]
84
84
if isinstance (fnames [0 ], string_types ):
85
- images = map (Image .open , fnames )
85
+ images = list ( map (Image .open , fnames ) )
86
86
else :
87
- images = map (Image .fromarray , fnames )
87
+ images = list ( map (Image .fromarray , fnames ) )
88
88
# get bounding box for cropping
89
89
boxes = []
90
90
for ix , im in enumerate (images ):
@@ -566,7 +566,7 @@ def _get_one_brain(self, d, name):
566
566
'or brain.brains.' % name )
567
567
if isinstance (d , dict ):
568
568
out = dict ()
569
- for key , value in d .iteritems ():
569
+ for key , value in d .items ():
570
570
out [key ] = value [0 ]
571
571
else :
572
572
out = d [0 ]
@@ -595,7 +595,7 @@ def contour(self):
595
595
@property
596
596
def annot (self ):
597
597
"""Wrap to annot"""
598
- return self ._get_one_brain (self .annot_list , 'contour ' )
598
+ return self ._get_one_brain (self .annot_list , 'annot ' )
599
599
600
600
@property
601
601
def texts (self ):
@@ -879,9 +879,11 @@ def add_data(self, array, min=None, max=None, thresh=None,
879
879
if not self .n_times == len (time ):
880
880
raise ValueError ('time is not the same length as '
881
881
'array.shape[1]' )
882
- if isinstance (time_label , basestring ):
882
+ if isinstance (time_label , string_types ):
883
883
time_label_fmt = time_label
884
- time_label = lambda x : time_label_fmt % x
884
+
885
+ def time_label (x ):
886
+ return time_label_fmt % x
885
887
data ["time_label" ] = time_label
886
888
data ["time" ] = time
887
889
data ["time_idx" ] = 0
@@ -1374,7 +1376,7 @@ def add_contour_overlay(self, source, min=None, max=None,
1374
1376
scalar_data = _prepare_data (scalar_data )
1375
1377
1376
1378
# Maybe get rid of an old overlay
1377
- if hasattr ( self , "contour" ) and remove_existing :
1379
+ if remove_existing :
1378
1380
for c in self .contour_list :
1379
1381
c ['surface' ].remove ()
1380
1382
if c ['colorbar' ] is not None :
@@ -2234,7 +2236,7 @@ def animate(self, views, n_steps=180., fname=None, use_cache=False,
2234
2236
Column index of the brain to use
2235
2237
"""
2236
2238
brain = self .brain_matrix [row , col ]
2237
- gviews = map (brain ._xfm_view , views )
2239
+ gviews = list ( map (brain ._xfm_view , views ) )
2238
2240
allowed = ('lateral' , 'caudal' , 'medial' , 'rostral' )
2239
2241
if not len ([v for v in gviews if v in allowed ]) == len (gviews ):
2240
2242
raise ValueError ('Animate through %s views.' % ' ' .join (allowed ))
0 commit comments