class_docstr: generate randomised rotation matrix for data augmentation
class_docstr_tok: ["generate","randomised","rotation","matrix","for","data","augmentation"]
code: def layer_op(self, inputs, interp_orders, *args, **kwargs):
      if inputs is None:
          return inputs
  
      if isinstance(inputs, dict) and isinstance(interp_orders, dict):
          for field, image in inputs.items():
              interp_order = interp_orders[field][0]
              for channel_idx in range(image.shape[-1]):
                  if image.ndim == 4:
                      inputs[field][
                          ..., channel_idx
                      ] = self._apply_transformation_3d(
                          image[..., channel_idx], interp_order
                      )
                  elif image.ndim == 5:
                      for t in range(image.shape[-2]):
                          inputs[field][
                              ..., t, channel_idx
                          ] = self._apply_transformation_3d(
                              image[..., t, channel_idx], interp_order
                          )
                  else:
                      raise NotImplementedError("unknown input format")
          # shapes = []
          # for (field, image) in inputs.items():
          #     shapes.append(image.shape)
          # assert(len(shapes) == 2 and shapes[0][0:4] == shapes[1][0:4]), shapes
      else:
          raise NotImplementedError("unknown input format")
      return inputs
  
file_path: NiftyNet/niftynet/layer/rand_rotation.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import scipy.ndimage
  from niftynet.layer.base_layer import RandomisedLayer
label_desc: Use image node_id 7 for calling the RandomRotationLayer obj's underlying member method code with example usage: obj.layer_op(inputs, interp_orders) and returns: inputs, inputs