docstr: Creates an affine transformation for an ITK image based on the provided parameters.
  
  Args:
      image: The ITK image.
      translation: The translation (shift) to apply to the image.
      rotation: The rotation to apply to the image, specified as angles in radians around the x, y, and z axes.
      scale: The scaling factor to apply to the image.
      shear: The shear to apply to the image.
      center_of_rotation: The center of rotation for the image. If not specified,
                          the center of the image is used.
  
  Returns:
      A tuple containing the affine transformation matrix and the translation vector.
code: def create_itk_affine_from_parameters(
      self,
      image,
      translation=None,
      rotation=None,
      scale=None,
      shear=None,
      center_of_rotation=None,
  ):
      """
      Creates an affine transformation for an ITK image based on the provided parameters.
  
      Args:
          image: The ITK image.
          translation: The translation (shift) to apply to the image.
          rotation: The rotation to apply to the image, specified as angles in radians around the x, y, and z axes.
          scale: The scaling factor to apply to the image.
          shear: The shear to apply to the image.
          center_of_rotation: The center of rotation for the image. If not specified,
                              the center of the image is used.
  
      Returns:
          A tuple containing the affine transformation matrix and the translation vector.
      """
      itk_transform = itk.AffineTransform[itk.D, image.ndim].New()
  
      # Set center
      if center_of_rotation:
          itk_transform.SetCenter(center_of_rotation)
      else:
          itk_transform.SetCenter(get_itk_image_center(image))
  
      # Set parameters
      if rotation:
          if image.ndim == 2:
              itk_transform.Rotate2D(rotation[0])
          else:
              for i, angle_in_rads in enumerate(rotation):
                  if angle_in_rads != 0:
                      axis = [0, 0, 0]
                      axis[i] = 1
                      itk_transform.Rotate3D(axis, angle_in_rads)
  
      if scale:
          itk_transform.Scale(scale)
  
      if shear:
          itk_transform.Shear(*shear)
  
      if translation:
          itk_transform.Translate(translation)
  
      matrix = np.asarray(itk_transform.GetMatrix(), dtype=np.float64)
  
      return matrix, translation
  
imports: from __future__ import annotations
  import itertools
  import os
  import tempfile
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  import monai
  import monai.transforms
  from monai.apps import download_url
  from monai.data import ITKReader
  from monai.data.itk_torch_bridge import get_itk_image_center, itk_image_to_metatensor, itk_to_monai_affine, metatensor_to_itk_image, monai_to_itk_affine, monai_to_itk_ddf
  from monai.networks.blocks import Warp
  from monai.transforms import Affine
  from monai.utils import optional_import, set_determinism
  from tests.utils import assert_allclose, skip_if_downloading_fails, skip_if_quick, test_is_quick, testing_data_config
label_desc: Use image node_id 3 for calling the TestITKTorchAffineMatrixBridge obj's underlying member method code with example usage: obj.create_itk_affine_from_parameters(image, translation, rotation, scale, shear, center_of_rotation) and returns: matrix,  translation