/**
  * This conducts both nonlinear regression-derived Fb subtraction and baseline slope correction.
  *
  * @param profile
  */
 private void conductBaselineCorrection() {
   // Start with correcting for the NR-derived Fb slope
   double[] rawFcReadings = profile.getRawFcReadings();
   double[] processedFcDataset = new double[rawFcReadings.length]; // The new optimized Fc dataset
   // This assumes that nonlinear regression has been conducted AND it was successfully completed
   double nrFb = profile.getNrFb(); // The regression derived Fb
   double nrFbSlope = profile.getNrFbSlope(); // The regression-derived Fb slope
   for (int i = 0; i < processedFcDataset.length; i++) {
     processedFcDataset[i] = rawFcReadings[i] - nrFb - (nrFbSlope * (i + 1));
   }
   profile.setFcReadings(processedFcDataset);
 }
 /**
  * Retrieves the current LRE parameters from the Profile
  *
  * @param profile
  * @return
  */
 private LreParameters getLreParameters() {
   // Setup the initial parameters
   LreParameters lreDerivedParam = new LreParameters();
   // Testing indicates that if Fb=0 the NR fails
   if (profile.getNrFb() == 0) {
     lreDerivedParam.setFb(profile.getFb()); // This Fb is derived from the average of cycles 4-9
   } else {
     lreDerivedParam.setFb(profile.getNrFb());
   }
   lreDerivedParam.setEmax(profile.getEmax()); // Current LRE-derived Emax
   lreDerivedParam.setFmax(profile.getFmax()); // Current LRE-derived Fmax
   lreDerivedParam.setFo(profile.getAvFo()); // Current LRE-derived average Fo
   lreDerivedParam.setFbSlope(profile.getNrFbSlope()); // Current Fb slope
   return lreDerivedParam;
 }