docstr: This function and remove_channel are edge cases that should be dealt with outside of data_collection.
          
docstr_tok: ["This","function","and","remove_channel","are","edge","cases","that","should","be","dealt","with","outside","of","data_collection","."]
code: def add_channel(
      self, case, input_data, data_group_labels=None, channel_dim=-1
  ):
      """This function and remove_channel are edge cases that should be dealt with outside of data_collection."""
  
      # TODO: Add functionality for inserting channel at specific index, multiple channels
  
      if isinstance(input_data, str):
          input_data = read_image_files([input_data])
  
      if data_group_labels is None:
          data_groups = list(self.data_groups.values())
      else:
          data_groups = [
              self.data_groups[label] for label in data_group_labels
          ]
  
      for data_group in data_groups:
          if case != self.current_case:
              self.load_case_data(case)
  
          data_group.preprocessed_case = np.concatenate(
              (
                  data_group.preprocessed_case,
                  input_data[np.newaxis, ...],
              ),
              axis=channel_dim,
          )
  
          # # Perhaps should not use tuples for output shape.
          # This is broken.
          if data_group.output_shape is not None:
              output_shape = list(data_group.output_shape)
              output_shape[channel_dim] = output_shape[channel_dim] + 1
              data_group.output_shape = tuple(output_shape)
  
imports: import os
  import csv
  import numpy
  import tables
  import copy
  from tqdm import tqdm
  from deepneuro.augmentation.augment import Copy
  from deepneuro.utilities.conversion import read_image_files
  from deepneuro.data.data_group import DataGroup
  from deepneuro.data.data_load import parse_directories, parse_filepaths, parse_hdf5, parse_csv, parse_numpy
  from deepneuro.utilities.util import add_parameter
label_desc: Use image node_id 21 for calling the DataCollection obj's underlying member method code with example usage: obj.add_channel(case, input_data, data_group_labels, channel_dim) without return types