code: def layer_op(self, image, mask=None):
      assert (
          self.is_ready()
      ), "histogram normalisation layer needs to be trained first."
      if isinstance(image, dict):
          image_5d = np.asarray(
              image[self.image_name], dtype=np.float32
          )
      else:
          image_5d = np.asarray(image, dtype=np.float32)
  
      if isinstance(mask, dict):
          image_mask = mask.get(self.image_name, None)
      elif mask is not None:
          image_mask = mask
      elif self.binary_masking_func is not None:
          image_mask = self.binary_masking_func(image_5d)
      else:
          # no access to mask, default to all image
          image_mask = np.ones_like(image_5d, dtype=np.bool)
  
      normalised = self._normalise_5d(image_5d, image_mask)
  
      if isinstance(image, dict):
          image[self.image_name] = normalised
          if isinstance(mask, dict):
              mask[self.image_name] = image_mask
          else:
              mask = {self.image_name: image_mask}
          return image, mask
      else:
          return normalised, image_mask
  
file_path: NiftyNet/niftynet/layer/histogram_normalisation.py
imports: from __future__ import absolute_import, print_function, division
  import os
  import numpy
  import tensorflow
  import niftynet.utilities.histogram_standardisation
  from niftynet.layer.base_layer import DataDependentLayer
  from niftynet.layer.binary_masking import BinaryMaskingLayer
label_desc: Use image node_id 2 for calling the HistogramNormalisationLayer obj's underlying member method code with example usage: obj.layer_op(image, mask) and returns: image,  mask, normalised,  image_mask