code: def _compute_offset_matrix(
      image, center_of_rotation
  ) -> tuple[torch.Tensor, torch.Tensor]:
      ndim = image.ndim
      offset = np.asarray(get_itk_image_center(image)) - np.asarray(
          center_of_rotation
      )
      offset_matrix = torch.eye(ndim + 1, dtype=torch.float64)
      offset_matrix[:ndim, ndim] = torch.tensor(
          offset, dtype=torch.float64
      )
      inverse_offset_matrix = torch.eye(ndim + 1, dtype=torch.float64)
      inverse_offset_matrix[:ndim, ndim] = -torch.tensor(
          offset, dtype=torch.float64
      )
  
      return offset_matrix, inverse_offset_matrix
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, cast
  import numpy
  import torch
  from monai.config.type_definitions import DtypeLike
  from monai.data import ITKReader, ITKWriter
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import orientation_ras_lps
  from monai.transforms import EnsureChannelFirst
  from monai.utils import MetaKeys, SpaceKeys, convert_to_dst_type, optional_import
label_desc: Use image node_id 7 for calling a global function with example usage: _compute_offset_matrix(image, center_of_rotation) and returns: offset_matrix,  inverse_offset_matrix