code: def get_mirrored_patch_crops(patch_crops, org_img_shape):
      """
      apply 3 mirrror transformations (x-axis, y-axis, x&y-axis)
      to given patch crop coordinates and return the transformed coordinates.
      Handles 2D and 3D coordinates.
      :param patch_crops: list of crops: each element is a list of coordinates for given crop [[y1, x1, ...], [y1, x1, ..]]
      :param org_img_shape: shape of patient volume used as world coordinates.
      :return: list of mirrored patch crops: lenght=3. each element is a list of transformed patch crops.
      """
      mirrored_patch_crops = []
  
      # y-axis transform.
      mirrored_patch_crops.append(
          [
              [
                  org_img_shape[2] - ii[1],
                  org_img_shape[2] - ii[0],
                  ii[2],
                  ii[3],
              ]
              if len(ii) == 4
              else [
                  org_img_shape[2] - ii[1],
                  org_img_shape[2] - ii[0],
                  ii[2],
                  ii[3],
                  ii[4],
                  ii[5],
              ]
              for ii in patch_crops
          ]
      )
  
      # x-axis transform.
      mirrored_patch_crops.append(
          [
              [
                  ii[0],
                  ii[1],
                  org_img_shape[3] - ii[3],
                  org_img_shape[3] - ii[2],
              ]
              if len(ii) == 4
              else [
                  ii[0],
                  ii[1],
                  org_img_shape[3] - ii[3],
                  org_img_shape[3] - ii[2],
                  ii[4],
                  ii[5],
              ]
              for ii in patch_crops
          ]
      )
  
      # y-axis and x-axis transform.
      mirrored_patch_crops.append(
          [
              [
                  org_img_shape[2] - ii[1],
                  org_img_shape[2] - ii[0],
                  org_img_shape[3] - ii[3],
                  org_img_shape[3] - ii[2],
              ]
              if len(ii) == 4
              else [
                  org_img_shape[2] - ii[1],
                  org_img_shape[2] - ii[0],
                  org_img_shape[3] - ii[3],
                  org_img_shape[3] - ii[2],
                  ii[4],
                  ii[5],
              ]
              for ii in patch_crops
          ]
      )
  
      return mirrored_patch_crops
  
imports: import os
  import numpy
  import torch
  from scipy.stats import norm
  from collections import OrderedDict
  from multiprocessing import Pool
  import pickle
  import pandas
label_desc: Use image node_id 5 for calling a global function with example usage: get_mirrored_patch_crops(patch_crops, org_img_shape) and returns: mirrored_patch_crops