Program: 149581
Project: 149581
Buggy source:
private void fitTraces(MemoryPeakResults results,Trace[] traces){
  ImageSource source=results.getSource();
  if (source == null)   return;
  if (!source.open())   return;
  FitEngineConfiguration config=(FitEngineConfiguration)XmlUtils.fromXML(results.getConfiguration());
  if (config == null)   return;
  GenericDialog gd=new GenericDialog(TITLE);
  gd.addMessage("String_Node_Str");
  gd.addCheckbox("String_Node_Str",!fitOnlyCentroid);
  gd.addSlider("String_Node_Str",0.01,3,distanceThreshold);
  gd.addSlider("String_Node_Str",1,4.5,expansionFactor);
  FitConfiguration fitConfig=config.getFitConfiguration();
  gd.addMessage("String_Node_Str");
  String[] filterTypes=SettingsManager.getNames((Object[])DataFilterType.values());
  gd.addChoice("String_Node_Str",filterTypes,filterTypes[config.getDataFilterType().ordinal()]);
  String[] filterNames=SettingsManager.getNames((Object[])DataFilter.values());
  gd.addChoice("String_Node_Str",filterNames,filterNames[config.getDataFilter(0).ordinal()]);
  gd.addSlider("String_Node_Str",0,2.5,config.getSmooth(0));
  gd.addSlider("String_Node_Str",0.5,2.5,config.getSearch());
  gd.addSlider("String_Node_Str",0.5,2.5,config.getBorder());
  gd.addSlider("String_Node_Str",2,4.5,config.getFitting());
  String[] solverNames=SettingsManager.getNames((Object[])FitSolver.values());
  gd.addChoice("String_Node_Str",solverNames,solverNames[fitConfig.getFitSolver().ordinal()]);
  String[] functionNames=SettingsManager.getNames((Object[])FitFunction.values());
  gd.addChoice("String_Node_Str",functionNames,functionNames[fitConfig.getFitFunction().ordinal()]);
  String[] criteriaNames=SettingsManager.getNames((Object[])FitCriteria.values());
  gd.addChoice("String_Node_Str",criteriaNames,criteriaNames[fitConfig.getFitCriteria().ordinal()]);
  gd.addNumericField("String_Node_Str",fitConfig.getSignificantDigits(),0);
  gd.addNumericField("String_Node_Str",fitConfig.getDelta(),4);
  gd.addNumericField("String_Node_Str",fitConfig.getLambda(),4);
  gd.addNumericField("String_Node_Str",fitConfig.getMaxIterations(),0);
  gd.addNumericField("String_Node_Str",config.getFailuresLimit(),0);
  gd.addCheckbox("String_Node_Str",config.isIncludeNeighbours());
  gd.addSlider("String_Node_Str",0.01,1,config.getNeighbourHeightThreshold());
  gd.addSlider("String_Node_Str",0.01,1,config.getResidualsThreshold());
  gd.addMessage("String_Node_Str");
  gd.addSlider("String_Node_Str",0.01,2,fitConfig.getCoordinateShiftFactor());
  gd.addNumericField("String_Node_Str",fitConfig.getSignalStrength(),2);
  gd.addNumericField("String_Node_Str",fitConfig.getMinPhotons(),0);
  gd.addSlider("String_Node_Str",0.01,5,fitConfig.getWidthFactor());
  gd.addNumericField("String_Node_Str",fitConfig.getPrecisionThreshold(),2);
  gd.addCheckbox("String_Node_Str",debugFailures);
  gd.showDialog();
  if (!gd.wasOKed()) {
    source.close();
    return;
  }
  fitOnlyCentroid=!gd.getNextBoolean();
  distanceThreshold=(float)gd.getNextNumber();
  expansionFactor=(float)gd.getNextNumber();
  config.setDataFilterType(gd.getNextChoiceIndex());
  config.setDataFilter(gd.getNextChoiceIndex(),Math.abs(gd.getNextNumber()),0);
  config.setSearch(gd.getNextNumber());
  config.setBorder(gd.getNextNumber());
  config.setFitting(gd.getNextNumber());
  fitConfig.setFitSolver(gd.getNextChoiceIndex());
  fitConfig.setFitFunction(gd.getNextChoiceIndex());
  fitConfig.setFitCriteria(gd.getNextChoiceIndex());
  fitConfig.setSignificantDigits((int)gd.getNextNumber());
  fitConfig.setDelta(gd.getNextNumber());
  fitConfig.setLambda(gd.getNextNumber());
  fitConfig.setMaxIterations((int)gd.getNextNumber());
  config.setFailuresLimit((int)gd.getNextNumber());
  config.setIncludeNeighbours(gd.getNextBoolean());
  config.setNeighbourHeightThreshold(gd.getNextNumber());
  config.setResidualsThreshold(gd.getNextNumber());
  fitConfig.setCoordinateShiftFactor(gd.getNextNumber());
  fitConfig.setSignalStrength(gd.getNextNumber());
  fitConfig.setMinPhotons(gd.getNextNumber());
  fitConfig.setWidthFactor(gd.getNextNumber());
  fitConfig.setPrecisionThreshold(gd.getNextNumber());
  try {
    Parameters.isAboveZero("String_Node_Str",distanceThreshold);
    Parameters.isAbove("String_Node_Str",expansionFactor,1);
    Parameters.isAboveZero("String_Node_Str",config.getSearch());
    Parameters.isAboveZero("String_Node_Str",config.getFitting());
    Parameters.isAboveZero("String_Node_Str",fitConfig.getSignificantDigits());
    Parameters.isAboveZero("String_Node_Str",fitConfig.getDelta());
    Parameters.isAboveZero("String_Node_Str",fitConfig.getLambda());
    Parameters.isAboveZero("String_Node_Str",fitConfig.getMaxIterations());
    Parameters.isAboveZero("String_Node_Str",config.getFailuresLimit());
    Parameters.isPositive("String_Node_Str",config.getNeighbourHeightThreshold());
    Parameters.isPositive("String_Node_Str",config.getResidualsThreshold());
    Parameters.isPositive("String_Node_Str",fitConfig.getCoordinateShiftFactor());
    Parameters.isPositive("String_Node_Str",fitConfig.getSignalStrength());
    Parameters.isPositive("String_Node_Str",fitConfig.getMinPhotons());
    Parameters.isPositive("String_Node_Str",fitConfig.getWidthFactor());
    Parameters.isPositive("String_Node_Str",fitConfig.getPrecisionThreshold());
  }
 catch (  IllegalArgumentException e) {
    IJ.error(TITLE,e.getMessage());
    source.close();
    return;
  }
  debugFailures=gd.getNextBoolean();
  if (!PeakFit.configureDataFilter(globalSettings,filename,false))   return;
  if (!PeakFit.configureFitSolver(globalSettings,filename,false))   return;
  config.setIncludeNeighbours(false);
  fitConfig.setDuplicateDistance(0);
  MemoryPeakResults refitResults=new MemoryPeakResults();
  refitResults.copySettings(results);
  refitResults.setName(results.getName() + "String_Node_Str");
  refitResults.setSortAfterEnd(true);
  refitResults.begin();
  FitEngine engine=new FitEngine(config,refitResults,Prefs.getThreads(),FitQueue.BLOCKING);
  final double stdDev=FastMath.max(fitConfig.getInitialPeakStdDev0(),fitConfig.getInitialPeakStdDev1());
  float fitWidth=(float)(stdDev * config.getFitting() * ((fitOnlyCentroid) ? 1 : expansionFactor));
  IJ.showStatus("String_Node_Str");
  List<JobItem> jobItems=new ArrayList<JobItem>(traces.length);
  int singles=0;
  int fitted=0;
  for (int n=0; n < traces.length; n++) {
    Trace trace=traces[n];
    if (n % 32 == 0)     IJ.showProgress(n,traces.length);
    if (trace.size() == 1) {
      singles++;
      refitResults.addSync(trace.getHead());
      continue;
    }
    Rectangle bounds=new Rectangle();
    double[] combinedNoise=new double[1];
    float[] data=buildCombinedImage(source,trace,fitWidth,bounds,combinedNoise,false);
    if (data == null)     continue;
    FitParameters params=new FitParameters();
    params.noise=(float)combinedNoise[0];
    params.background=0;
    float[] centre=trace.getCentroid();
    if (fitOnlyCentroid) {
      int newX=(int)Math.round(centre[0]) - bounds.x;
      int newY=(int)Math.round(centre[1]) - bounds.y;
      params.maxIndices=new int[]{newY * bounds.width + newX};
    }
 else {
      params.filter=new ArrayList<float[]>();
      params.filter.add(new float[]{centre[0] - bounds.x,centre[1] - bounds.y});
      params.distanceThreshold=distanceThreshold;
    }
    int startT=trace.getHead().peak;
    params.endT=trace.getTail().peak;
    ParameterisedFitJob job=new ParameterisedFitJob(n,params,startT,data,bounds);
    jobItems.add(new JobItem(job,trace,centre));
    engine.run(job);
    fitted++;
  }
  engine.end(false);
  IJ.showStatus("String_Node_Str");
  IJ.showProgress(1);
  FitStatus[] values=FitStatus.values();
  int[] statusCount=new int[values.length + 1];
  ArrayList<String> names=new ArrayList<String>(Arrays.asList(SettingsManager.getNames((Object[])values)));
  names.add(String.format("String_Node_Str",distanceThreshold));
  int separated=0;
  int success=0;
  final int debugLimit=3;
  for (  JobItem jobItem : jobItems) {
    int id=jobItem.getId();
    ParameterisedFitJob job=jobItem.job;
    Trace trace=jobItem.trace;
    int[] indices=job.getIndices();
    FitResult fitResult=null;
    int status;
    if (indices.length < 1) {
      status=values.length;
    }
 else     if (indices.length > 1) {
      for (int n=0; n < indices.length; n++) {
        if (job.getFitResult(n).getStatus() == FitStatus.OK) {
          fitResult=job.getFitResult(n);
          break;
        }
      }
      if (fitResult == null) {
        final float[] centre=traces[id].getCentroid();
        double minD=Double.POSITIVE_INFINITY;
        for (int n=0; n < indices.length; n++) {
          final double[] params=job.getFitResult(n).getInitialParameters();
          final double dx=params[Gaussian2DFunction.X_POSITION] - centre[0];
          final double dy=params[Gaussian2DFunction.X_POSITION] - centre[1];
          final double d=dx * dx + dy * dy;
          if (minD > d) {
            minD=d;
            fitResult=job.getFitResult(n);
          }
        }
      }
      status=fitResult.getStatus().ordinal();
    }
 else {
      fitResult=job.getFitResult(0);
      status=fitResult.getStatus().ordinal();
    }
    statusCount[status]++;
    if (fitResult == null || fitResult.getStatus() != FitStatus.OK) {
      refitResults.addAll(trace.getPoints());
      separated+=trace.size();
      if (debugFailures) {
        FitStatus s=(fitResult == null) ? FitStatus.UNKNOWN : fitResult.getStatus();
        double[] noise=new double[1];
        if (statusCount[status] <= debugLimit) {
          Rectangle bounds=new Rectangle();
          buildCombinedImage(source,trace,fitWidth,bounds,noise,true);
          float[] centre=trace.getCentroid();
          float[] offset=job.getFitParameters().getOffset();
          Utils.display(String.format("String_Node_Str",id,trace.size(),centre[0] - offset[0],centre[1] - offset[1]),slices);
switch (s) {
case INSUFFICIENT_PRECISION:
            float precision=(Float)fitResult.getStatusData();
          IJ.log(String.format("String_Node_Str",id,trace.size(),names.get(status),precision));
        break;
case INSUFFICIENT_SIGNAL:
      if (noise[0] == 0)       noise[0]=getCombinedNoise(trace);
    float snr=(Float)fitResult.getStatusData();
  IJ.log(String.format("String_Node_Str",id,trace.size(),names.get(status),snr,noise[0]));
break;
case COORDINATES_MOVED:
case WIDTH_DIVERGED:
float[] shift=(float[])fitResult.getStatusData();
IJ.log(String.format("String_Node_Str",id,trace.size(),names.get(status),shift[0],shift[1]));
break;
default :
IJ.log(String.format("String_Node_Str",id,trace.size(),names.get(status)));
break;
}
}
}
}
 else {
success++;
if (debugFailures) {
double[] noise=new double[1];
if (statusCount[status] <= debugLimit) {
Rectangle bounds=new Rectangle();
buildCombinedImage(source,trace,fitWidth,bounds,noise,true);
float[] centre=trace.getCentroid();
float[] offset=job.getFitParameters().getOffset();
Utils.display(String.format("String_Node_Str",id,trace.size(),centre[0] - offset[0],centre[1] - offset[1]),slices);
}
}
}
}
IJ.log(String.format("String_Node_Str",singles,success,fitted,separated));
if (separated > 0) {
IJ.log("String_Node_Str");
for (int i=1; i < statusCount.length; i++) {
if (statusCount[i] != 0) IJ.log("String_Node_Str" + names.get(i) + "String_Node_Str"+ statusCount[i]);
}
}
refitResults.end();
MemoryPeakResults.addResults(refitResults);
source.close();
}

Fixed version (ground truth):
private void fitTraces(MemoryPeakResults results,Trace[] traces){
  ImageSource source=results.getSource();
  if (source == null)   return;
  if (!source.open())   return;
  FitEngineConfiguration config=(FitEngineConfiguration)XmlUtils.fromXML(results.getConfiguration());
  if (config == null)   return;
  GenericDialog gd=new GenericDialog(TITLE);
  gd.addMessage("String_Node_Str");
  gd.addCheckbox("String_Node_Str",!fitOnlyCentroid);
  gd.addSlider("String_Node_Str",0.01,3,distanceThreshold);
  gd.addSlider("String_Node_Str",1,4.5,expansionFactor);
  FitConfiguration fitConfig=config.getFitConfiguration();
  gd.addMessage("String_Node_Str");
  String[] filterTypes=SettingsManager.getNames((Object[])DataFilterType.values());
  gd.addChoice("String_Node_Str",filterTypes,filterTypes[config.getDataFilterType().ordinal()]);
  String[] filterNames=SettingsManager.getNames((Object[])DataFilter.values());
  gd.addChoice("String_Node_Str",filterNames,filterNames[config.getDataFilter(0).ordinal()]);
  gd.addSlider("String_Node_Str",0,2.5,config.getSmooth(0));
  gd.addSlider("String_Node_Str",0.5,2.5,config.getSearch());
  gd.addSlider("String_Node_Str",0.5,2.5,config.getBorder());
  gd.addSlider("String_Node_Str",2,4.5,config.getFitting());
  String[] solverNames=SettingsManager.getNames((Object[])FitSolver.values());
  gd.addChoice("String_Node_Str",solverNames,solverNames[fitConfig.getFitSolver().ordinal()]);
  String[] functionNames=SettingsManager.getNames((Object[])FitFunction.values());
  gd.addChoice("String_Node_Str",functionNames,functionNames[fitConfig.getFitFunction().ordinal()]);
  String[] criteriaNames=SettingsManager.getNames((Object[])FitCriteria.values());
  gd.addChoice("String_Node_Str",criteriaNames,criteriaNames[fitConfig.getFitCriteria().ordinal()]);
  gd.addNumericField("String_Node_Str",fitConfig.getSignificantDigits(),0);
  gd.addNumericField("String_Node_Str",fitConfig.getDelta(),4);
  gd.addNumericField("String_Node_Str",fitConfig.getLambda(),4);
  gd.addNumericField("String_Node_Str",fitConfig.getMaxIterations(),0);
  gd.addNumericField("String_Node_Str",config.getFailuresLimit(),0);
  gd.addCheckbox("String_Node_Str",config.isIncludeNeighbours());
  gd.addSlider("String_Node_Str",0.01,1,config.getNeighbourHeightThreshold());
  gd.addSlider("String_Node_Str",0.01,1,config.getResidualsThreshold());
  gd.addMessage("String_Node_Str");
  gd.addSlider("String_Node_Str",0.01,2,fitConfig.getCoordinateShiftFactor());
  gd.addNumericField("String_Node_Str",fitConfig.getSignalStrength(),2);
  gd.addNumericField("String_Node_Str",fitConfig.getMinPhotons(),0);
  gd.addSlider("String_Node_Str",0.01,5,fitConfig.getWidthFactor());
  gd.addNumericField("String_Node_Str",fitConfig.getPrecisionThreshold(),2);
  gd.addCheckbox("String_Node_Str",debugFailures);
  gd.showDialog();
  if (!gd.wasOKed()) {
    source.close();
    return;
  }
  fitOnlyCentroid=!gd.getNextBoolean();
  distanceThreshold=(float)gd.getNextNumber();
  expansionFactor=(float)gd.getNextNumber();
  config.setDataFilterType(gd.getNextChoiceIndex());
  config.setDataFilter(gd.getNextChoiceIndex(),Math.abs(gd.getNextNumber()),0);
  config.setSearch(gd.getNextNumber());
  config.setBorder(gd.getNextNumber());
  config.setFitting(gd.getNextNumber());
  fitConfig.setFitSolver(gd.getNextChoiceIndex());
  fitConfig.setFitFunction(gd.getNextChoiceIndex());
  fitConfig.setFitCriteria(gd.getNextChoiceIndex());
  fitConfig.setSignificantDigits((int)gd.getNextNumber());
  fitConfig.setDelta(gd.getNextNumber());
  fitConfig.setLambda(gd.getNextNumber());
  fitConfig.setMaxIterations((int)gd.getNextNumber());
  config.setFailuresLimit((int)gd.getNextNumber());
  config.setIncludeNeighbours(gd.getNextBoolean());
  config.setNeighbourHeightThreshold(gd.getNextNumber());
  config.setResidualsThreshold(gd.getNextNumber());
  fitConfig.setCoordinateShiftFactor(gd.getNextNumber());
  fitConfig.setSignalStrength(gd.getNextNumber());
  fitConfig.setMinPhotons(gd.getNextNumber());
  fitConfig.setWidthFactor(gd.getNextNumber());
  fitConfig.setPrecisionThreshold(gd.getNextNumber());
  try {
    Parameters.isAboveZero("String_Node_Str",distanceThreshold);
    Parameters.isAbove("String_Node_Str",expansionFactor,1);
    Parameters.isAboveZero("String_Node_Str",config.getSearch());
    Parameters.isAboveZero("String_Node_Str",config.getFitting());
    Parameters.isAboveZero("String_Node_Str",fitConfig.getSignificantDigits());
    Parameters.isAboveZero("String_Node_Str",fitConfig.getDelta());
    Parameters.isAboveZero("String_Node_Str",fitConfig.getLambda());
    Parameters.isAboveZero("String_Node_Str",fitConfig.getMaxIterations());
    Parameters.isAboveZero("String_Node_Str",config.getFailuresLimit());
    Parameters.isPositive("String_Node_Str",config.getNeighbourHeightThreshold());
    Parameters.isPositive("String_Node_Str",config.getResidualsThreshold());
    Parameters.isPositive("String_Node_Str",fitConfig.getCoordinateShiftFactor());
    Parameters.isPositive("String_Node_Str",fitConfig.getSignalStrength());
    Parameters.isPositive("String_Node_Str",fitConfig.getMinPhotons());
    Parameters.isPositive("String_Node_Str",fitConfig.getWidthFactor());
    Parameters.isPositive("String_Node_Str",fitConfig.getPrecisionThreshold());
  }
 catch (  IllegalArgumentException e) {
    IJ.error(TITLE,e.getMessage());
    source.close();
    return;
  }
  debugFailures=gd.getNextBoolean();
  if (!PeakFit.configureDataFilter(globalSettings,filename,false))   return;
  if (!PeakFit.configureFitSolver(globalSettings,filename,false))   return;
  config.setIncludeNeighbours(false);
  fitConfig.setDuplicateDistance(0);
  MemoryPeakResults refitResults=new MemoryPeakResults();
  refitResults.copySettings(results);
  refitResults.setName(results.getName() + "String_Node_Str");
  refitResults.setSortAfterEnd(true);
  refitResults.begin();
  FitEngine engine=new FitEngine(config,refitResults,Prefs.getThreads(),FitQueue.BLOCKING);
  final double stdDev=FastMath.max(fitConfig.getInitialPeakStdDev0(),fitConfig.getInitialPeakStdDev1());
  float fitWidth=(float)(stdDev * config.getFitting() * ((fitOnlyCentroid) ? 1 : expansionFactor));
  IJ.showStatus("String_Node_Str");
  List<JobItem> jobItems=new ArrayList<JobItem>(traces.length);
  int singles=0;
  int fitted=0;
  for (int n=0; n < traces.length; n++) {
    Trace trace=traces[n];
    if (n % 32 == 0)     IJ.showProgress(n,traces.length);
    if (trace.size() == 1) {
      singles++;
      refitResults.addSync(trace.getHead());
      continue;
    }
    Rectangle bounds=new Rectangle();
    double[] combinedNoise=new double[1];
    float[] data=buildCombinedImage(source,trace,fitWidth,bounds,combinedNoise,false);
    if (data == null)     continue;
    FitParameters params=new FitParameters();
    params.noise=(float)combinedNoise[0];
    params.background=0;
    float[] centre=trace.getCentroid();
    if (fitOnlyCentroid) {
      int newX=(int)Math.round(centre[0]) - bounds.x;
      int newY=(int)Math.round(centre[1]) - bounds.y;
      params.maxIndices=new int[]{newY * bounds.width + newX};
    }
 else {
      params.filter=new ArrayList<float[]>();
      params.filter.add(new float[]{centre[0] - bounds.x,centre[1] - bounds.y});
      params.distanceThreshold=distanceThreshold;
    }
    int startT=trace.getHead().peak;
    params.endT=trace.getTail().peak;
    ParameterisedFitJob job=new ParameterisedFitJob(n,params,startT,data,bounds);
    jobItems.add(new JobItem(job,trace,centre));
    engine.run(job);
    fitted++;
  }
  engine.end(false);
  IJ.showStatus("String_Node_Str");
  IJ.showProgress(1);
  FitStatus[] values=FitStatus.values();
  int[] statusCount=new int[values.length + 1];
  ArrayList<String> names=new ArrayList<String>(Arrays.asList(SettingsManager.getNames((Object[])values)));
  names.add(String.format("String_Node_Str",distanceThreshold));
  int separated=0;
  int success=0;
  final int debugLimit=3;
  for (  JobItem jobItem : jobItems) {
    int id=jobItem.getId();
    ParameterisedFitJob job=jobItem.job;
    Trace trace=jobItem.trace;
    int[] indices=job.getIndices();
    FitResult fitResult=null;
    int status;
    if (indices.length < 1) {
      status=values.length;
    }
 else     if (indices.length > 1) {
      for (int n=0; n < indices.length; n++) {
        if (job.getFitResult(n).getStatus() == FitStatus.OK) {
          fitResult=job.getFitResult(n);
          break;
        }
      }
      if (fitResult == null) {
        final float[] centre=traces[id].getCentroid();
        double minD=Double.POSITIVE_INFINITY;
        for (int n=0; n < indices.length; n++) {
          final double[] params=job.getFitResult(n).getInitialParameters();
          final double dx=params[Gaussian2DFunction.X_POSITION] - centre[0];
          final double dy=params[Gaussian2DFunction.Y_POSITION] - centre[1];
          final double d=dx * dx + dy * dy;
          if (minD > d) {
            minD=d;
            fitResult=job.getFitResult(n);
          }
        }
      }
      status=fitResult.getStatus().ordinal();
    }
 else {
      fitResult=job.getFitResult(0);
      status=fitResult.getStatus().ordinal();
    }
    statusCount[status]++;
    if (fitResult == null || fitResult.getStatus() != FitStatus.OK) {
      refitResults.addAll(trace.getPoints());
      separated+=trace.size();
      if (debugFailures) {
        FitStatus s=(fitResult == null) ? FitStatus.UNKNOWN : fitResult.getStatus();
        double[] noise=new double[1];
        if (statusCount[status] <= debugLimit) {
          Rectangle bounds=new Rectangle();
          buildCombinedImage(source,trace,fitWidth,bounds,noise,true);
          float[] centre=trace.getCentroid();
          float[] offset=job.getFitParameters().getOffset();
          Utils.display(String.format("String_Node_Str",id,trace.size(),centre[0] - offset[0],centre[1] - offset[1]),slices);
switch (s) {
case INSUFFICIENT_PRECISION:
            float precision=(Float)fitResult.getStatusData();
          IJ.log(String.format("String_Node_Str",id,trace.size(),names.get(status),precision));
        break;
case INSUFFICIENT_SIGNAL:
      if (noise[0] == 0)       noise[0]=getCombinedNoise(trace);
    float snr=(Float)fitResult.getStatusData();
  IJ.log(String.format("String_Node_Str",id,trace.size(),names.get(status),snr,noise[0]));
break;
case COORDINATES_MOVED:
case WIDTH_DIVERGED:
float[] shift=(float[])fitResult.getStatusData();
IJ.log(String.format("String_Node_Str",id,trace.size(),names.get(status),shift[0],shift[1]));
break;
default :
IJ.log(String.format("String_Node_Str",id,trace.size(),names.get(status)));
break;
}
}
}
}
 else {
success++;
if (debugFailures) {
double[] noise=new double[1];
if (statusCount[status] <= debugLimit) {
Rectangle bounds=new Rectangle();
buildCombinedImage(source,trace,fitWidth,bounds,noise,true);
float[] centre=trace.getCentroid();
float[] offset=job.getFitParameters().getOffset();
Utils.display(String.format("String_Node_Str",id,trace.size(),centre[0] - offset[0],centre[1] - offset[1]),slices);
}
}
}
}
IJ.log(String.format("String_Node_Str",singles,success,fitted,separated));
if (separated > 0) {
IJ.log("String_Node_Str");
for (int i=1; i < statusCount.length; i++) {
if (statusCount[i] != 0) IJ.log("String_Node_Str" + names.get(i) + "String_Node_Str"+ statusCount[i]);
}
}
refitResults.end();
MemoryPeakResults.addResults(refitResults);
source.close();
}