Program: 149571
Project: 149571
Buggy source:
/** 
 * Run different filtering methods on a set of labelled peak results outputting performance statistics on the success of the filter to an ImageJ table. <p> If the peak result original value is set to 1 it is considered a true peak, 0 for a false peak. Filtering is done using e.g. SNR threshold, Precision thresholds, etc. The statistics reported are shown in a table, e.g. precision, Jaccard, F-score. <p> For each filter set a plot is shown of the score verses the filter value, thus filters should be provided in ascending numerical order otherwise they are sorted.
 * @param resultsList
 * @param filterSets
 */
private void analyse(List<MemoryPeakResults> resultsList,List<FilterSet> filterSets){
  createResultsWindow();
  plots=new ArrayList<NamedPlot>(plotTopN);
  bestFilter=new HashMap<String,FilterScore>();
  bestFilterOrder=new LinkedList<String>();
  startTimer();
  IJ.showStatus("String_Node_Str");
  int total=countFilters(filterSets);
  int count=0;
  int setNumber=0;
  for (  FilterSet filterSet : filterSets) {
    setNumber++;
    count=run(filterSet,setNumber,resultsList,count,total);
    if (count < 0)     break;
  }
  stopTimer();
  IJ.showProgress(1);
  IJ.showStatus("String_Node_Str");
  if (Utils.isInterrupted())   return;
  if (bestFilter.isEmpty()) {
    IJ.log("String_Node_Str");
    return;
  }
  List<FilterScore> filters=new ArrayList<FilterScore>(bestFilter.values());
  if (showSummaryTable || saveBestFilter)   Collections.sort(filters);
  if (showSummaryTable) {
    createSummaryWindow();
    int n=0;
    final double range=summaryDepth / simulationParameters.a / 2;
    int np=0;
    for (    double depth : depthStats.getValues()) {
      if (Math.abs(depth) < range)       np++;
    }
    for (    FilterScore fs : filters) {
      FractionClassificationResult r=scoreFilter(fs.filter,resultsList);
      String text=createResult(fs.filter,r);
      MemoryPeakResults results=fs.filter.filter(resultsList.get(0),failCount);
      int tp=0;
      for (      PeakResult result : results.getResults()) {
        if (result.origValue != 0 && Math.abs(((DepthPeakResult)result).depth) <= range)         tp++;
      }
      text+="String_Node_Str" + Utils.rounded((double)tp / np);
      if (isHeadless)       IJ.log(text);
 else       summaryWindow.append(text);
      n++;
      if (summaryTopN > 0 && n >= summaryTopN)       break;
    }
    if (n > 1) {
      if (isHeadless)       IJ.log("String_Node_Str");
 else       summaryWindow.append("String_Node_Str");
    }
  }
  if (saveBestFilter)   saveFilter(filters.get(0).filter);
  showPlots();
  calculateSensitivity(resultsList);
  depthAnalysis(filters.get(0).filter);
}

Fixed version (ground truth):
/** 
 * Run different filtering methods on a set of labelled peak results outputting performance statistics on the success of the filter to an ImageJ table. <p> If the peak result original value is set to 1 it is considered a true peak, 0 for a false peak. Filtering is done using e.g. SNR threshold, Precision thresholds, etc. The statistics reported are shown in a table, e.g. precision, Jaccard, F-score. <p> For each filter set a plot is shown of the score verses the filter value, thus filters should be provided in ascending numerical order otherwise they are sorted.
 * @param resultsList
 * @param filterSets
 */
private void analyse(List<MemoryPeakResults> resultsList,List<FilterSet> filterSets){
  createResultsWindow();
  plots=new ArrayList<NamedPlot>(plotTopN);
  bestFilter=new HashMap<String,FilterScore>();
  bestFilterOrder=new LinkedList<String>();
  startTimer();
  IJ.showStatus("String_Node_Str");
  int total=countFilters(filterSets);
  int count=0;
  int setNumber=0;
  for (  FilterSet filterSet : filterSets) {
    setNumber++;
    if (run(filterSet,setNumber,resultsList,count,total) < 0)     break;
    count+=filterSet.size();
  }
  stopTimer();
  IJ.showProgress(1);
  IJ.showStatus("String_Node_Str");
  if (Utils.isInterrupted())   return;
  if (bestFilter.isEmpty()) {
    IJ.log("String_Node_Str");
    return;
  }
  List<FilterScore> filters=new ArrayList<FilterScore>(bestFilter.values());
  if (showSummaryTable || saveBestFilter)   Collections.sort(filters);
  if (showSummaryTable) {
    createSummaryWindow();
    int n=0;
    final double range=summaryDepth / simulationParameters.a / 2;
    int np=0;
    for (    double depth : depthStats.getValues()) {
      if (Math.abs(depth) < range)       np++;
    }
    for (    FilterScore fs : filters) {
      FractionClassificationResult r=scoreFilter(fs.filter,resultsList);
      String text=createResult(fs.filter,r);
      MemoryPeakResults results=fs.filter.filter(resultsList.get(0),failCount);
      int tp=0;
      for (      PeakResult result : results.getResults()) {
        if (result.origValue != 0 && Math.abs(((DepthPeakResult)result).depth) <= range)         tp++;
      }
      text+="String_Node_Str" + Utils.rounded((double)tp / np);
      if (isHeadless)       IJ.log(text);
 else       summaryWindow.append(text);
      n++;
      if (summaryTopN > 0 && n >= summaryTopN)       break;
    }
    if (n > 1) {
      if (isHeadless)       IJ.log("String_Node_Str");
 else       summaryWindow.append("String_Node_Str");
    }
  }
  if (saveBestFilter)   saveFilter(filters.get(0).filter);
  showPlots();
  calculateSensitivity(resultsList);
  depthAnalysis(filters.get(0).filter);
}