code: def verify_same_geometry_and_shape_and_nonan(image_paths, label_path):
      # verify that all modalities and the label have the same shape and geometry.
      label_itk = sitk.ReadImage(label_path)
      nans_in_seg = np.any(np.isnan(sitk.GetArrayFromImage(label_itk)))
      assert (
          not nans_in_seg
      ), "There are NAN values in label {}.".format(label_path)
      for image_path in image_paths:
          img = sitk.ReadImage(image_path)
          np_img = sitk.GetArrayFromImage(img)
          nans_in_image = np.any(np.isnan(np_img))
          assert (
              not nans_in_image
          ), "There are NAN values in image {}.".format(image_path)
          assert verify_same_geometry(img, label_itk), (
              "The geometry of the image {} does not match the geometry of the label {}. The pixel arrays "
              "will not be aligned and nnU-Net cannot use this data. Please make sure your image modalities "
              "are coregistered and have the same geometry as the label.".format(
                  image_path, label_path
              )
          )
  
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 4 for calling a global function with example usage: verify_same_geometry_and_shape_and_nonan(image_paths, label_path) without return types