# encoding: utf-8
# module dipy.align.sumsqdiff
# from C:\Users\xukai\Downloads\发票2\venv\Lib\site-packages\dipy\align\sumsqdiff.cp311-win_amd64.pyd
# by generator 1.147
""" Utility functions used by the Sum of Squared Differences (SSD) metric """

# imports
import builtins as __builtins__ # <module 'builtins' (built-in)>
import numpy as np # C:\Users\xukai\Downloads\发票2\venv\Lib\site-packages\numpy\__init__.py

# functions

def compute_energy_ssd_2d(*args, **kwargs): # real signature unknown
    """
    Sum of squared differences between two 2D images
    
        Computes the Sum of Squared Differences between the static and moving image.
        Those differences are given by delta_field
    
        Parameters
        ----------
        delta_field : array, shape (R, C)
            the difference between the static and moving image (the 'derivative
            w.r.t. time' in the optical flow model)
    
        Returns
        -------
        energy : float
            the SSD energy at this iteration
    
        Notes
        -----
        The numeric value of the energy is used only to detect convergence.
        This function returns only the energy corresponding to the data term
        (excluding the energy corresponding to the regularization term) because
        the Greedy-SyN algorithm is an unconstrained gradient descent algorithm
        in the space of diffeomorphisms: in each iteration it makes a step
        along the negative smoothed gradient --of the data term-- and then makes
        sure the resulting diffeomorphisms are invertible using an explicit
        inversion algorithm. Since it is not clear how to reflect the energy
        corresponding to this re-projection to the space of diffeomorphisms,
        a more precise energy computation including the regularization term
        is useless. Instead, convergence is checked considering the data-term
        energy only and detecting oscilations in the energy profile.
    """
    pass

def compute_energy_ssd_3d(*args, **kwargs): # real signature unknown
    """
    Sum of squared differences between two 3D volumes
    
        Computes the Sum of Squared Differences between the static and moving volume
        Those differences are given by delta_field
    
        Parameters
        ----------
        delta_field : array, shape (R, C)
            the difference between the static and moving image (the 'derivative
            w.r.t. time' in the optical flow model)
    
        Returns
        -------
        energy : float
            the SSD energy at this iteration
    
        Notes
        -----
        The numeric value of the energy is used only to detect convergence.
        This function returns only the energy corresponding to the data term
        (excluding the energy corresponding to the regularization term) because
        the Greedy-SyN algorithm is an unconstrained gradient descent algorithm
        in the space of diffeomorphisms: in each iteration it makes a step
        along the negative smoothed gradient --of the data term-- and then makes
        sure the resulting diffeomorphisms are invertible using an explicit
        inversion algorithm. Since it is not clear how to reflect the energy
        corresponding to this re-projection to the space of diffeomorphisms,
        a more precise energy computation including the regularization term
        is useless. Instead, convergence is checked considering the data-term
        energy only and detecting oscilations in the energy profile.
    """
    pass

def compute_residual_displacement_field_ssd_2d(*args, **kwargs): # real signature unknown
    """
    The residual displacement field to be fit on the next iteration
    
        Computes the residual displacement field corresponding to the current
        displacement field in the Multi-resolution Gauss-Seidel solver proposed by
        Bruhn and Weickert [Bruhn05].
    
        Parameters
        ----------
        delta_field : array, shape (R, C)
            the difference between the static and moving image (the 'derivative
            w.r.t. time' in the optical flow model)
        sigmasq_field : array, shape (R, C)
            the variance of the gray level value at each voxel, according to the
            EM model (for SSD, it is 1 for all voxels). Inf and 0 values
            are processed specially to support infinite and zero variance.
        gradient_field : array, shape (R, C, 2)
            the gradient of the moving image
        target : array, shape (R, C, 2)
            right-hand side of the linear system to be solved in the Weickert's
            multi-resolution algorithm
        lambda_param : float
            smoothness parameter in the objective function
        d : array, shape (R, C, 2)
            the current displacement field to compute the residual from
        residual : array, shape (R, C, 2)
            the displacement field to put the residual to
    
        Returns
        -------
        residual : array, shape (R, C, 2)
            the residual displacement field. If residual was None a input, then
            a new field is returned, otherwise the same array is returned
    
        References
        ----------
        [Bruhn05] Andres Bruhn and Joachim Weickert, "Towards ultimate motion
                  estimation: combining highest accuracy with real-time
                  performance", 10th IEEE International Conference on Computer
                  Vision, 2005. ICCV 2005.
    """
    pass

def compute_residual_displacement_field_ssd_3d(*args, **kwargs): # real signature unknown
    """
    The residual displacement field to be fit on the next iteration
    
        Computes the residual displacement field corresponding to the current
        displacement field (given by 'disp') in the Multi-resolution
        Gauss-Seidel solver proposed by Bruhn and Weickert [Bruhn].
    
        Parameters
        ----------
        delta_field : array, shape (S, R, C)
            the difference between the static and moving image (the 'derivative
            w.r.t. time' in the optical flow model)
        sigmasq_field : array, shape (S, R, C)
            the variance of the gray level value at each voxel, according to the
            EM model (for SSD, it is 1 for all voxels). Inf and 0 values
            are processed specially to support infinite and zero variance.
        gradient_field : array, shape (S, R, C, 3)
            the gradient of the moving image
        target : array, shape (S, R, C, 3)
            right-hand side of the linear system to be solved in the Weickert's
            multi-resolution algorithm
        lambda_param : float
            smoothness parameter in the objective function
        disp : array, shape (S, R, C, 3)
            the current displacement field to compute the residual from
        residual : array, shape (S, R, C, 3)
            the displacement field to put the residual to
    
        Returns
        -------
        residual : array, shape (S, R, C, 3)
            the residual displacement field. If residual was None a input, then
            a new field is returned, otherwise the same array is returned
    
        References
        ----------
        [Bruhn05] Andres Bruhn and Joachim Weickert, "Towards ultimate motion
                  estimation: combining highest accuracy with real-time
                  performance", 10th IEEE International Conference on Computer
                  Vision, 2005. ICCV 2005.
    """
    pass

def compute_ssd_demons_step_2d(*args, **kwargs): # real signature unknown
    """
    Demons step for 2D SSD-driven registration
    
        Computes the demons step for SSD-driven registration
        ( eq. 4 in [Bruhn05] )
    
        Parameters
        ----------
        delta_field : array, shape (R, C)
            the difference between the static and moving image (the 'derivative
            w.r.t. time' in the optical flow model)
        gradient_field : array, shape (R, C, 2)
            the gradient of the moving image
        sigma_sq_x : float
            parameter controlling the amount of regularization. It corresponds to
            $\sigma_x^2$ in algorithm 1 of Vercauteren et al.[Vercauteren09]
        out : array, shape (R, C, 2)
            if None, a new array will be created to store the demons step. Otherwise
            the provided array will be used.
    
        Returns
        -------
        demons_step : array, shape (R, C, 2)
            the demons step to be applied for updating the current displacement
            field
        energy : float
            the current ssd energy (before applying the returned demons_step)
    
        References
        ----------
        [Bruhn05] Andres Bruhn and Joachim Weickert, "Towards ultimate motion
                  estimation: combining highest accuracy with real-time
                  performance", 10th IEEE International Conference on Computer
                  Vision, 2005. ICCV 2005.
        [Vercauteren09] Vercauteren, T., Pennec, X., Perchant, A., & Ayache, N.
                        (2009). Diffeomorphic demons: efficient non-parametric
                        image registration. NeuroImage, 45(1 Suppl), S61-72.
                        doi:10.1016/j.neuroimage.2008.10.040
    """
    pass

def compute_ssd_demons_step_3d(*args, **kwargs): # real signature unknown
    """
    Demons step for 3D SSD-driven registration
    
        Computes the demons step for SSD-driven registration
        ( eq. 4 in [Bruhn05] )
    
        Parameters
        ----------
        delta_field : array, shape (S, R, C)
            the difference between the static and moving image (the 'derivative
            w.r.t. time' in the optical flow model)
        gradient_field : array, shape (S, R, C, 2)
            the gradient of the moving image
        sigma_sq_x : float
            parameter controlling the amount of regularization. It corresponds to
            $\sigma_x^2$ in algorithm 1 of Vercauteren et al.[Vercauteren09]
        out : array, shape (S, R, C, 2)
            if None, a new array will be created to store the demons step. Otherwise
            the provided array will be used.
    
        Returns
        -------
        demons_step : array, shape (S, R, C, 3)
            the demons step to be applied for updating the current displacement
            field
        energy : float
            the current ssd energy (before applying the returned demons_step)
    
        References
        ----------
        [Bruhn05] Andres Bruhn and Joachim Weickert, "Towards ultimate motion
                  estimation: combining highest accuracy with real-time
                  performance", 10th IEEE International Conference on Computer
                  Vision, 2005. ICCV 2005.
        [Vercauteren09] Vercauteren, T., Pennec, X., Perchant, A., & Ayache, N.
                        (2009). Diffeomorphic demons: efficient non-parametric
                        image registration. NeuroImage, 45(1 Suppl), S61-72.
                        doi:10.1016/j.neuroimage.2008.10.040
    """
    pass

def iterate_residual_displacement_field_ssd_2d(*args, **kwargs): # real signature unknown
    """
    One iteration of a large linear system solver for 2D SSD registration
    
        Performs one iteration at one level of the Multi-resolution Gauss-Seidel
        solver proposed by Bruhn and Weickert [Bruhn05].
    
        Parameters
        ----------
        delta_field : array, shape (R, C)
            the difference between the static and moving image (the 'derivative
            w.r.t. time' in the optical flow model)
        sigmasq_field : array, shape (R, C)
            the variance of the gray level value at each voxel, according to the
            EM model (for SSD, it is 1 for all voxels). Inf and 0 values
            are processed specially to support infinite and zero variance.
        grad : array, shape (R, C, 2)
            the gradient of the moving image
        target : array, shape (R, C, 2)
            right-hand side of the linear system to be solved in the Weickert's
            multi-resolution algorithm
        lambda_param : float
            smoothness parameter of the objective function
        displacement_field : array, shape (R, C, 2)
            current displacement field to start the iteration from
    
        Returns
        -------
        max_displacement : float
            the norm of the maximum change in the displacement field after the
            iteration
    
        References
        ----------
        [Bruhn05] Andres Bruhn and Joachim Weickert, "Towards ultimate motion
                  estimation: combining highest accuracy with real-time
                  performance", 10th IEEE International Conference on Computer
                  Vision, 2005. ICCV 2005.
    """
    pass

def iterate_residual_displacement_field_ssd_3d(*args, **kwargs): # real signature unknown
    """
    One iteration of a large linear system solver for 3D SSD registration
    
        Performs one iteration at one level of the Multi-resolution Gauss-Seidel
        solver proposed by Bruhn and Weickert [Bruhn05].
    
        Parameters
        ----------
        delta_field : array, shape (S, R, C)
            the difference between the static and moving image (the 'derivative
            w.r.t. time' in the optical flow model)
        sigmasq_field : array, shape (S, R, C)
            the variance of the gray level value at each voxel, according to the
            EM model (for SSD, it is 1 for all voxels). Inf and 0 values
            are processed specially to support infinite and zero variance.
        grad : array, shape (S, R, C, 3)
            the gradient of the moving image
        target : array, shape (S, R, C, 3)
            right-hand side of the linear system to be solved in the Weickert's
            multi-resolution algorithm
        lambda_param : float
            smoothness parameter of the objective function
        disp : array, shape (S, R, C, 3)
            the displacement field to start the optimization from
    
        Returns
        -------
        max_displacement : float
            the norm of the maximum change in the displacement field after the
            iteration
    
        References
        ----------
        [Bruhn05] Andres Bruhn and Joachim Weickert, "Towards ultimate motion
                  estimation: combining highest accuracy with real-time
                  performance", 10th IEEE International Conference on Computer
                  Vision, 2005. ICCV 2005.
    """
    pass

def solve_2d_symmetric_positive_definite(*args, **kwargs): # real signature unknown
    """
    Solves a 2-variable symmetric positive-definite linear system
    
        Solves the symmetric positive-definite linear system $Mx = y$ given by::
    
            M = [[A[0], A[1]],
                 [A[1], A[2]]]
    
        Parameters
        ----------
        A : array, shape (3,)
            the array containing the entries of the symmetric 2x2 matrix
        y : array, shape (2,)
            right-hand side of the system to be solved
    
        Returns
        -------
        out : array, shape (2,)
            the array the output will be stored in
    """
    pass

def solve_3d_symmetric_positive_definite(*args, **kwargs): # real signature unknown
    """
    Solves a 3-variable symmetric positive-definite linear system
    
        Solves the symmetric semi-positive-definite linear system $Mx = y$ given by
        $M = (g g^{T} + \tau I)$.
    
        Parameters
        ----------
        g : array, shape (3,)
            the vector in the outer product above
        y : array, shape (3,)
            right-hand side of the system to be solved
        tau : double
            $\tau$ in $M = (g g^{T} + \tau I)$
    
        Returns
        -------
        out : array, shape (3,)
            the array the output will be stored in
        is_singular : int
            1 if M is singular, otherwise 0
    """
    pass

def __pyx_unpickle_Enum(*args, **kwargs): # real signature unknown
    pass

# no classes
# variables with complex values

__loader__ = None # (!) real value is '<_frozen_importlib_external.ExtensionFileLoader object at 0x000002117FD7B290>'

__spec__ = None # (!) real value is "ModuleSpec(name='dipy.align.sumsqdiff', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x000002117FD7B290>, origin='C:\\\\Users\\\\xukai\\\\Downloads\\\\??2\\\\venv\\\\Lib\\\\site-packages\\\\dipy\\\\align\\\\sumsqdiff.cp311-win_amd64.pyd')"

__test__ = {}

