code: def whitening_transformation(image, mask):
      # make sure image is a monomodal volume
      masked_img = ma.masked_array(image, np.logical_not(mask))
      image = (image - masked_img.mean()) / max(masked_img.std(), 1e-5)
      return image
  
file_path: NiftyNet/niftynet/layer/mean_variance_normalisation.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import numpy.ma
  from niftynet.layer.base_layer import Layer
  from niftynet.layer.binary_masking import BinaryMaskingLayer
label_desc: Use image node_id 1 for calling a global function with example usage: whitening_transformation(image, mask) and returns: image