code: def get_target_spacing(self):
      spacings = self.dataset_properties["all_spacings"]
      sizes = self.dataset_properties["all_sizes"]
  
      target = np.percentile(
          np.vstack(spacings), self.target_spacing_percentile, 0
      )
      target_size = np.percentile(
          np.vstack(sizes), self.target_spacing_percentile, 0
      )
      target_size_mm = np.array(target) * np.array(target_size)
  
      worst_spacing_axis = np.argmax(target)
      other_axes = [
          i for i in range(len(target)) if i != worst_spacing_axis
      ]
      other_spacings = [target[i] for i in other_axes]
      other_sizes = [target_size[i] for i in other_axes]
  
      has_aniso_spacing = target[worst_spacing_axis] > (
          self.anisotropy_threshold * max(other_spacings)
      )
      has_aniso_voxels = target_size[
          worst_spacing_axis
      ] * self.anisotropy_threshold < min(other_sizes)
  
      if has_aniso_spacing and has_aniso_voxels:
          spacings_of_that_axis = np.vstack(spacings)[
              :, worst_spacing_axis
          ]
          target_spacing_of_that_axis = np.percentile(
              spacings_of_that_axis, 10
          )
          if target_spacing_of_that_axis < max(other_spacings):
              target_spacing_of_that_axis = (
                  max(max(other_spacings), target_spacing_of_that_axis)
                  + 1e-5
              )
          target[worst_spacing_axis] = target_spacing_of_that_axis
      return target
  
imports: import os
  import pickle
  import shutil
  from collections import OrderedDict
  from .image_crop import get_case_identifier_from_npz
  from .preprocessing import GenericPreprocessor, PreprocessorFor2D
  from .experiment_utils import *
  from .path_utils import join_paths
label_desc: Use image node_id 2 for calling the ExperimentPlanner3D_v21 obj's underlying member method code with example usage: obj.get_target_spacing() and returns: target