class_docstr: A medpy header object.
  
  Stores spacing, offset/origin, direction, and possibly further meta information.
  Provide at least one of the parameters. Missing information is extracted from
  the ``sitkimage`` or, if not supplied, set to a default value. 
  
  Parameters
  ----------
  spacing : tuple of floats
      the image's voxel spacing
      defaults to a tuple of `1.0`s
  offset : tuple of floats
      the image's offset/origin
      defaults to a tuple of `0.0`s
  direction : ndarray
      the image's affine transformation matrix
      must be of square shape
      default to the identity matrix
  sitkimage : sitk.Image
      the simple itk image as loaded
class_docstr_tok: ["A","medpy","header","object",".","Stores","spacing",",","offset\/origin",",","direction",",","and","possibly","further","meta","information",".","Provide","at","least","one","of","the","parameters",".","Missing","information","is","extracted","from","the","``","sitkimage","``","or",",","if","not","supplied",",","set","to","a","default","value",".","Parameters","--","--","--","--","--","spacing",":","tuple","of","floats","the","image","'s","voxel","spacing","defaults","to","a","tuple","of","`","1.0","`","s","offset",":","tuple","of","floats","the","image","'s","offset\/origin","defaults","to","a","tuple","of","`","0.0","`","s","direction",":","ndarray","the","image","'s","affine","transformation","matrix","must","be","of","square","shape","default","to","the","identity","matrix","sitkimage",":","sitk.Image","the","simple","itk","image","as","loaded"]
docstr: Returns the main meta-data information adapted to the supplied
  image dimensionality.
  
  It will try to resolve inconsistencies and other conflicts,
  altering the information avilable int he most plausible way.
  
  Parameters
  ----------
  ndim : int
      image's dimensionality
  
  Returns
  -------
  spacing : tuple of floats
  offset : tuple of floats
  direction : ndarray
docstr_tok: ["Returns","the","main","meta-data","information","adapted","to","the","supplied","image","dimensionality",".","It","will","try","to","resolve","inconsistencies","and","other","conflicts",",","altering","the","information","avilable","int","he","most","plausible","way",".","Parameters","--","--","--","--","--","ndim",":","int","image","'s","dimensionality","Returns","--","--","--","-","spacing",":","tuple","of","floats","offset",":","tuple","of","floats","direction",":","ndarray"]
code: def get_info_consistent(self, ndim):
      """
      Returns the main meta-data information adapted to the supplied
      image dimensionality.
  
      It will try to resolve inconsistencies and other conflicts,
      altering the information avilable int he most plausible way.
  
      Parameters
      ----------
      ndim : int
          image's dimensionality
  
      Returns
      -------
      spacing : tuple of floats
      offset : tuple of floats
      direction : ndarray
      """
      if ndim > len(self.spacing):
          spacing = self.spacing + (1.0,) * (ndim - len(self.spacing))
      else:
          spacing = self.spacing[:ndim]
  
      if ndim > len(self.offset):
          offset = self.offset + (0.0,) * (ndim - len(self.offset))
      else:
          offset = self.offset[:ndim]
  
      if ndim > self.direction.shape[0]:
          direction = np.identity(ndim)
          direction[
              : self.direction.shape[0], : self.direction.shape[0]
          ] = self.direction
      else:
          direction = self.direction[:ndim, :ndim]
  
      return spacing, offset, direction
  
imports: import warnings
  import numpy
  from ..core import Logger
label_desc: Use image node_id 3 for calling the Header obj's underlying member method code with example usage: obj.get_info_consistent(ndim) and returns: spacing,  offset,  direction