code: def test_crop_shape(self):
      tt = RandCropBoxByPosNegLabeld(
          image_keys=["image"],
          box_keys="box",
          label_keys="label",
          spatial_size=[10, 7, -1],
          whole_box=True,
          num_samples=1,
          pos=1,
          neg=0,
      )
      iii = {
          "image": torch.rand(1, 10, 8, 7),
          "box": torch.tensor(((1.0, 2.0, 3.0, 4.0, 5.0, 6.0),)),
          "label": torch.tensor((1,)).long(),
      }
      self.assertEqual(tt(iii)[0]["image"].shape, (1, 10, 7, 7))
  
file_path: MONAI/tests/test_box_transform.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  import torch
  from parameterized import parameterized
  from monai.apps.detection.transforms.box_ops import convert_mask_to_box
  from monai.apps.detection.transforms.dictionary import AffineBoxToImageCoordinated, AffineBoxToWorldCoordinated, BoxToMaskd, ClipBoxToImaged, ConvertBoxModed, FlipBoxd, MaskToBoxd, RandCropBoxByPosNegLabeld, RandFlipBoxd, RandRotateBox90d, RandZoomBoxd, RotateBox90d, ZoomBoxd
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import CastToTyped, Invertd
  from tests.utils import TEST_NDARRAYS, assert_allclose
label_desc: Use image node_id 6 for calling the TestBoxTransform obj's underlying member method code with example usage: obj.test_crop_shape() without return types