code: def _transpose(data):
      nof_dims = len(data.shape) - 1
      perm = [0] + list(range(nof_dims, 0, -1))
      perm += list(range(nof_dims + 1, len(data.shape)))
      assert len(perm) == len(data.shape)
  
      return tf.transpose(data, perm)
  
file_path: NiftyNet/niftynet/contrib/niftyreg_image_resampling/niftyreg_image_resampling.py
imports: from __future__ import print_function, division
  import tensorflow
  from tensorflow.python.framework import ops
  from niftynet.layer.base_layer import Layer
  from niftynet.layer.layer_util import infer_spatial_rank
  from niftyreg_module_loader import get_niftyreg_module
label_desc: Use image node_id 1 for calling a global function with example usage: _transpose(data) and returns: tf