<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _initializeDimensions(self, inputData):
 """ Stores the training images' dimensions, for convenience. """

    if len(inputData.shape) == 2:
      self.imageHeight, self.numImages = inputData.shape
      self.imageWidth, self.numChannels = None, None

    elif len(inputData.shape) == 3:
      self.imageHeight, \
      self.imageWidth, \
      self.numImages = inputData.shape
      self.numChannels = None

    elif len(inputData.shape) == 4:
      self.imageHeight, \
      self.imageWidth, \
      self.numChannels, \
      self.numImages = inputData.shape

    else:
      raise ValueError("The provided image set has more than 4 dimensions.")