code: def bounding_box(self, points, img_shape):
      ndim = len(img_shape)
      margin = ensure_tuple_rep(self.margin, ndim)
      for m in margin:
          if m < 0:
              raise ValueError(
                  "margin value should not be negative number."
              )
  
      box_start = [0] * ndim
      box_end = [0] * ndim
  
      for di in range(ndim):
          dt = points[..., di]
          min_d = max(min(dt - margin[di]), 0)
          max_d = min(img_shape[di], max(dt + margin[di] + 1))
          box_start[di], box_end[di] = min_d, max_d
      return box_start, box_end
  
imports: import json
  import logging
  from typing import Callable, Dict, Hashable, List, Optional, Sequence, Union
  import numpy
  import torch
  from monai.config import IndexSelection, KeysCollection
  from monai.data import MetaTensor
  from monai.transforms import MapTransform, Randomizable, Resize, SpatialCrop, generate_spatial_bounding_box, is_positive
  from monai.utils import InterpolateMode, PostFix, ensure_tuple_rep
  from scipy.ndimage import distance_transform_cdt, gaussian_filter
  from skimage import measure
label_desc: Use image node_id 2 for calling the SpatialCropGuidanced obj's underlying member method code with example usage: obj.bounding_box(points, img_shape) and returns: box_start,  box_end