code: def postprocess(self, input_data, raw_data=None, casename=None):
      if self.csv_file is None:
          self.csv_file = open(self.output_log, self.write_mode)
          self.csv_writer = csv.writer(self.csv_file)
          self.csv_writer.writerow(
              ["casename"]
              + [
                  self.cost_function_label_dict[cost_function]
                  for cost_function in self.cost_functions
              ]
          )
  
      ground_truth = raw_data[self.ground_truth]
  
      if casename is None:
          casename = ""
      output_row = [casename]
  
      for cost_function in self.cost_functions:
          if cost_function not in list(self.cost_function_dict.keys()):
              print(
                  (
                      "Error, cost function",
                      cost_function,
                      "not implemented",
                  )
              )
  
          cost = self.cost_function_dict[cost_function](
              input_data, ground_truth
          )
  
          if self.print_output:
              print(
                  (
                      self.cost_function_label_dict[cost_function]
                      + ":",
                      cost,
                  )
              )
  
          output_row += [str(cost)]
  
      self.csv_writer.writerow(output_row)
      self.csv_file.flush()
  
      return input_data
  
file_path: DeepNeuro/deepneuro/postprocessing/statistics.py
imports: import csv
  import numpy
  from skimage.measure import label
  from deepneuro.postprocessing.postprocessor import Postprocessor
  from deepneuro.utilities.util import add_parameter
label_desc: Use image node_id 2 for calling the ErrorCalculation obj's underlying member method code with example usage: obj.postprocess(input_data, raw_data, casename) and returns: input_data