Program: 22685
Project: 22685
Buggy source:
/** 
 * Get structure tensor features (to be submitted in an ExecutorService). It computes, for all pixels in the input image, the eigenvalues of the so-called structure tensor.
 * @param originalImage input image
 * @param sigma isotropic smoothing scale	
 * @param integrationScale integration scale (standard deviation of the Gaussian kernel used for smoothing the elements of the structure tensor, must be larger than zero)
 * @return filter structure tensor filter image
 */
public Callable<ArrayList<ImagePlus>> getStructure(final ImagePlus originalImage,final double sigma,final double integrationScale){
  if (Thread.currentThread().isInterrupted())   return null;
  return new Callable<ArrayList<ImagePlus>>(){
    public ArrayList<ImagePlus> call(){
      ImagePlus[] channels=extractChannels(originalImage);
      ArrayList<ImagePlus>[] results=new ArrayList[channels.length];
      for (int ch=0; ch < channels.length; ch++) {
        results[ch]=new ArrayList<ImagePlus>();
        final ImagePlus channel=channels[ch].duplicate();
        channel.getImageStack().addSlice("String_Node_Str",channels[ch].getImageStack().getProcessor(channels[ch].getImageStackSize()));
        channel.getImageStack().addSlice("String_Node_Str",channels[ch].getImageStack().getProcessor(1),1);
        Calibration c=channel.getCalibration();
        c.pixelWidth=scaleFactor[0];
        c.pixelHeight=scaleFactor[1];
        c.pixelDepth=scaleFactor[2];
        final ArrayList<ImagePlus> result=ImageScience.computeEigenimages(sigma,integrationScale,channel);
        final ImageStack largest=result.get(0).getImageStack();
        final ImageStack middle=result.get(1).getImageStack();
        final ImageStack smallest=result.get(2).getImageStack();
        smallest.deleteLastSlice();
        smallest.deleteSlice(1);
        middle.deleteLastSlice();
        middle.deleteSlice(1);
        largest.deleteLastSlice();
        largest.deleteSlice(1);
        results[ch].add(new ImagePlus(availableFeatures[STRUCTURE] + "String_Node_Str" + sigma+ "String_Node_Str"+ integrationScale,largest));
        results[ch].add(new ImagePlus(availableFeatures[STRUCTURE] + "String_Node_Str" + sigma+ "String_Node_Str"+ integrationScale,middle));
        results[ch].add(new ImagePlus(availableFeatures[STRUCTURE] + "String_Node_Str" + sigma+ "String_Node_Str"+ integrationScale,smallest));
      }
      return mergeResultChannels(results);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Get structure tensor features (to be submitted in an ExecutorService). It computes, for all pixels in the input image, the eigenvalues of the so-called structure tensor.
 * @param originalImage input image
 * @param sigma isotropic smoothing scale	
 * @param integrationScale integration scale (standard deviation of the Gaussian kernel used for smoothing the elements of the structure tensor, must be larger than zero)
 * @return filter structure tensor filter image
 */
public Callable<ArrayList<ImagePlus>> getStructure(final ImagePlus originalImage,final double sigma,final double integrationScale){
  if (Thread.currentThread().isInterrupted())   return null;
  return new Callable<ArrayList<ImagePlus>>(){
    public ArrayList<ImagePlus> call(){
      ImagePlus[] channels=extractChannels(originalImage);
      ArrayList<ImagePlus>[] results=new ArrayList[channels.length];
      for (int ch=0; ch < channels.length; ch++) {
        results[ch]=new ArrayList<ImagePlus>();
        final ImagePlus channel=channels[ch].duplicate();
        channel.getImageStack().addSlice("String_Node_Str",channels[ch].getImageStack().getProcessor(channels[ch].getImageStackSize()));
        channel.getImageStack().addSlice("String_Node_Str",channels[ch].getImageStack().getProcessor(1),1);
        Calibration c=channel.getCalibration();
        c.pixelWidth=1.0 / scaleFactor[0];
        c.pixelHeight=1.0 / scaleFactor[1];
        c.pixelDepth=1.0 / scaleFactor[2];
        final ArrayList<ImagePlus> result=ImageScience.computeEigenimages(sigma,integrationScale,channel);
        final ImageStack largest=result.get(0).getImageStack();
        final ImageStack middle=result.get(1).getImageStack();
        final ImageStack smallest=result.get(2).getImageStack();
        smallest.deleteLastSlice();
        smallest.deleteSlice(1);
        middle.deleteLastSlice();
        middle.deleteSlice(1);
        largest.deleteLastSlice();
        largest.deleteSlice(1);
        results[ch].add(new ImagePlus(availableFeatures[STRUCTURE] + "String_Node_Str" + sigma+ "String_Node_Str"+ integrationScale,largest));
        results[ch].add(new ImagePlus(availableFeatures[STRUCTURE] + "String_Node_Str" + sigma+ "String_Node_Str"+ integrationScale,middle));
        results[ch].add(new ImagePlus(availableFeatures[STRUCTURE] + "String_Node_Str" + sigma+ "String_Node_Str"+ integrationScale,smallest));
      }
      return mergeResultChannels(results);
    }
  }
;
}