code: def verify_test_dataset(
      folder, num_modalities, identifiers, test_images_dir="imagesTs"
  ):
      imagesTs_folder = join_paths(folder, test_images_dir)
      nii_files_in_imagesTs = [
          nii_path
          for nii_path in os.listdir(imagesTs_folder)
          if os.path.isfile(join_paths(imagesTs_folder, nii_path))
          and nii_path.endswith(".nii.gz")
      ]
      for c in identifiers:
          # check if all files are present
          expected_image_files = [
              join_paths(
                  folder, test_images_dir, c + "_%04.0d.nii.gz" % i
              )
              for i in range(num_modalities)
          ]
          assert all(
              [os.path.isfile(i) for i in expected_image_files]
          ), "Some image files are missing for case {}. Expected files: {}.".format(
              c, expected_image_files
          )
  
          # verify that all modalities have the same geometry. We use the affine for this
          if num_modalities > 1:
              images_itk = [
                  sitk.ReadImage(i) for i in expected_image_files
              ]
              reference_img = images_itk[0]
              for i, img in enumerate(images_itk[1:]):
                  assert verify_same_geometry(img, reference_img), (
                      "The modalities of the image {} do not seem to be "
                      "registered. Please coregister your modalities.".foramt(
                          expected_image_files[i]
                      )
                  )
          for i in expected_image_files:
              nii_files_in_imagesTs.remove(os.path.basename(i))
      assert (
          len(nii_files_in_imagesTs) == 0
      ), "There are training cases in {} that are not listed in dataset json file. Their names are listed in {}.".format(
          test_images_dir, nii_files_in_imagesTs
      )
  
file_path: PaddleSeg/contrib/MedicalSeg/tools/preprocess_utils/integrity_checks.py
imports: import os
  import json
  import numpy
  import SimpleITK
  import nibabel
  from multiprocessing import Pool
  from .load_image import load_series
  from .path_utils import join_paths
label_desc: Use image node_id 6 for calling a global function with example usage: verify_test_dataset(folder, num_modalities, identifiers, test_images_dir) without return types