docs: def log_transform(image):
      '''Renormalize image intensities to log space
      
      Returns a tuple of transformed image and a dictionary to be passed into
      inverse_log_transform. The minimum and maximum from the dictionary
      can be applied to an image by the inverse_log_transform to 
      convert it back to its former intensity values.
      '''
      orig_min, orig_max = scipy.ndimage.extrema(image)[:2]
      #
      # We add 1/2 bit noise to an 8 bit image to give the log a bottom
      #
      limage = image.copy()
      noise_min = orig_min + (orig_max-orig_min)/256.0+np.finfo(image.dtype).eps
      limage[limage < noise_min] = noise_min
      d = { "noise_min":noise_min}
      limage = np.log(limage)
      log_min, log_max = scipy.ndimage.extrema(limage)[:2]
      d["log_min"] = log_min
      d["log_max"] = log_max
      return stretch(limage), d