code: def smooth_threshold(value, mode="high"):
      smoothness = 1.0
      if mode == "high":
          affine = np.min(value)
          smooth_value = (value - affine) / smoothness
          smooth_value = (1.0 - np.exp((-1) * smooth_value)) + affine
      elif mode == "low":
          affine = np.max(value)
          smooth_value = (value - affine) / smoothness
          smooth_value = (np.exp(smooth_value) - 1.0) + affine
      else:
          smooth_value = value
      return smooth_value
  
file_path: NiftyNet/niftynet/utilities/histogram_standardisation.py
imports: from __future__ import absolute_import, print_function, division
  import os
  import numpy
  import numpy.ma
  import tensorflow
  from niftynet.io.misc_io import touch_folder
  from niftynet.utilities.util_common import look_up_operations, print_progress_bar
label_desc: Use image node_id 7 for calling a global function with example usage: smooth_threshold(value, mode) and returns: smooth_value