# encoding: utf-8
# module dipy.align.expectmax
# from C:\Users\xukai\Downloads\发票2\venv\Lib\site-packages\dipy\align\expectmax.cp311-win_amd64.pyd
# by generator 1.147
# no doc

# 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_em_demons_step_2d(*args, **kwargs): # real signature unknown
    """
    Demons step for EM metric in 2D
    
        Computes the demons step [Vercauteren09] for SSD-driven registration
        ( eq. 4 in [Vercauteren09] ) using the EM algorithm [Arce14] to handle
        multi-modality images.
    
        In this case, $\sigma_i$ in eq. 4 of [Vercauteren] is estimated using the EM
        algorithm, while in the original version of diffeomorphic demons it is
        estimated by the difference between the image values at each pixel.
    
        Parameters
        ----------
        delta_field : array, shape (R, C)
            contains, at each pixel, the difference between the moving image (warped
            under the current deformation s(. , .) ) J and the static image I:
            delta_field[i,j] = J(s(i,j)) - I(i,j). The order is important, changing
            to delta_field[i,j] = I(i,j) - J(s(i,j)) yields the backward demons step
            warping the static image towards the moving, which may not be the
            intended behavior unless the 'gradient_moving' passed corresponds to
            the gradient of the static image
        sigma_sq_field : array, shape (R, C)
            contains, at each pixel (i, j), the estimated variance (not std) of the
            hidden variable associated to the intensity at static[i,j] (which must
            have been previously quantized)
        gradient_moving : 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.[2]
        out : array, shape (R, C, 2)
            the resulting demons step will be written to this array
    
        Returns
        -------
        demons_step : array, shape (R, C, 2)
            the demons step to be applied for updating the current displacement
            field
        energy : float
            the current em energy (before applying the returned demons_step)
    
        References
        ----------
        [Arce14] Arce-santana, E., Campos-delgado, D. U., & Vigueras-g, F. (2014).
                 Non-rigid Multimodal Image Registration Based on the
                 Expectation-Maximization Algorithm, (168140), 36-47.
    
        [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_em_demons_step_3d(*args, **kwargs): # real signature unknown
    """
    Demons step for EM metric in 3D
    
        Computes the demons step [Vercauteren09] for SSD-driven registration
        ( eq. 4 in [Vercauteren09] ) using the EM algorithm [Arce14] to handle
        multi-modality images.
    
        In this case, $\sigma_i$ in eq. 4 of [Vercauteren09] is estimated using
        the EM algorithm, while in the original version of diffeomorphic demons
        it is estimated by the difference between the image values at each pixel.
    
        Parameters
        ----------
        delta_field : array, shape (S, R, C)
            contains, at each pixel, the difference between the moving image (warped
            under the current deformation s ) J and the static image I:
            delta_field[k,i,j] = J(s(k,i,j)) - I(k,i,j). The order is important,
            changing to delta_field[k,i,j] = I(k,i,j) - J(s(k,i,j)) yields the
            backward demons step warping the static image towards the moving, which
            may not be the intended behavior unless the 'gradient_moving' passed
            corresponds to the gradient of the static image
        sigma_sq_field : array, shape (S, R, C)
            contains, at each pixel (k, i, j), the estimated variance (not std) of
            the hidden variable associated to the intensity at static[k,i,j] (which
            must have been previously quantized)
        gradient_moving : 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.[2].
        out : array, shape (S, R, C, 2)
            the resulting demons step will be written to this array
    
        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 em energy (before applying the returned demons_step)
    
        References
        ----------
        [Arce14] Arce-santana, E., Campos-delgado, D. U., & Vigueras-g, F. (2014).
                 Non-rigid Multimodal Image Registration Based on the
                 Expectation-Maximization Algorithm, (168140), 36-47.
    
        [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_masked_class_stats_2d(*args, **kwargs): # real signature unknown
    """
    Computes the mean and std. for each quantization level.
    
        Computes the mean and standard deviation of the intensities in 'v' for
        each corresponding label in 'labels'. In other words, for each label
        L, it computes the mean and standard deviation of the intensities in 'v'
        at pixels whose label in 'labels' is L. This is used by the EM metric
        to compute statistics for each hidden variable represented by the labels.
    
        Parameters
        ----------
        mask : array, shape (R, C)
            the mask of pixels that will be taken into account for computing the
            statistics. All zero pixels in mask will be ignored
        v : array, shape (R, C)
            the image which the statistics will be computed from
        num_labels : int
            the number of different labels in 'labels' (equal to the
            number of hidden variables in the EM metric)
        labels : array, shape (R, C)
            the label assigned to each pixel
    
        Returns
        -------
        means : array, shape (num_labels,)
            means[i], 0<=i<num_labels will be the mean intensity in v of all
            voxels labeled i, or 0 if no voxels are labeled i
        variances : array, shape (num_labels,)
            variances[i], 0<=i<num_labels will be the standard deviation of the
            intensities in v of all voxels labeled i, or infinite if less than 2
            voxels are labeled i.
    """
    pass

def compute_masked_class_stats_3d(*args, **kwargs): # real signature unknown
    """
    Computes the mean and std. for each quantization level.
    
        Computes the mean and standard deviation of the intensities in 'v' for
        each corresponding label in 'labels'. In other words, for each label
        L, it computes the mean and standard deviation of the intensities in 'v'
        at voxels whose label in 'labels' is L. This is used by the EM metric
        to compute statistics for each hidden variable represented by the labels.
    
        Parameters
        ----------
        mask : array, shape (S, R, C)
            the mask of voxels that will be taken into account for computing the
            statistics. All zero voxels in mask will be ignored
        v : array, shape (S, R, C)
            the volume which the statistics will be computed from
        num_labels : int
            the number of different labels in 'labels' (equal to the
            number of hidden variables in the EM metric)
        labels : array, shape (S, R, C)
            the label assigned to each pixel
    
        Returns
        -------
        means : array, shape (num_labels,)
            means[i], 0<=i<num_labels will be the mean intensity in v of all
            voxels labeled i, or 0 if no voxels are labeled i
        variances : array, shape (num_labels,)
            variances[i], 0<=i<num_labels will be the standard deviation of the
            intensities in v of all voxels labeled i, or infinite if less than 2
            voxels are labeled i.
    """
    pass

def quantize_positive_2d(*args, **kwargs): # real signature unknown
    """
    Quantizes a 2D image to num_levels quantization levels
    
        Quantizes the input image at num_levels intensity levels considering <=0
        as a special value. Those input pixels <=0, and only those, will be
        assigned a quantization level of 0. The positive values are divided into
        the remaining num_levels-1 uniform quantization levels.
    
        The following are undefined, and raise a ValueError:
        * Quantizing at zero levels because at least one level must be assigned
        * Quantizing at one level because positive values should be assigned a
          level different from the secial level 0 (at least 2 levels are needed)
    
        Parameters
        ----------
        v : array, shape (R, C)
            the image to be quantized
        num_levels : int
            the number of levels
    
        Returns
        -------
        out : array, shape (R, C), same shape as v
            the quantized image
        levels: array, shape (num_levels,)
            the quantization values: levels[0]=0, and levels[i] is the mid-point
            of the interval of intensities that are assigned to quantization
            level i, i=1, ..., num_levels-1.
        hist: array, shape (num_levels,)
            histogram: the number of pixels that were assigned to each quantization
            level
    """
    pass

def quantize_positive_3d(*args, **kwargs): # real signature unknown
    """
    Quantizes a 3D volume to num_levels quantization levels
    
        Quantizes the input volume at num_levels intensity levels considering <=0
        as a special value. Those input voxels <=0, and only those, will be
        assigned a quantization level of 0. The positive values are divided into
        the remaining num_levels-1 uniform quantization levels.
    
        The following are undefined, and raise a ValueError:
        * Quantizing at zero levels because at least one level must be assigned
        * Quantizing at one level because positive values should be assigned a
          level different from the secial level 0 (at least 2 levels are needed)
    
        Parameters
        ----------
        v : array, shape (S, R, C)
            the volume to be quantized
        num_levels : int
            the number of levels
    
        Returns
        -------
        out : array, shape (S, R, C), same shape as v
            the quantized volume
        levels: array, shape (num_levels,)
            the quantization values: levels[0]=0, and levels[i] is the mid-point
            of the interval of intensities that are assigned to quantization
            level i, i=1, ..., num_levels-1.
        hist: array, shape (num_levels,)
            histogram: the number of voxels that were assigned to each quantization
            level
    """
    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 0x000001C3555E7790>'

__spec__ = None # (!) real value is "ModuleSpec(name='dipy.align.expectmax', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x000001C3555E7790>, origin='C:\\\\Users\\\\xukai\\\\Downloads\\\\??2\\\\venv\\\\Lib\\\\site-packages\\\\dipy\\\\align\\\\expectmax.cp311-win_amd64.pyd')"

__test__ = {}

