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: Set shape of data
  
  If ``ndims == len(shape)`` then we set zooms for dimensions higher than
  ``ndims`` to 1.0
  
  Parameters
  ----------
  shape : sequence
     sequence of integers specifying data array shape
docstr_tok: ["Set","shape","of","data","If","``","ndims","==","len","(","shape",")","``","then","we","set","zooms","for","dimensions","higher","than","``","ndims","``","to","1.0","Parameters","--","--","--","--","--","shape",":","sequence","sequence","of","integers","specifying","data","array","shape"]
code: def set_data_shape(self, shape):
      """Set shape of data
  
      If ``ndims == len(shape)`` then we set zooms for dimensions higher than
      ``ndims`` to 1.0
  
      Parameters
      ----------
      shape : sequence
         sequence of integers specifying data array shape
      """
      dims = self._structarr["dim"]
      ndims = len(shape)
      dims[:] = 1
      dims[0] = ndims
      try:
          dims[1 : ndims + 1] = shape
      except (ValueError, OverflowError):
          # numpy 1.4.1 at least generates a ValueError from trying to set a
          # python long into an int64 array (dims are int64 for nifti2)
          values_fit = False
      else:
          values_fit = np.all(dims[1 : ndims + 1] == shape)
      # Error if we did not succeed setting dimensions
      if not values_fit:
          raise HeaderDataError(
              f"shape {shape} does not fit in dim datatype"
          )
      self._structarr["pixdim"][ndims + 1 :] = 1.0
  
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 12 for calling the AnalyzeHeader obj's underlying member method code with example usage: obj.set_data_shape(shape) without return types