@@ -122,13 +122,6 @@ def data(self):
122122 def from_dict (klass , data_dict ):
123123 return klass (data_dict )
124124
125- @deprecate_with_version (
126- 'get_metadata method deprecated. '
127- "Use the metadata property instead." ,
128- '2.1' , '4.0' )
129- def get_metadata (self ):
130- return dict (self )
131-
132125 @property
133126 @deprecate_with_version (
134127 'metadata property deprecated. Use GiftiMetaData object '
@@ -274,13 +267,6 @@ def __repr__(self):
274267 r , g , b , a = chars .astype ('u1' )
275268 return f'<GiftiLabel { self .key } ="#{ r :02x} { g :02x} { b :02x} { a :02x} ">'
276269
277- @deprecate_with_version (
278- 'get_rgba method deprecated. '
279- "Use the rgba property instead." ,
280- '2.1' , '4.0' )
281- def get_rgba (self ):
282- return self .rgba
283-
284270 @property
285271 def rgba (self ):
286272 """ Returns RGBA as tuple """
@@ -488,68 +474,6 @@ def __repr__(self):
488474 def num_dim (self ):
489475 return len (self .dims )
490476
491- # Setter for backwards compatibility with pymvpa
492- @num_dim .setter
493- @deprecate_with_version (
494- "num_dim will be read-only in future versions of nibabel" ,
495- '2.1' , '4.0' )
496- def num_dim (self , value ):
497- if value != len (self .dims ):
498- raise ValueError (f'num_dim value { value } != number of '
499- f'dimensions len(self.dims) { len (self .dims )} ' )
500-
501- @classmethod
502- @deprecate_with_version (
503- 'from_array method is deprecated. '
504- 'Please use GiftiDataArray constructor instead.' ,
505- '2.1' , '4.0' )
506- def from_array (klass ,
507- darray ,
508- intent = "NIFTI_INTENT_NONE" ,
509- datatype = None ,
510- encoding = "GIFTI_ENCODING_B64GZ" ,
511- endian = sys .byteorder ,
512- coordsys = None ,
513- ordering = "C" ,
514- meta = None ):
515- """ Creates a new Gifti data array
516-
517- Parameters
518- ----------
519- darray : ndarray
520- NumPy data array
521- intent : string
522- NIFTI intent code, see nifti1.intent_codes
523- datatype : None or string, optional
524- NIFTI data type codes, see nifti1.data_type_codes
525- If None, the datatype of the NumPy array is taken.
526- encoding : string, optionaal
527- Encoding of the data, see util.gifti_encoding_codes;
528- default: GIFTI_ENCODING_B64GZ
529- endian : string, optional
530- The Endianness to store the data array. Should correspond to the
531- machine endianness. default: system byteorder
532- coordsys : GiftiCoordSystem, optional
533- If None, a identity transformation is taken.
534- ordering : string, optional
535- The ordering of the array. see util.array_index_order_codes;
536- default: RowMajorOrder - C ordering
537- meta : None or dict, optional
538- A dictionary for metadata information. If None, gives empty dict.
539-
540- Returns
541- -------
542- da : instance of our own class
543- """
544- return klass (data = darray ,
545- intent = intent ,
546- datatype = datatype ,
547- encoding = encoding ,
548- endian = endian ,
549- coordsys = coordsys ,
550- ordering = ordering ,
551- meta = meta )
552-
553477 def _to_xml_element (self ):
554478 # fix endianness to machine endianness
555479 self .endian = gifti_endian_codes .code [sys .byteorder ]
@@ -580,40 +504,6 @@ def _to_xml_element(self):
580504
581505 return data_array
582506
583- @deprecate_with_version (
584- 'to_xml_open method deprecated. '
585- 'Use the to_xml() function instead.' ,
586- '2.1' , '4.0' )
587- def to_xml_open (self ):
588- out = """<DataArray Intent="%s"
589- \t DataType="%s"
590- \t ArrayIndexingOrder="%s"
591- \t Dimensionality="%s"
592- %s\t Encoding="%s"
593- \t Endian="%s"
594- \t ExternalFileName="%s"
595- \t ExternalFileOffset="%d">\n """
596- di = ""
597- for i , n in enumerate (self .dims ):
598- di = di + f'\t Dim{ i } ="{ n } \" \n '
599- return out % (intent_codes .niistring [self .intent ],
600- data_type_codes .niistring [self .datatype ],
601- array_index_order_codes .label [self .ind_ord ],
602- str (self .num_dim ),
603- str (di ),
604- gifti_encoding_codes .specs [self .encoding ],
605- gifti_endian_codes .specs [self .endian ],
606- self .ext_fname ,
607- self .ext_offset ,
608- )
609-
610- @deprecate_with_version (
611- 'to_xml_close method deprecated. '
612- 'Use the to_xml() function instead.' ,
613- '2.1' , '4.0' )
614- def to_xml_close (self ):
615- return "</DataArray>\n "
616-
617507 def print_summary (self ):
618508 print ('Intent: ' , intent_codes .niistring [self .intent ])
619509 print ('DataType: ' , data_type_codes .niistring [self .datatype ])
@@ -630,13 +520,6 @@ def print_summary(self):
630520 print ('Coordinate System:' )
631521 print (self .coordsys .print_summary ())
632522
633- @deprecate_with_version (
634- 'get_metadata method deprecated. '
635- "Use the metadata property instead." ,
636- '2.1' , '4.0' )
637- def get_metadata (self ):
638- return dict (self .meta )
639-
640523 @property
641524 def metadata (self ):
642525 """ Returns metadata as dictionary """
@@ -718,20 +601,6 @@ def labeltable(self, labeltable):
718601 raise TypeError ("Not a valid GiftiLabelTable instance" )
719602 self ._labeltable = labeltable
720603
721- @deprecate_with_version (
722- 'set_labeltable method deprecated. '
723- "Use the gifti_img.labeltable property instead." ,
724- '2.1' , '4.0' )
725- def set_labeltable (self , labeltable ):
726- self .labeltable = labeltable
727-
728- @deprecate_with_version (
729- 'get_labeltable method deprecated. '
730- "Use the gifti_img.labeltable property instead." ,
731- '2.1' , '4.0' )
732- def get_labeltable (self ):
733- return self .labeltable
734-
735604 @property
736605 def meta (self ):
737606 return self ._meta
@@ -748,20 +617,6 @@ def meta(self, meta):
748617 raise TypeError ("Not a valid GiftiMetaData instance" )
749618 self ._meta = meta
750619
751- @deprecate_with_version (
752- 'set_meta method deprecated. '
753- "Use the gifti_img.meta property instead." ,
754- '2.1' , '4.0' )
755- def set_metadata (self , meta ):
756- self .meta = meta
757-
758- @deprecate_with_version (
759- 'get_meta method deprecated. '
760- "Use the gifti_img.meta property instead." ,
761- '2.1' , '4.0' )
762- def get_meta (self ):
763- return self .meta
764-
765620 def add_gifti_data_array (self , dataarr ):
766621 """ Adds a data array to the GiftiImage
767622
@@ -925,13 +780,6 @@ def agg_data(self, intent_code=None):
925780
926781 return all_data
927782
928- @deprecate_with_version (
929- 'getArraysFromIntent method deprecated. '
930- "Use get_arrays_from_intent instead." ,
931- '2.1' , '4.0' )
932- def getArraysFromIntent (self , intent ):
933- return self .get_arrays_from_intent (intent )
934-
935783 def print_summary (self ):
936784 print ('----start----' )
937785 print ('Source filename: ' , self .get_filename ())
0 commit comments