MCPcopy Create free account
hub / github.com/HiLab-git/SimpleCRF / maxflow3d

Function maxflow3d

examples/demo_maxflow.py:46–62  ·  view source on GitHub ↗

maxflow for 3D image segmentation. Only binary segmentation is supported. input parameters: I : a numpy array of shape [D, H, W], or [D, H, W, C] where C should be 3. type of I should be np.float32 P : a probability map of shape [D, H, W, L], where L==2

(I, P, param)

Source from the content-addressed store, hash-verified

44 return lab
45
46def maxflow3d(I, P, param):
47 """
48 maxflow for 3D image segmentation. Only binary segmentation is supported.
49 input parameters:
50 I : a numpy array of shape [D, H, W], or [D, H, W, C] where C should be 3.
51 type of I should be np.float32
52 P : a probability map of shape [D, H, W, L], where L==2 is the number of classes
53 type of P should be np.float32
54 param: a tuple giving parameters of CRF (lambda, sigma), where
55 lambda : weight of smooth term, e.g. 20.0
56 sigma : std intensity value, e.g., 10
57
58 output parameters:
59 lab : a numpy array of shape [D, H, W], where pixel values represent class indices.
60 """
61 lab = maxflow.maxflow3d(I, P, param)
62 return lab
63
64def interactive_maxflow3d(I, P, S, param):
65 """

Callers 1

demo_maxflow3dFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected