class_docstr: generate randomised bias field transformation for data augmentation
class_docstr_tok: ["generate","randomised","bias","field","transformation","for","data","augmentation"]
code: def layer_op(self, inputs, interp_orders, *args, **kwargs):
      if inputs is None:
          return inputs
      for field, image in inputs.items():
          if field == "image":
              for mod_i in range(image.shape[-1]):
                  if image.ndim == 4:
                      inputs[field][
                          ..., mod_i
                      ] = self._apply_transformation(image[..., mod_i])
                  elif image.ndim == 5:
                      for t in range(image.shape[-2]):
                          inputs[field][
                              ..., t, mod_i
                          ] = self._apply_transformation(
                              image[..., t, mod_i]
                          )
                  else:
                      raise NotImplementedError("unknown input format")
      return inputs
  
file_path: NiftyNet/niftynet/layer/rand_bias_field.py
imports: from __future__ import absolute_import, print_function
  import numpy
  from niftynet.layer.base_layer import RandomisedLayer
label_desc: Use image node_id 8 for calling the RandomBiasFieldLayer obj's underlying member method code with example usage: obj.layer_op(inputs, interp_orders) and returns: inputs, inputs