class_docstr: ### Description
  reimplementation of DeepMedic:
      Kamnitsas et al., "Efficient multi-scale 3D CNN with fully connected
      CRF for accurate brain lesion segmentation", MedIA '17
  
  ### Building blocks
  [CONV]          - 3x3x3 convolutional layer
  [denseCONV]     - 1x1x1 convolutional layer
  
  ### Diagram
  INPUT --> CROP -------> [CONV]x8 ------> [SUM] ----> [denseCONV]x3 --> OUTPUT
              |                             |
          DOWNSAMPLE ---> [CONV]x8 ---> UPSAMPLE
  
  
  ### Constraints:
  - The downsampling factor (d_factor) should be odd
  - Label size = [(image_size / d_factor) - 16]* d_factor
  - Image size should be divisible by d_factor
  
  # Examples:
  - Appropriate configuration for training:
  image spatial window size = 57, label spatial window size = 9, d_ factor = 3
  - Appropriate configuration for inference:
  image spatial window size = 105, label spatial window size = 57, d_ factor = 3
docstr: :param num_classes: int, number of channels of output
  :param w_initializer: weight initialisation for network
  :param w_regularizer: weight regularisation for network
  :param b_initializer: bias initialisation for network
  :param b_regularizer: bias regularisation for network
  :param acti_func: activation function to use
  :param name: layer name
code: def __init__(
      self,
      num_classes,
      w_initializer=None,
      w_regularizer=None,
      b_initializer=None,
      b_regularizer=None,
      acti_func="prelu",
      name="DeepMedic",
  ):
      """
  
      :param num_classes: int, number of channels of output
      :param w_initializer: weight initialisation for network
      :param w_regularizer: weight regularisation for network
      :param b_initializer: bias initialisation for network
      :param b_regularizer: bias regularisation for network
      :param acti_func: activation function to use
      :param name: layer name
      """
  
      super(DeepMedic, self).__init__(
          num_classes=num_classes,
          w_initializer=w_initializer,
          w_regularizer=w_regularizer,
          b_initializer=b_initializer,
          b_regularizer=b_regularizer,
          acti_func=acti_func,
          name=name,
      )
  
      self.d_factor = 3  # downsampling factor - should be odd
      self.crop_diff = ((self.d_factor - 1) * 16) // 2
      self.conv_features = [30, 30, 40, 40, 40, 40, 50, 50]
      self.fc_features = [150, 150, num_classes]
  
file_path: NiftyNet/niftynet/network/deepmedic.py
imports: from __future__ import absolute_import, print_function
  from niftynet.layer import layer_util
  from niftynet.layer.convolution import ConvolutionalLayer
  from niftynet.layer.crop import CropLayer
  from niftynet.layer.downsample import DownSampleLayer
  from niftynet.layer.elementwise import ElementwiseLayer
  from niftynet.layer.upsample import UpSampleLayer
  from niftynet.network.base_net import BaseNet
label_desc: Use image node_id 1 to create a new DeepMedic object from inherited base classes: BaseNet with example: obj = DeepMedic(num_classes, w_initializer, w_regularizer, b_initializer, b_regularizer, acti_func, name)