code: def register_writer(ext_name, *im_writers):
      """
      Register ``ImageWriter``, so that writing a file with filename extension ``ext_name``
      could be resolved to a tuple of potentially appropriate ``ImageWriter``.
      The customised writers could be registered by:
  
      .. code-block:: python
  
          from monai.data import register_writer
          # `MyWriter` must implement `ImageWriter` interface
          register_writer("nii", MyWriter)
  
      Args:
          ext_name: the filename extension of the image.
              As an indexing key, it will be converted to a lower case string.
          im_writers: one or multiple ImageWriter classes with high priority ones first.
      """
      fmt = f"{ext_name}".lower()
      if fmt.startswith("."):
          fmt = fmt[1:]
      existing = look_up_option(fmt, SUPPORTED_WRITERS, default=())
      all_writers = im_writers + existing
      SUPPORTED_WRITERS[fmt] = all_writers
  
imports: from __future__ import annotations
  from collections.abc import Mapping, Sequence
  from typing import TYPE_CHECKING, Any, cast
  import numpy
  from monai.apps.utils import get_logger
  from monai.config import DtypeLike, NdarrayOrTensor, PathLike
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import affine_to_spacing, ensure_tuple, ensure_tuple_rep, orientation_ras_lps, to_affine_nd
  from monai.transforms.spatial.array import Resize, SpatialResample
  from monai.transforms.utils_pytorch_numpy_unification import ascontiguousarray, moveaxis
  from monai.utils import GridSampleMode, GridSamplePadMode, InterpolateMode, MetaKeys, OptionalImportError, SpaceKeys, convert_data_type, convert_to_tensor, get_equivalent_dtype, look_up_option, optional_import, require_pkg
label_desc: Use image node_id 1 for calling a global function with example usage: register_writer(ext_name) without return types