double GetNextDataPoint(int mlist)  // mlist < 0 means no list
  {
      double val=0;
      int e;

      switch (PlotMode)
      {
          case 0: break;
          case 1:  // Plot spectrum and Actually displayed marker spectra
            if (mlist < 0)
            {
                if (data3d.GetProjectionMode(2))
                    val=data3d.GetROIVal(PointNr);
                else 
                    // if (normalize)
                    val=data3d.NormedValueAt((int) (c2.PositionValue),(int) (c3.PositionValue),(int) (c1.PositionValue),PointNr);
                    // else
                    // val=data3d.ValueAt((int) (c2.PositionValue),(int) (c3.PositionValue),(int) (c1.PositionValue),PointNr);
            }
            else  // displayed markers have to be spectrally displayed
            {
                val=data3d.NormedValueAt((int) (data3d.GetPoint(-1,mlist).coord[0]+0.5),
				      (int) (data3d.GetPoint(-1,mlist).coord[1]+0.5),
                                      (int) (data3d.GetPoint(-1,mlist).coord[2]+0.5),PointNr);
            }
            break;
          case 2:  // Plot marker intensity or maximum traces
              pval=data3d.GetPoint(PointNr,mlist).integral / ((data3d.COMX*2.0+1.0)*(data3d.COMY*2.0+1.0)*(data3d.COMZ*2.0+1.0));
              e = (int) data3d.GetPoint(PointNr,mlist).coord[3];
              val = data3d.Normalize(pval,e);
            break;
          case 3:  // Plot marker intensity or maximum traces
              pval=data3d.GetPoint(PointNr,mlist).max;
              e = (int) data3d.GetPoint(PointNr,mlist).coord[3];
              val = data3d.Normalize(pval,e);
            break;
          case 4:  // Plot marker intensity or maximum traces
              pval=data3d.GetPoint(PointNr,mlist).min;
              e = (int) data3d.GetPoint(PointNr,mlist).coord[3];
              val = data3d.Normalize(pval,e);
            break;
          case 5:  // Plot marker intensity or maximum traces
              pval=data3d.GetPoint(PointNr,mlist).integralAboveMin / ((data3d.COMX*2.0+1.0)*(data3d.COMY*2.0+1.0)*(data3d.COMZ*2.0+1.0));
              e = (int) data3d.GetPoint(PointNr,mlist).coord[3];
              val = data3d.Normalize(pval,e);
            break;
      }
      PointNr++;   // Advance to the next datapoint
      return val;
  }