Skip to main content
. 2017 Jun 21;4(2):027501. doi: 10.1117/1.JMI.4.2.027501

Algorithm 4.

Field computation algorithm (COMPUTE-FIELD).

Inputs:
 - Iglandthreshold is the binary gland mask. White regions are glands on a black background. Field is computed inside gland regions only.
 - pixels+ is a set of pixels with an assigned positive charge.
 - pixels is a set of pixels with an assigned negative charge.
Output:
 - Ifield is the grayscale field image. Pixel intensity is directly proportional to field magnitude at its location. Pixel intensities are within [0, 255].
Parameters:
 - Define +ve and −ve charges as +1 and 1, respectively. Set decay rate for +ve and −ve charges as 1.0 and 1.6, respectively. These charge values and decay rates were optimized empirically.
1:  Procedure COMPUTE-FIELD(Iglandthreshold, pixels+, pixels)
2:   Initialize all pixels in Ifield to zero.
3:   for All pixels (x,y)Iglandthresholddo
4:   Ifield(x,y)=(xj,yj)pixels+(1.0)[(xxj)2+(yyj)2]12+(xk,yk)pixels(1.0)[(xxk)2+(yyk)2]1.62.
5:   end for
6:   Linearly rescale Ifield to values within [0, 255] for further numerical operations.
7:   return field image Ifield.
8: end procedure