code: def check_dimensions(static, moving):
      """Check the dimensions of the input images.
  
      Parameters
      ----------
      static : 2D or 3D array
          the image to be used as reference during optimization.
  
      moving: 2D or 3D array
          the image to be used as "moving" during optimization. It is
          necessary to pre-align the moving image to ensure its domain
          lies inside the domain of the deformation fields. This is assumed
          to be accomplished by "pre-aligning" the moving image towards the
          static using an affine transformation given by the
          'starting_affine' matrix.
  
      """
      if len(static.shape) != len(moving.shape):
          raise ValueError(
              "Dimension mismatch: The input images must "
              "have same number of dimensions."
          )
  
      if len(static.shape) > 3 and len(moving.shape) > 3:
          raise ValueError(
              "Dimension mismatch: One of the input should "
              "be 2D or 3D dimensions."
          )
  
imports: import logging
  from warnings import warn
  import numpy
  import nibabel
  from os.path import join
  from dipy.utils.optpkg import optional_package
  from dipy.align.imaffine import AffineMap
  from dipy.align.imwarp import SymmetricDiffeomorphicRegistration, DiffeomorphicMap
  from dipy.align.metrics import CCMetric, SSDMetric, EMMetric
  from dipy.align.reslice import reslice
  from dipy.align import affine_registration, motion_correction
  from dipy.align.streamlinear import slr_with_qbx
  from dipy.tracking.streamline import set_number_of_points
  from dipy.align.streamwarp import bundlewarp
  from dipy.core.gradients import mask_non_weighted_bvals, gradient_table
  from dipy.io.image import save_nifti, load_nifti, save_qa_metric
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.tracking.streamline import transform_streamlines
  from dipy.workflows.workflow import Workflow
label_desc: Use image node_id 1 for calling a global function with example usage: check_dimensions(static, moving) without return types