class_docstr: Class to wrap MINC2 format file
  
  Although it has some of the same methods as a ``Header``, we use
  this only when reading a MINC2 file, to pull out useful header
  information, and for the method of reading the data out
class_docstr_tok: ["Class","to","wrap","MINC2","format","file","Although","it","has","some","of","the","same","methods","as","a","``","Header","``",",","we","use","this","only","when","reading","a","MINC2","file",",","to","pull","out","useful","header","information",",","and","for","the","method","of","reading","the","data","out"]
code: def _get_dimensions(self, var):
      # Dimensions for a particular variable
      # Differs for MINC1 and MINC2 - see:
      # https://en.wikibooks.org/wiki/MINC/Reference/MINC2.0_File_Format_Reference#Associating_HDF5_dataspaces_with_MINC_dimensions
      try:
          dimorder = var.attrs["dimorder"].decode()
      except KeyError:  # No specified dimensions
          return []
      # The dimension name list must contain only as many entries
      # as the variable has dimensions. This reduces errors when an
      # unnecessary dimorder attribute is left behind.
      return dimorder.split(",")[: len(var.shape)]
  
imports: import warnings
  import numpy
  from .minc1 import Minc1File, Minc1Image, MincError, MincHeader
label_desc: Use image node_id 2 for calling the Minc2File obj's underlying member method code with example usage: obj._get_dimensions(var) and returns: dimorder, list