@@ -378,35 +378,15 @@ def print_summary(self):
378378 print ('Affine Transformation Matrix: \n ' , self .xform )
379379
380380
381- @deprecate_with_version (
382- "data_tag is an internal API that will be discontinued." ,
383- '2.1' , '4.0' )
384- def data_tag (dataarray , encoding , datatype , ordering ):
385- class DataTag (xml .XmlSerializable ):
386-
387- def __init__ (self , * args ):
388- self .args = args
389-
390- def _to_xml_element (self ):
391- return _data_tag_element (* self .args )
392-
393- return DataTag (dataarray , encoding , datatype , ordering ).to_xml ()
394-
395-
396381def _data_tag_element (dataarray , encoding , dtype , ordering ):
397382 """ Creates data tag with given `encoding`, returns as XML element
398383 """
399384 import zlib
400385 order = array_index_order_codes .npcode [ordering ]
401386 enclabel = gifti_encoding_codes .label [encoding ]
402387 if enclabel == 'ASCII' :
403- # XXX Accommodating data_tag API
404- # On removal (nibabel 4.0) drop str case
405- da = _arr2txt (dataarray , dtype if isinstance (dtype , str ) else KIND2FMT [dtype .kind ])
388+ da = _arr2txt (dataarray , KIND2FMT [dtype .kind ])
406389 elif enclabel in ('B64BIN' , 'B64GZ' ):
407- # XXX Accommodating data_tag API - don't try to fix dtype
408- if isinstance (dtype , str ):
409- dtype = dataarray .dtype
410390 out = np .asanyarray (dataarray , dtype ).tobytes (order )
411391 if enclabel == 'B64GZ' :
412392 out = zlib .compress (out )
0 commit comments