code: def create_expected_numpy_output(input_datum, **kwargs):
      x = np.fft.fft(
          input_datum.cpu().numpy()
          if input_datum.device.type == "cuda"
          else input_datum.numpy(),
          **kwargs,
      )
      f = np.fft.fftfreq(x.shape[kwargs["axis"]])
      u = np.heaviside(f, 0.5)
      new_dims_before = kwargs["axis"]
      new_dims_after = len(x.shape) - kwargs["axis"] - 1
      for _ in range(new_dims_before):
          u = np.expand_dims(u, 0)
      for _ in range(new_dims_after):
          u = np.expand_dims(u, -1)
      ht = np.fft.ifft(x * 2 * u, axis=kwargs["axis"])
  
      return ht
  
file_path: MONAI/tests/test_hilbert_transform.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.networks.layers import HilbertTransform
  from monai.utils import OptionalImportError
  from tests.utils import SkipIfModule, SkipIfNoModule, skip_if_no_cuda
label_desc: Use image node_id 1 for calling a global function with example usage: create_expected_numpy_output(input_datum) and returns: ht