code: def _get_target_img_size(target_img_size):
      # This should return an image according to the free gpu memory available
      # Equation obtained from curve fitting using table:
      # https://tinyurl.com/tableGPUMemory
      gpu_mem = gpu_memory_map()[0]
      # Get a number in base 2 close to the mean depth
      depth_base_2 = int(2 ** np.ceil(np.log2(target_img_size[2])))
      # Get the maximum width according available GPU memory
      # This equation roughly estimates the image size that fits in the available GPU memory using DynUNet
      width = (gpu_mem - 2000) / (0.5 * depth_base_2)
      width_base_2 = int(2 ** np.round(np.log2(width)))
      if width_base_2 < np.maximum(
          target_img_size[0], target_img_size[1]
      ):
          return [width_base_2, width_base_2, depth_base_2]
      else:
          return [target_img_size[0], target_img_size[1], depth_base_2]
  
file_path: MONAILabel/monailabel/utils/others/planner.py
imports: import logging
  import random
  import numpy
  from monai.transforms import LoadImage
  from tqdm import tqdm
  from monailabel.utils.others.generic import gpu_memory_map
label_desc: Use image node_id 3 for calling the HeuristicPlanner obj's underlying member method code with example usage: obj._get_target_img_size(target_img_size) and returns: list, list