class_docstr: The Extraction Block used in RegUNet.
  Extracts feature from each ``extract_levels`` and takes the average.
class_docstr_tok: ["The","Extraction","Block","used","in","RegUNet",".","Extracts","feature","from","each","``","extract_levels","``","and","takes","the","average","."]
docstr: Args:
      spatial_dims: number of spatial dimensions
      extract_levels: spatial levels to extract feature from, 0 refers to the input scale
      num_channels: number of channels at each scale level,
          List or Tuple of length equals to `depth` of the RegNet
      out_channels: number of output channels
      kernel_initializer: kernel initializer
      activation: kernel activation function
      mode: feature map interpolation mode, default to "nearest".
      align_corners: whether to align corners for feature map interpolation.
docstr_tok: ["Args",":","spatial_dims",":","number","of","spatial","dimensions","extract_levels",":","spatial","levels","to","extract","feature","from",",","0","refers","to","the","input","scale","num_channels",":","number","of","channels","at","each","scale","level",",","List","or","Tuple","of","length","equals","to","`","depth","`","of","the","RegNet","out_channels",":","number","of","output","channels","kernel_initializer",":","kernel","initializer","activation",":","kernel","activation","function","mode",":","feature","map","interpolation","mode",",","default","to","``","nearest","''",".","align_corners",":","whether","to","align","corners","for","feature","map","interpolation","."]
code: def __init__(
      self,
      spatial_dims: int,
      extract_levels: tuple[int],
      num_channels: tuple[int] | list[int],
      out_channels: int,
      kernel_initializer: str | None = "kaiming_uniform",
      activation: str | None = None,
      mode: str = "nearest",
      align_corners: bool | None = None,
  ):
      """
  
      Args:
          spatial_dims: number of spatial dimensions
          extract_levels: spatial levels to extract feature from, 0 refers to the input scale
          num_channels: number of channels at each scale level,
              List or Tuple of length equals to `depth` of the RegNet
          out_channels: number of output channels
          kernel_initializer: kernel initializer
          activation: kernel activation function
          mode: feature map interpolation mode, default to "nearest".
          align_corners: whether to align corners for feature map interpolation.
      """
      super().__init__()
      self.extract_levels = extract_levels
      self.max_level = max(extract_levels)
      self.layers = nn.ModuleList(
          [
              get_conv_block(
                  spatial_dims=spatial_dims,
                  in_channels=num_channels[d],
                  out_channels=out_channels,
                  norm=None,
                  act=activation,
                  initializer=kernel_initializer,
              )
              for d in extract_levels
          ]
      )
      self.mode = mode
      self.align_corners = align_corners
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  from torch import nn
  from torch.nn import functional
  from monai.networks.blocks import Convolution
  from monai.networks.layers import Conv, Norm, Pool, same_padding
label_desc: Use image node_id 1 to create a new RegistrationExtractionBlock object from inherited base classes: nn with example: obj = RegistrationExtractionBlock(spatial_dims, extract_levels, num_channels, out_channels, kernel_initializer, activation, mode, align_corners)