code: def test_highlighted_kspace_pixel(
      self, im_shape, as_tensor_input, k_intensity
  ):
      im = self.get_data(im_shape, as_tensor_input)
      loc = (
          [0, int(im.shape[1] / 2), 0]
          if len(im_shape) == 2
          else [0, int(im.shape[1] / 2), 0, 0]
      )
      t = KSpaceSpikeNoise(loc, k_intensity)
      out = t(im)
  
      if isinstance(out, torch.Tensor):
          out = out.cpu()
  
      if k_intensity is not None:
          n_dims = len(im_shape)
          out_k = fftshift(
              fftn(out, axes=tuple(range(-n_dims, 0))),
              axes=tuple(range(-n_dims, 0)),
          )
          log_mag = np.log(np.absolute(out_k))
          np.testing.assert_allclose(
              k_intensity, log_mag[tuple(loc)], 1e-4
          )
  
file_path: MONAI/tests/test_k_space_spike_noise.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  import torch
  from numpy.fft import fftn, fftshift
  from parameterized import parameterized
  from monai.data.synthetic import create_test_image_2d, create_test_image_3d
  from monai.transforms import KSpaceSpikeNoise
  from monai.utils.misc import set_determinism
  from tests.utils import TEST_NDARRAYS
label_desc: Use image node_id 5 for calling the TestKSpaceSpikeNoise obj's underlying member method code with example usage: obj.test_highlighted_kspace_pixel(im_shape, as_tensor_input, k_intensity) without return types