dbdicom.extensions.vreg.find_sbs_rigid_transformation#
- dbdicom.extensions.vreg.find_sbs_rigid_transformation(moving: Series, static: Series, tolerance=0.1, metric='mutual information', region: Series | None = None, margin: float = 0, moving_mask: Series | None = None, static_mask: Series | None = None, resolutions=[4, 2, 1]) ndarray [source]#
Find the slice-by-slice rigid transformation that maps a moving volume onto a static volume.
- Parameters:
moving (dbdicom.Series) – Series with the moving volume.
static (dbdicom.Series) – Series with the static volume
tolerance (float, optional) – Positive tolerance parameter to decide convergence of the gradient descent. A smaller value means a more accurate solution but also a lomger computation time. Defaults to 0.1.
metric (str, option) – Determines which metric to use in the optimization. Current options are ‘mutual information’ (default) or ‘sum of squares’.
region (dbdicom.Series, optional) – Series with region of interest to restrict the alignment. The translation will be chosen based on the goodness of the alignment in the bounding box of this region. If none is provided, the entire volume is used. Defaults to None.
margin (float, optional) – in case a region is provided, this specifies a margin (in mm) to take around the region. Default is 0 (no margin).
moving_mask (dbdicom.Series) – Series for masking the moving volume.
static_mask (dbdicom.Series) – Series for masking the static volume.
- Returns:
list of 6-element numpy arrays with values of the translation (first 3 elements) and rotation vector (last 3 elements) that map the moving volume on to the static volume. The list contains one entry per slice, ordered by slice location. The vectors are defined in an absolute reference frame in units of mm.
- Return type:
np.ndarray