docs: def resize_to_mm(data3d, voxelsize_mm, new_voxelsize_mm, mode='nearest'):
      """
      Function can resize data3d or segmentation to specifed voxelsize_mm
      :new_voxelsize_mm: requested voxelsize. List of 3 numbers, also
          can be a string 'orig', 'orgi*2' and 'orgi*4'.
  
      :voxelsize_mm: size of voxel
      :mode: default is 'nearest'
      """
      import scipy
      import scipy.ndimage
  
      if np.all(list(new_voxelsize_mm) == 'orig'):
          new_voxelsize_mm = np.array(voxelsize_mm)
      elif np.all(list(new_voxelsize_mm) == 'orig*2'):
          new_voxelsize_mm = np.array(voxelsize_mm) * 2
      elif np.all(list(new_voxelsize_mm) == 'orig*4'):
          new_voxelsize_mm = np.array(voxelsize_mm) * 4
          # vx_size = np.array(metadata['voxelsize_mm']) * 4
  
      zoom = voxelsize_mm / (1.0 * np.array(new_voxelsize_mm))
      data3d_res = scipy.ndimage.zoom(
          data3d,
          zoom,
          mode=mode,
          order=1
      ).astype(data3d.dtype)
      return data3d_res