# encoding: utf-8
# module dipy.segment.mrf
# from C:\Users\xukai\Downloads\发票2\venv\Lib\site-packages\dipy\segment\mrf.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 __pyx_unpickle_Enum(*args, **kwargs): # real signature unknown
    pass

# classes

class ConstantObservationModel(object):
    """
    Observation model assuming that the intensity of each class is constant.
        The model parameters are the means $\mu_{k}$ and variances $\sigma_{k}$
        associated with each tissue class. According to this model, the observed
        intensity at voxel $x$ is given by $I(x) = \mu_{k} + \eta_{k}$ where $k$
        is the tissue class of voxel $x$, and $\eta_{k}$ is a Gaussian random
        variable with zero mean and variance $\sigma_{k}^{2}$. The observation
        model is responsible for computing the negative log-likelihood of
        observing any given intensity $z$ at each voxel $x$ assuming the voxel
        belongs to each class $k$. It also provides a default parameter
        initialization.
    """
    def initialize_param_uniform(self, *args, **kwargs): # real signature unknown
        """
        Initializes the means and variances uniformly
        
                The means are initialized uniformly along the dynamic range of
                `image`. The variances are set to 1 for all classes
        
                Parameters
                ----------
                image : array
                    3D structural image
                nclasses : int
                    number of desired classes
        
                Returns
                -------
                mu : array
                    1 x nclasses, mean for each class
                sigma : array
                    1 x nclasses, standard deviation for each class.
                    Set up to 1.0 for all classes.
        """
        pass

    def negloglikelihood(self, *args, **kwargs): # real signature unknown
        """
        Computes the gaussian negative log-likelihood of each class at
                each voxel of `image` assuming a gaussian distribution with means and
                variances given by `mu` and `sigmasq`, respectively (constant models
                along the full volume). The negative log-likelihood will be written
                in `nloglike`.
        
                Parameters
                ----------
                image : ndarray
                    3D gray scale structural image
                mu : ndarray
                    mean of each class
                sigmasq : ndarray
                    variance of each class
                nclasses : int
                    number of classes
        
                Returns
                -------
                nloglike : ndarray
                    4D negloglikelihood for each class in each volume
        """
        pass

    def prob_image(self, *args, **kwargs): # real signature unknown
        """
        Conditional probability of the label given the image
        
                Parameters
                ----------
                img : ndarray
                    3D structural gray-scale image
                nclasses : int
                    number of tissue classes
                mu : ndarray
                    1 x nclasses, current estimate of the mean of each tissue class
                sigmasq : ndarray
                    1 x nclasses, current estimate of the variance of each
                    tissue class
                P_L_N : ndarray
                    4D probability map of the label given the neighborhood.
        
                Previously computed by function prob_neighborhood
        
                Returns
                -------
                P_L_Y : ndarray
                    4D probability of the label given the input image
        """
        pass

    def seg_stats(self, *args, **kwargs): # real signature unknown
        """
        Mean and standard variation for N desired  tissue classes
        
                Parameters
                ----------
                input_image : ndarray
                    3D structural image
                seg_image : ndarray
                    3D segmented image
                nclass : int
                    number of classes (3 in most cases)
        
                Returns
                -------
                mu, var : ndarrays
                    1 x nclasses dimension
                    Mean and variance for each class
        """
        pass

    def update_param(self, *args, **kwargs): # real signature unknown
        """
        Updates the means and the variances in each iteration for all
                the labels. This is for equations 25 and 26 of Zhang et. al.,
                IEEE Trans. Med. Imag, Vol. 20, No. 1, Jan 2001.
        
                Parameters
                ----------
                image : ndarray
                    3D structural gray-scale image
                P_L_Y : ndarray
                    4D probability map of the label given the input image
                    computed by the expectation maximization (EM) algorithm
                mu : ndarray
                    1 x nclasses, current estimate of the mean of each tissue
                    class.
                nclasses : int
                    number of tissue classes
        
                Returns
                -------
                mu_upd : ndarray
                        1 x nclasses, updated mean of each tissue class
                var_upd : ndarray
                        1 x nclasses, updated variance of each tissue class
        """
        pass

    def __init__(self, *args, **kwargs): # real signature unknown
        """ Initializes an instance of the ConstantObservationModel class """
        pass

    __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
    """list of weak references to the object (if defined)"""


    __dict__ = None # (!) real value is "mappingproxy({'__module__': 'dipy.segment.mrf', '__doc__': '\\n    Observation model assuming that the intensity of each class is constant.\\n    The model parameters are the means $\\\\mu_{k}$ and variances $\\\\sigma_{k}$\\n    associated with each tissue class. According to this model, the observed\\n    intensity at voxel $x$ is given by $I(x) = \\\\mu_{k} + \\\\eta_{k}$ where $k$\\n    is the tissue class of voxel $x$, and $\\\\eta_{k}$ is a Gaussian random\\n    variable with zero mean and variance $\\\\sigma_{k}^{2}$. The observation\\n    model is responsible for computing the negative log-likelihood of\\n    observing any given intensity $z$ at each voxel $x$ assuming the voxel\\n    belongs to each class $k$. It also provides a default parameter\\n    initialization.\\n    ', '__init__': <cyfunction ConstantObservationModel.__init__ at 0x0000022DA1B8CC70>, 'initialize_param_uniform': <cyfunction ConstantObservationModel.initialize_param_uniform at 0x0000022DA1B8CD40>, 'seg_stats': <cyfunction ConstantObservationModel.seg_stats at 0x0000022DA1B8DF20>, 'negloglikelihood': <cyfunction ConstantObservationModel.negloglikelihood at 0x0000022DA1B8E0C0>, 'prob_image': <cyfunction ConstantObservationModel.prob_image at 0x0000022DA1B8E190>, 'update_param': <cyfunction ConstantObservationModel.update_param at 0x0000022DA1B8E260>, '__dict__': <attribute '__dict__' of 'ConstantObservationModel' objects>, '__weakref__': <attribute '__weakref__' of 'ConstantObservationModel' objects>})"


class IteratedConditionalModes(object):
    # no doc
    def icm_ising(self, *args, **kwargs): # real signature unknown
        """
        Executes one iteration of the ICM algorithm for MRF MAP
                estimation. The prior distribution of the MRF is a Gibbs
                distribution with the Potts/Ising model with parameter `beta`:
        
                https://en.wikipedia.org/wiki/Potts_model
        
                Parameters
                ----------
                nloglike : ndarray
                    4D shape, nloglike[x, y, z, k] is the negative log likelihood
                    of class k at voxel (x, y, z)
                beta : float
                    positive scalar, it is the parameter of the Potts/Ising
                    model. Determines the smoothness of the output segmentation.
                seg : ndarray
                    3D initial segmentation. This segmentation will change by one
                    iteration of the ICM algorithm
        
                Returns
                -------
                new_seg : ndarray
                    3D final segmentation
                energy : ndarray
                    3D final energy
        """
        pass

    def initialize_maximum_likelihood(self, *args, **kwargs): # real signature unknown
        """
        Initializes the segmentation of an image with given
                    neg-loglikelihood
        
                Initializes the segmentation of an image with neglog-likelihood field
                given by `nloglike`. The class of each voxel is selected as the one
                with the minimum neglog-likelihood (i.e. maximum-likelihood
                segmentation).
        
                Parameters
                ----------
                nloglike : ndarray
                    4D shape, nloglike[x, y, z, k] is the likelihhood of class k
                    for voxel (x, y, z)
        
                Returns
                -------
                seg : ndarray
                    3D initial segmentation
        """
        pass

    def prob_neighborhood(self, *args, **kwargs): # real signature unknown
        """
        Conditional probability of the label given the neighborhood
                Equation 2.18 of the Stan Z. Li book (Stan Z. Li, Markov Random Field
                Modeling in Image Analysis, 3rd ed., Advances in Pattern Recognition
                Series, Springer Verlag 2009.)
        
                Parameters
                ----------
                seg : ndarray
                    3D tissue segmentation derived from the ICM model
                beta : float
                    scalar that determines the importance of the neighborhood and
                    the spatial smoothness of the segmentation.
                    Usually between 0 to 0.5
                nclasses : int
                    number of tissue classes
        
                Returns
                -------
                PLN : ndarray
                    4D probability map of the label given the neighborhood of the
                    voxel.
        """
        pass

    def __init__(self, *args, **kwargs): # real signature unknown
        pass

    __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
    """list of weak references to the object (if defined)"""


    __dict__ = None # (!) real value is "mappingproxy({'__module__': 'dipy.segment.mrf', '__init__': <cyfunction IteratedConditionalModes.__init__ at 0x0000022DA1B8DFF0>, 'initialize_maximum_likelihood': <cyfunction IteratedConditionalModes.initialize_maximum_likelihood at 0x0000022DA1B8E330>, 'icm_ising': <cyfunction IteratedConditionalModes.icm_ising at 0x0000022DA1B8E400>, 'prob_neighborhood': <cyfunction IteratedConditionalModes.prob_neighborhood at 0x0000022DA1B8E4D0>, '__dict__': <attribute '__dict__' of 'IteratedConditionalModes' objects>, '__weakref__': <attribute '__weakref__' of 'IteratedConditionalModes' objects>, '__doc__': None})"


# variables with complex values

__loader__ = None # (!) real value is '<_frozen_importlib_external.ExtensionFileLoader object at 0x0000022D82CBF610>'

__spec__ = None # (!) real value is "ModuleSpec(name='dipy.segment.mrf', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x0000022D82CBF610>, origin='C:\\\\Users\\\\xukai\\\\Downloads\\\\??2\\\\venv\\\\Lib\\\\site-packages\\\\dipy\\\\segment\\\\mrf.cp311-win_amd64.pyd')"

__test__ = {}

