Exemplo n.º 1
0
def fastSKIZ3D(imIn, imOut, grid=m3D.DEFAULT_GRID3D):
    """
    Fast skeleton by zones of influence of binary 3D image 'imIn'. Result is
    put in binary 3D image 'imOut'. The transformation is faster as it uses
    the watershed transform by hierarchical queues.
    """

    imWrk = m3D.image3DMb(imIn, 8)
    m3D.convertByMask3D(imIn, imWrk, 1, 0)
    markerControlledWatershed3D(imWrk, imIn, imWrk, grid=grid)
    m3D.threshold3D(imWrk, imOut, 0, 0)
Exemplo n.º 2
0
def fastSKIZ3D(imIn, imOut, grid=m3D.DEFAULT_GRID3D):
    """
    Fast skeleton by zones of influence of binary 3D image 'imIn'. Result is
    put in binary 3D image 'imOut'. The transformation is faster as it uses
    the watershed transform by hierarchical queues.
    """
    
    imWrk = m3D.image3DMb(imIn, 8)
    m3D.convertByMask3D(imIn, imWrk, 1, 0)
    markerControlledWatershed3D(imWrk, imIn, imWrk, grid=grid)
    m3D.threshold3D(imWrk, imOut, 0, 0)
Exemplo n.º 3
0
def maxima3D(imIn, imOut, h=1, grid=m3D.DEFAULT_GRID3D):
    """
    Computes the maxima of 'imIn' using a build operation and puts the
    result in 'imOut'.
    
    'h' can be used to define the maxima height. Grid used by the build
    operation can be specified by 'grid'.
    
    Only works with 8-bit or 32-bit as input. 'imOut' must be binary.
    """
    
    imWrk = m3D.image3DMb(imIn)
    m3D.subConst3D(imIn, h, imWrk)
    m3D.build3D(imIn, imWrk, grid=grid)
    m3D.sub3D(imIn, imWrk, imWrk)
    m3D.threshold3D(imWrk, imOut, 1, mamba.computeMaxRange(imIn[0])[1])
Exemplo n.º 4
0
def maxima3D(imIn, imOut, h=1, grid=m3D.DEFAULT_GRID3D):
    """
    Computes the maxima of 'imIn' using a build operation and puts the
    result in 'imOut'.
    
    'h' can be used to define the maxima height. Grid used by the build
    operation can be specified by 'grid'.
    
    Only works with 8-bit or 32-bit as input. 'imOut' must be binary.
    """

    imWrk = m3D.image3DMb(imIn)
    m3D.subConst3D(imIn, h, imWrk)
    m3D.build3D(imIn, imWrk, grid=grid)
    m3D.sub3D(imIn, imWrk, imWrk)
    m3D.threshold3D(imWrk, imOut, 1, mamba.computeMaxRange(imIn[0])[1])
Exemplo n.º 5
0
def maxDynamics3D(imIn, imOut, h, grid=m3D.DEFAULT_GRID3D):
    """
    Extracts the maxima of 'imIn' with a dynamics higher or equal to 'h'
    and puts the result in 'imOut'.
    
    Grid used by the dual build operation can be specified by 'grid'.
    
    Only works with 8-bit or 32-bit images as input. 'imOut' must be binary.
    """
    
    imWrk = m3D.image3DMb(imIn)
    if imIn.getDepth() == 8:
        m3D.subConst3D(imIn, h, imWrk)
        m3D.build3D(imIn, imWrk, grid=grid)
        m3D.sub3D(imIn, imWrk, imWrk)
    else:
        m3D.floorSubConst3D(imIn, h, imWrk)
        m3D.build3D(imIn, imWrk, grid=grid)
        m3D.floorSub3D(imIn, imWrk, imWrk)
    m3D.threshold3D(imWrk, imOut, h, mamba.computeMaxRange(imIn[0])[1])
Exemplo n.º 6
0
def maxDynamics3D(imIn, imOut, h, grid=m3D.DEFAULT_GRID3D):
    """
    Extracts the maxima of 'imIn' with a dynamics higher or equal to 'h'
    and puts the result in 'imOut'.
    
    Grid used by the dual build operation can be specified by 'grid'.
    
    Only works with 8-bit or 32-bit images as input. 'imOut' must be binary.
    """

    imWrk = m3D.image3DMb(imIn)
    if imIn.getDepth() == 8:
        m3D.subConst3D(imIn, h, imWrk)
        m3D.build3D(imIn, imWrk, grid=grid)
        m3D.sub3D(imIn, imWrk, imWrk)
    else:
        m3D.floorSubConst3D(imIn, h, imWrk)
        m3D.build3D(imIn, imWrk, grid=grid)
        m3D.floorSub3D(imIn, imWrk, imWrk)
    m3D.threshold3D(imWrk, imOut, h, mamba.computeMaxRange(imIn[0])[1])