code: def _run_internal(
      self,
      target_spacing,
      case_identifier,
      output_folder_stage,
      cropped_output_dir,
      force_separate_z,
      all_classes,
  ):
      data, seg, properties = self.load_cropped(
          cropped_output_dir, case_identifier
      )
  
      data = data.transpose(
          (0, *[i + 1 for i in self.transpose_forward])
      )
      seg = seg.transpose((0, *[i + 1 for i in self.transpose_forward]))
  
      data, seg, properties = self.resample_and_normalize(
          data, target_spacing, properties, seg, force_separate_z
      )
  
      all_data = np.vstack((data, seg)).astype(np.float32)
  
      num_samples = 10000
      min_percent_coverage = 0.01
      rndst = np.random.RandomState(1234)
      class_locs = {}
      for c in all_classes:
          all_locs = np.argwhere(all_data[-1] == c)
          if len(all_locs) == 0:
              class_locs[c] = []
              continue
          target_num_samples = min(num_samples, len(all_locs))
          target_num_samples = max(
              target_num_samples,
              int(np.ceil(len(all_locs) * min_percent_coverage)),
          )
  
          selected = all_locs[
              rndst.choice(
                  len(all_locs), target_num_samples, replace=False
              )
          ]
          class_locs[c] = selected
          print(c, target_num_samples)
      properties["class_locations"] = class_locs
  
      print(
          "saving: ",
          join_paths(output_folder_stage, "%s.npz" % case_identifier),
      )
      np.savez_compressed(
          join_paths(output_folder_stage, "%s.npz" % case_identifier),
          data=all_data.astype(np.float32),
      )
      with open(
          join_paths(output_folder_stage, "%s.pkl" % case_identifier),
          "wb",
      ) as f:
          pickle.dump(properties, f)
  
imports: import pickle
  import os
  import numpy
  from collections import OrderedDict
  from scipy.ndimage.interpolation import map_coordinates
  from multiprocessing.pool import Pool
  from skimage.transform import resize
  from .image_crop import get_case_identifier_from_npz, ImageCropper
  from .path_utils import join_paths
label_desc: Use image node_id 5 for calling the GenericPreprocessor obj's underlying member method code with example usage: obj._run_internal(target_spacing, case_identifier, output_folder_stage, cropped_output_dir, force_separate_z, all_classes) without return types