@@ -155,6 +155,7 @@ def rgba(self, rgba):
155
155
raise ValueError ('rgba must be length 4.' )
156
156
self .red , self .green , self .blue , self .alpha = rgba
157
157
158
+
158
159
def _arr2txt (arr , elem_fmt ):
159
160
arr = np .asarray (arr )
160
161
assert arr .dtype .names is None
@@ -404,7 +405,7 @@ def labeltable(self, labeltable):
404
405
405
406
"""
406
407
if not isinstance (labeltable , GiftiLabelTable ):
407
- raise ValueError ("Not a valid GiftiLabelTable instance" )
408
+ raise TypeError ("Not a valid GiftiLabelTable instance" )
408
409
self ._labeltable = labeltable
409
410
410
411
@np .deprecate_with_doc ("Use the gifti_img.labeltable property instead." )
@@ -432,7 +433,7 @@ def meta(self, meta):
432
433
None
433
434
"""
434
435
if not isinstance (meta , GiftiMetaData ):
435
- raise ValueError ("Not a valid GiftiMetaData instance" )
436
+ raise TypeError ("Not a valid GiftiMetaData instance" )
436
437
self ._meta = meta
437
438
438
439
@np .deprecate_with_doc ("Use the gifti_img.labeltable property instead." )
@@ -450,10 +451,9 @@ def add_gifti_data_array(self, dataarr):
450
451
----------
451
452
dataarr : GiftiDataArray
452
453
"""
453
- if isinstance (dataarr , GiftiDataArray ):
454
- self .darrays .append (dataarr )
455
- else :
456
- raise ValueError ("dataarr paramater must be of type GiftiDataArray" )
454
+ if not isinstance (dataarr , GiftiDataArray ):
455
+ raise TypeError ("dataarr paramater must be of type GiftiDataArray" )
456
+ self .darrays .append (dataarr )
457
457
458
458
def remove_gifti_data_array (self , ith ):
459
459
""" Removes the ith data array element from the GiftiImage """
0 commit comments