docstr: I think there should be a more pythonic/numpythonic way to do this.
          
docstr_tok: ["I","think","there","should","be","a","more","pythonic\/numpythonic","way","to","do","this","."]
code: def preprocess(self, data_group):
      """I think there should be a more pythonic/numpythonic way to do this."""
  
      input_data = data_group.preprocessed_case
      output_shape = list(input_data.shape)
      output_shape[-1] = len(self.label_splits)
      output_data = np.zeros(output_shape)
  
      # Merge Target Channels
      if self.split_method == "integer_levels":
          for label_idx, label in enumerate(self.label_splits):
              if type(label) is list:
                  # This is a little clunky
                  single_label_data = np.zeros(output_shape[0:-1])[
                      ..., np.newaxis
                  ]
                  for index in label:
                      single_label_data += np.where(
                          input_data == index, 1, 0
                      )
                  single_label_data = np.where(
                      single_label_data > 0, 1, 0
                  )
              else:
                  single_label_data = np.where(
                      input_data == label, 1, 0
                  )
  
              output_data[..., label_idx] = single_label_data[..., 0]
  
      data_group.preprocessed_case = output_data
      self.output_data = output_data
  
imports: import subprocess
  import os
  import numpy
  import itertools
  from deepneuro.preprocessing.preprocessor import Preprocessor
  from deepneuro.utilities.util import add_parameter, quotes
label_desc: Use image node_id 3 for calling the SplitData obj's underlying member method code with example usage: obj.preprocess(data_group) without return types