class_docstr: Test collation for of random transformations with prob == 0 and 1.
code: def setUp(self):
      if not has_nib:
          self.skipTest("nibabel required for test_inverse")
  
      set_determinism(seed=0)
  
      b_size = 11
      im_fname, seg_fname = (
          make_nifti_image(i)
          for i in create_test_image_3d(101, 100, 107)
      )
      load_ims = Compose(
          [
              LoadImaged(KEYS),
              EnsureChannelFirstd(KEYS, channel_dim="no_channel"),
          ]
      )
      self.data_3d = [
          load_ims({"image": im_fname, "label": seg_fname})
          for _ in range(b_size)
      ]
  
      b_size = 8
      im_fname, seg_fname = (
          make_nifti_image(i)
          for i in create_test_image_2d(62, 37, rad_max=10)
      )
      load_ims = Compose(
          [
              LoadImaged(KEYS),
              EnsureChannelFirstd(KEYS, channel_dim="no_channel"),
          ]
      )
      self.data_2d = [
          load_ims({"image": im_fname, "label": seg_fname})
          for _ in range(b_size)
      ]
  
      self.batch_size = 7
  
file_path: MONAI/tests/test_inverse_collation.py
imports: from __future__ import annotations
  import sys
  import unittest
  from typing import TYPE_CHECKING
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data import CacheDataset, DataLoader, MetaTensor, create_test_image_2d, create_test_image_3d, decollate_batch, pad_list_data_collate
  from monai.transforms import Compose, EnsureChannelFirstd, Flipd, LoadImaged, RandAffined, RandAxisFlipd, RandFlipd, RandRotate90d, RandRotated, RandZoomd, ResizeWithPadOrCropd, Rotated
  from monai.utils import optional_import, set_determinism
  from tests.utils import make_nifti_image
label_desc: Use image node_id 1 for calling the TestInverseCollation obj's underlying member method code with example usage: obj.setUp() without return types