class_docstr: generate randomised rotation matrix for data augmentation
class_docstr_tok: ["generate","randomised","rotation","matrix","for","data","augmentation"]
code: def _apply_transformation_3d(self, image_3d, interp_order=3):
      if interp_order < 0:
          return image_3d
      assert image_3d.ndim == 3
      assert self._transform is not None
      assert all(
          [dim > 1 for dim in image_3d.shape]
      ), "random rotation supports 3D inputs only"
      center_ = 0.5 * np.asarray(image_3d.shape, dtype=np.int64)
      c_offset = center_ - center_.dot(self._transform)
      image_3d[...] = scipy.ndimage.affine_transform(
          image_3d[...], self._transform.T, c_offset, order=interp_order
      )
      return image_3d
  
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 6 for calling the RandomRotationLayer obj's underlying member method code with example usage: obj._apply_transformation_3d(image_3d, interp_order) and returns: image_3d, image_3d