code: def clip_boxes_3D(boxes, window):
      """
      boxes: [N, 6] each col is y1, x1, y2, x2, z1, z2
      window: [6] in the form y1, x1, y2, x2, z1, z2
      """
      boxes = torch.stack(
          [
              boxes[:, 0].clamp(float(window[0]), float(window[2])),
              boxes[:, 1].clamp(float(window[1]), float(window[3])),
              boxes[:, 2].clamp(float(window[0]), float(window[2])),
              boxes[:, 3].clamp(float(window[1]), float(window[3])),
              boxes[:, 4].clamp(float(window[4]), float(window[5])),
              boxes[:, 5].clamp(float(window[4]), float(window[5])),
          ],
          1,
      )
      return boxes
  
imports: import numpy
  import scipy.misc
  import scipy.ndimage
  import torch
  from torch.autograd import Variable
  import torch.nn
label_desc: Use image node_id 13 for calling a global function with example usage: clip_boxes_3D(boxes, window) and returns: boxes