code: def getspectrum(self, index):
          
          mz_bytes, intensity_bytes = self.get_spectrum_as_string(index)
          mz_array = np.frombuffer(mz_bytes, dtype=self.mzPrecision)
          intensity_array = np.frombuffer(intensity_bytes, dtype=self.intensityPrecision)
          return mz_array, intensity_array
docs: Reads the spectrum at specified index from the .ibd file.
  
          :param index:
              Index of the desired spectrum in the .imzML file
  
          Output:
  
          mz_array: numpy.ndarray
              Sequence of m/z values representing the horizontal axis of the desired mass
              spectrum
          intensity_array: numpy.ndarray
              Sequence of intensity values corresponding to mz_array