docstr: Wonky behavior reading from hdf5 here.
          
docstr_tok: ["Wonky","behavior","reading","from","hdf5","here","."]
code: def get_data(self, index=None, return_affine=False):
      """Wonky behavior reading from hdf5 here."""
  
      if self.source == "hdf5":
          preprocessed_case = self.data[index][:][np.newaxis][0]
  
          # Storing affines needs work. How not to duplicate affines in case
          # of augmentation, for example?
          if self.data_affines is not None:
              if self.data_affines.shape[0] == 0:
                  preprocessed_affine = None
              else:
                  preprocessed_affine = self.data_affines[index]
          else:
              preprocessed_affine = None
      else:
          if type(self.preprocessed_case) is np.ndarray:
              preprocessed_case, preprocessed_affine = (
                  self.preprocessed_case,
                  self.preprocessed_affine,
              )
          else:
              preprocessed_case, preprocessed_affine = read_image_files(
                  self.preprocessed_case, return_affine=True
              )
  
      if return_affine:
          return preprocessed_case, preprocessed_affine
      else:
          return preprocessed_case
  
      return None
  
file_path: DeepNeuro/deepneuro/data/data_group.py
imports: import numpy
  from deepneuro.utilities.conversion import read_image_files
label_desc: Use image node_id 4 for calling the DataGroup obj's underlying member method code with example usage: obj.get_data(index, return_affine) and returns: None, preprocessed_case,  preprocessed_affine, preprocessed_case