class_docstr: ### Description
  Re-implementation of the registration network proposed in:
  
          Hu et al., Label-driven weakly-supervised learning for
          multimodal deformable image registration, arXiv:1711.01666
          https://arxiv.org/abs/1711.01666
  
          Hu et al., Weakly-Supervised Convolutional Neural Networks for
          Multimodal Image Registration, Medical Image Analysis (2018)
          https://doi.org/10.1016/j.media.2018.07.002
  
      see also:
          https://github.com/YipengHu/label-reg
  
  ### Building blocks
  [GLOBAL]            - INetAffine from interventional_affine_net.py
  [DENSE]             - INetDense from intervetional_dense_net.py
  
  ### Diagram
  
  INPUT PAIR --> [GLOBAL] --> AFFINE FIELD --- DENSE + AFFINE FIELD
       |                                       |
        -------> [DENSE] --> DENSE FIELD ------
  
  ### Constraints
      - input spatial rank should be either 2 or 3 (2D or 3D images only)
      - fixed image size should be divisible by 16
class_docstr_tok: ["#","#","#","Description","Re-implementation","of","the","registration","network","proposed","in",":","Hu","et","al.",",","Label-driven","weakly-supervised","learning","for","multimodal","deformable","image","registration",",","arXiv:1711.01666","https",":","\/\/arxiv.org\/abs\/1711.01666","Hu","et","al.",",","Weakly-Supervised","Convolutional","Neural","Networks","for","Multimodal","Image","Registration",",","Medical","Image","Analysis","(","2018",")","https",":","\/\/doi.org\/10.1016\/j.media.2018.07.002","see","also",":","https",":","\/\/github.com\/YipengHu\/label-reg","#","#","#","Building","blocks","[","GLOBAL","]","-","INetAffine","from","interventional_affine_net.py","[","DENSE","]","-","INetDense","from","intervetional_dense_net.py","#","#","#","Diagram","INPUT","PAIR","--",">","[","GLOBAL","]","--",">","AFFINE","FIELD","--","-","DENSE","+","AFFINE","FIELD","|","|","--","--","--","-",">","[","DENSE","]","--",">","DENSE","FIELD","--","--","--","#","#","#","Constraints","-","input","spatial","rank","should","be","either","2","or","3","(","2D","or","3D","images","only",")","-","fixed","image","size","should","be","divisible","by","16"]
docstr: :param fixed_image: tensor, fixed image for registration (defines reference space)
  :param moving_image: tensor, moving image to be registered to fixed
  :param is_training: boolean, True if network is in training mode
  :param unused_kwargs: not in use
  :return: estimated total, dense and affine displacement fields
docstr_tok: [":","param","fixed_image",":","tensor",",","fixed","image","for","registration","(","defines","reference","space",")",":","param","moving_image",":","tensor",",","moving","image","to","be","registered","to","fixed",":","param","is_training",":","boolean",",","True","if","network","is","in","training","mode",":","param","unused_kwargs",":","not","in","use",":","return",":","estimated","total",",","dense","and","affine","displacement","fields"]
code: def layer_op(
      self, fixed_image, moving_image, is_training=True, **unused_kwargs
  ):
      """
  
      :param fixed_image: tensor, fixed image for registration (defines reference space)
      :param moving_image: tensor, moving image to be registered to fixed
      :param is_training: boolean, True if network is in training mode
      :param unused_kwargs: not in use
      :return: estimated total, dense and affine displacement fields
      """
      affine_field = self.global_net(
          fixed_image, moving_image, is_training
      )
      dense_field = self.local_net(
          fixed_image, moving_image, is_training
      )
      return dense_field + affine_field, dense_field, affine_field
  
file_path: NiftyNet/niftynet/network/interventional_hybrid_net.py
imports: from __future__ import absolute_import, print_function
  from niftynet.layer.resampler import ResamplerLayer
  from niftynet.network.base_net import BaseNet
  from niftynet.network.interventional_affine_net import INetAffine
  from niftynet.network.interventional_dense_net import INetDense
label_desc: Use image node_id 2 for calling the INetHybridTwoStream obj's underlying member method code with example usage: obj.layer_op(fixed_image, moving_image, is_training) and returns: unknown,  dense_field,  affine_field