docstr: Output object.
  
  Parameters
  ----------
  data_collection: DataCollection
      DataCollection object that Output is currently predicting on. Default
      is None
  inputs: str, list
      Key or list of keys that designate input data in DataCollections. Default
      is ['input_data']
  ground_truth: str, list
      Key or list of keys that designate ground truth in DataCollections. Default
      is ['ground_truth']
  save_to_file: bool
      Save output to disc. Default is True.
  save_initial: bool
      Save unpostprocessed output to disc, if postprocessors are applied.
  save_all_steps: bool
      Save all intermediate postprocessing steps. Filenames are designated
      by postprocessor strings.
  output_directory: str
      Directory to output inference in to. If None, outputs to directories
      defined by the 'casename' attribute in DataCollections, if present.
  output_filename_base: str
      Predictions will use this filename for output, potentially with suffixes
      attached in postprocessors or augmentations are specified.
  stack_outputs: bool
      If True, DeepNeuro will attempt to combined multiple channels into one
      output file where possible.
  case_in_filename : bool
  
  channels_first: bool
docstr_tok: ["Output","object",".","Parameters","--","--","--","--","--","data_collection",":","DataCollection","DataCollection","object","that","Output","is","currently","predicting","on",".","Default","is","None","inputs",":","str",",","list","Key","or","list","of","keys","that","designate","input","data","in","DataCollections",".","Default","is","[","'input_data","'","]","ground_truth",":","str",",","list","Key","or","list","of","keys","that","designate","ground","truth","in","DataCollections",".","Default","is","[","'ground_truth","'","]","save_to_file",":","bool","Save","output","to","disc",".","Default","is","True",".","save_initial",":","bool","Save","unpostprocessed","output","to","disc",",","if","postprocessors","are","applied",".","save_all_steps",":","bool","Save","all","intermediate","postprocessing","steps",".","Filenames","are","designated","by","postprocessor","strings",".","output_directory",":","str","Directory","to","output","inference","in","to",".","If","None",",","outputs","to","directories","defined","by","the","'casename","'","attribute","in","DataCollections",",","if","present",".","output_filename_base",":","str","Predictions","will","use","this","filename","for","output",",","potentially","with","suffixes","attached","in","postprocessors","or","augmentations","are","specified",".","stack_outputs",":","bool","If","True",",","DeepNeuro","will","attempt","to","combined","multiple","channels","into","one","output","file","where","possible",".","case_in_filename",":","bool","channels_first",":","bool"]
code: def __init__(self, **kwargs):
      """Output object.
  
      Parameters
      ----------
      data_collection: DataCollection
          DataCollection object that Output is currently predicting on. Default
          is None
      inputs: str, list
          Key or list of keys that designate input data in DataCollections. Default
          is ['input_data']
      ground_truth: str, list
          Key or list of keys that designate ground truth in DataCollections. Default
          is ['ground_truth']
      save_to_file: bool
          Save output to disc. Default is True.
      save_initial: bool
          Save unpostprocessed output to disc, if postprocessors are applied.
      save_all_steps: bool
          Save all intermediate postprocessing steps. Filenames are designated
          by postprocessor strings.
      output_directory: str
          Directory to output inference in to. If None, outputs to directories
          defined by the 'casename' attribute in DataCollections, if present.
      output_filename_base: str
          Predictions will use this filename for output, potentially with suffixes
          attached in postprocessors or augmentations are specified.
      stack_outputs: bool
          If True, DeepNeuro will attempt to combined multiple channels into one
          output file where possible.
      case_in_filename : bool
  
      channels_first: bool
  
      """
  
      # Data Parameters
      add_parameter(self, kwargs, "data_collection", None)
      add_parameter(self, kwargs, "inputs", ["input_data"])
      add_parameter(self, kwargs, "ground_truth", ["ground_truth"])
  
      # Saving Parameters
      add_parameter(self, kwargs, "save_to_file", True)
      add_parameter(self, kwargs, "save_initial", False)
      add_parameter(self, kwargs, "save_all_steps", False)
      add_parameter(self, kwargs, "output_directory", "./")
      add_parameter(self, kwargs, "output_filename", None)
      add_parameter(
          self, kwargs, "output_filename_base", "prediction.png"
      )
      add_parameter(self, kwargs, "stack_outputs", False)
      add_parameter(self, kwargs, "case_in_filename", True)
  
      # Visualization Parameters
      add_parameter(self, kwargs, "show_output", False)
      add_parameter(self, kwargs, "show_output_save", False)
  
      # Implementation Parameters
      add_parameter(self, kwargs, "channels_first", False)
      add_parameter(self, kwargs, "batch_size", 32)
  
      # Internal Parameters
      add_parameter(self, kwargs, "replace_existing", True)
      add_parameter(self, kwargs, "verbose", True)
      add_parameter(self, kwargs, "case", None)
  
      if self.output_filename is not None:
          self.output_filename_base = self.output_filename
  
      # Derived Parameters
      self.return_objects = []
      self.return_filenames = []
      self.postprocessors = []
      self.postprocessor_string = ""
      self.lead_key = self.inputs[0]
      self.case_directory_output = False
      self.output_filename_base, self.output_extension = nifti_splitext(
          self.output_filename_base
      )
      self.open_files = defaultdict(lambda: None)
  
      self.load(kwargs)
  
      self.kwargs = additional_kwargs(self, kwargs)
  
      return
  
imports: import os
  import csv
  import numpy
  from collections import defaultdict
  from deepneuro.utilities.conversion import save_data
  from deepneuro.utilities.util import add_parameter, replace_suffix, nifti_splitext, additional_kwargs
  from deepneuro.utilities.visualize import check_data
label_desc: Use image node_id 1 to create a new Output object from inherited base classes: object with example: obj = Output()