1- from collections import Sequence
1+ try :
2+ from collections .abc import Sequence
3+ except ImportError : # Py 2.7
4+ from collections import Sequence
25from distutils .version import LooseVersion
36import logging
47import warnings
@@ -150,7 +153,7 @@ def load_curvature(self):
150153 """Load in curvature values from the ?h.curv file."""
151154 curv_path = op .join (self .data_path , "surf" , "%s.curv" % self .hemi )
152155 self .curv = nib .freesurfer .read_morph_data (curv_path )
153- self .bin_curv = np .array (self .curv > 0 , np . int )
156+ self .bin_curv = np .array (self .curv > 0 , int )
154157
155158 def load_label (self , name ):
156159 """Load in a Freesurfer .label file.
@@ -163,7 +166,7 @@ def load_label(self, name):
163166 """
164167 label = nib .freesurfer .read_label (op .join (self .data_path , 'label' ,
165168 '%s.%s.label' % (self .hemi , name )))
166- label_array = np .zeros (len (self .x ), np . int )
169+ label_array = np .zeros (len (self .x ), int )
167170 label_array [label ] = 1
168171 try :
169172 self .labels [name ] = label_array
@@ -513,10 +516,10 @@ def create_color_lut(cmap, n_colors=256, center=None):
513516 if np .ndim (cmap ) == 2 :
514517 if cmap .shape [1 ] == 4 :
515518 # This looks likes a LUT that's ready to go
516- lut = cmap .astype (np . int )
519+ lut = cmap .astype (int )
517520 elif cmap .shape [1 ] == 3 :
518521 # This looks like a LUT, but it's missing the alpha channel
519- alpha = np .ones (len (cmap ), np . int ) * 255
522+ alpha = np .ones (len (cmap ), int ) * 255
520523 lut = np .c_ [cmap , alpha ]
521524
522525 return lut
@@ -548,7 +551,7 @@ def create_color_lut(cmap, n_colors=256, center=None):
548551 raise ValueError ("Input %r was not valid for making a lut" % cmap )
549552
550553 # Convert from a matplotlib colormap to a lut array
551- lut = (cmap (np .linspace (0 , 1 , n_colors )) * 255 ).astype (np . int )
554+ lut = (cmap (np .linspace (0 , 1 , n_colors )) * 255 ).astype (int )
552555
553556 return lut
554557
0 commit comments