class_docstr: Class for basic analyze header
  
  Implements zoom-only setting of affine transform, and no image
  scaling
class_docstr_tok: ["Class","for","basic","analyze","header","Implements","zoom-only","setting","of","affine","transform",",","and","no","image","scaling"]
docstr: Get affine from basic (shared) header fields
  
  Note that we get the translations from the center of the
  image.
  
  Examples
  --------
  >>> hdr = AnalyzeHeader()
  >>> hdr.set_data_shape((3, 5, 7))
  >>> hdr.set_zooms((3, 2, 1))
  >>> hdr.default_x_flip
  True
  >>> hdr.get_base_affine() # from center of image
  array([[-3.,  0.,  0.,  3.],
         [ 0.,  2.,  0., -4.],
         [ 0.,  0.,  1., -3.],
         [ 0.,  0.,  0.,  1.]])
docstr_tok: ["Get","affine","from","basic","(","shared",")","header","fields","Note","that","we","get","the","translations","from","the","center","of","the","image",".","Examples","--","--","--","--",">",">",">","hdr","=","AnalyzeHeader","(",")",">",">",">","hdr.set_data_shape","(","(","3",",","5",",","7",")",")",">",">",">","hdr.set_zooms","(","(","3",",","2",",","1",")",")",">",">",">","hdr.default_x_flip","True",">",">",">","hdr.get_base_affine","(",")","#","from","center","of","image","array","(","[","[","-3.",",","0.",",","0.",",","3",".","]",",","[","0.",",","2.",",","0.",",","-4",".","]",",","[","0.",",","0.",",","1.",",","-3",".","]",",","[","0.",",","0.",",","0.",",","1",".","]","]",")"]
code: def get_base_affine(self):
      """Get affine from basic (shared) header fields
  
      Note that we get the translations from the center of the
      image.
  
      Examples
      --------
      >>> hdr = AnalyzeHeader()
      >>> hdr.set_data_shape((3, 5, 7))
      >>> hdr.set_zooms((3, 2, 1))
      >>> hdr.default_x_flip
      True
      >>> hdr.get_base_affine() # from center of image
      array([[-3.,  0.,  0.,  3.],
             [ 0.,  2.,  0., -4.],
             [ 0.,  0.,  1., -3.],
             [ 0.,  0.,  0.,  1.]])
      """
      hdr = self._structarr
      dims = hdr["dim"]
      ndim = dims[0]
      return shape_zoom_affine(
          hdr["dim"][1 : ndim + 1],
          hdr["pixdim"][1 : ndim + 1],
          self.default_x_flip,
      )
  
imports: from __future__ import annotations
  import numpy
  from .arrayproxy import ArrayProxy
  from .arraywriters import ArrayWriter, WriterError, get_slope_inter, make_array_writer
  from .batteryrunners import Report
  from .fileholders import copy_file_map
  from .spatialimages import HeaderDataError, HeaderTypeError, SpatialHeader, SpatialImage
  from .volumeutils import apply_read_scaling, array_from_file, make_dt_codes, native_code, seek_tell, shape_zoom_affine, swapped_code
  from .wrapstruct import LabeledWrapStruct
label_desc: Use image node_id 13 for calling the AnalyzeHeader obj's underlying member method code with example usage: obj.get_base_affine() and returns: shape_zoom_affine