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)
| 44 | return lab |
| 45 | |
| 46 | def 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 | |
| 64 | def interactive_maxflow3d(I, P, S, param): |
| 65 | """ |