def METHOD_NAME(
    self,
    tensor: torch.Tensor,
    spikes_positions: np.ndarray,
    intensity_factor: float,
):
    if intensity_factor == 0 or len(spikes_positions) == 0:
        return tensor
    spectrum = self.fourier_transform(tensor)
    shape = np.array(spectrum.shape)
    mid_shape = shape // 2
    indices = np.floor(spikes_positions * shape).astype(int)
    for index in indices:
        diff = index - mid_shape
        i, j, k = mid_shape + diff
        # As of torch 1.7, "max is not yet implemented for complex tensors"
        artifact = spectrum.cpu().numpy().max() * intensity_factor
        if self.invert_transform:
            spectrum[i, j, k] -= artifact
        else:
            spectrum[i, j, k] += artifact
        # If we wanted to add a pure cosine, we should add spikes to both
        # sides of k-space. However, having only one is a better
        # representation og the actual cause of the artifact in real
        # scans. Therefore the next two lines have been removed.
        # #i, j, k = mid_shape - diff
        # #spectrum[i, j, k] = spectrum.max() * intensity_factor
    result = self.inv_fourier_transform(spectrum).real.float()
    return result