docstr: Summary
  
  Parameters
  ----------
  input_data : TYPE
      Description
  model : None, optional
      Description
  
  Returns
  -------
  TYPE
      Description
docstr_tok: ["Summary","Parameters","--","--","--","--","--","input_data",":","TYPE","Description","model",":","None",",","optional","Description","Returns","--","--","--","-","TYPE","Description"]
code: def process_case(self, input_data, model=None):
      """Summary
  
      Parameters
      ----------
      input_data : TYPE
          Description
      model : None, optional
          Description
  
      Returns
      -------
      TYPE
          Description
      """
  
      input_data = input_data[self.lead_key]
  
      if model is not None:
          self.model = model
  
      if self.channels_first:
          input_data = np.swapaxes(input_data, 1, -1)
  
      if self.input_channels is not None:
          input_data = np.take(
              input_data, self.input_channels, self.channels_dim
          )
  
      # Determine patch shape. Currently only extends to spatial patching.
      # This leading dims business has got to have a better solution..
      if self.input_patch_shape is None:
          self.input_patch_shape = self.model.model_input_shape
      if self.output_patch_shape is None:
          self.output_patch_shape = self.model.model_output_shape
  
      self.input_dim = len(self.input_patch_shape) - 2
  
      if self.patch_dimensions is None:
          if self.channels_first:
              self.patch_dimensions = [
                  -1 * self.input_dim + x for x in range(self.input_dim)
              ]
          else:
              self.patch_dimensions = [
                  -1 * self.input_dim + x - 1
                  for x in range(self.input_dim)
              ]
  
          if self.output_patch_dimensions is None:
              self.output_patch_dimensions = self.patch_dimensions
  
      self.output_shape = [1] + list(self.model.model_output_shape)[
          1:
      ]  # Weird
      for i in range(len(self.patch_dimensions)):
          self.output_shape[
              self.output_patch_dimensions[i]
          ] = input_data.shape[self.patch_dimensions[i]]
  
      output_data = self.predict(input_data)
  
      if self.output_channels is not None:
          output_data = np.take(
              output_data, self.output_channels, self.channels_dim
          )
  
      # Will fail for time-data.
      if self.channels_first:
          output_data = np.swapaxes(output_data, 1, -1)
  
      self.return_objects.append(output_data)
  
      return output_data
  
file_path: DeepNeuro/deepneuro/outputs/segmentation.py
imports: import numpy
  from deepneuro.outputs.inference import ModelInference
  from deepneuro.utilities.util import add_parameter, docker_print
label_desc: Use image node_id 2 for calling the PatchesInference obj's underlying member method code with example usage: obj.process_case(input_data, model) and returns: output_data