# C3 VFC: A Method for Tracing and Quantification of Microglia in 3D Temporal Images
## 3 Materials and Methods
### C3 VFC: Tracing Glia in 3D Temporal Images  
A 3D vector field is computed using vector field convolution [32] on the original image, \(I(x,y,z)\in\mathbb{R}^{3}\), to find the centerline that lies on the maximum intensity of an object, which is also the centerline of the object. A vector field kernel, \(\mathbf{k}(x,y,z)\), is convolved with \(I(x,y,z)\) so that the vector field points towards the centerline. The vector field is defined as:  
\[\mathbf{f}_{\text{{\tiny{$\circ$}}fc}}(x,y,z)=I(x,y,z)\mathbin{\text@underline{ \char 37}}\mathbf{k}(x,y,z) \tag{2}\]  
where is defined as linear convolution. The vector kernel is defined as:  
\[\mathbf{k}(x,y,z)=m(x,y,z)\mathbf{n}(x,y,z) \tag{3}\]  
where \(m(x,y,z)\) is the magnitude of the vector kernel and \(\mathbf{n}(x,y,z)\) is the unit vector pointing towards the kernel origin at (0,0,0):  
\[\mathbf{n}(x,y,z)=[-x/r,-y/r,-z/r] \tag{4}\]  
where \(r=\sqrt{x^{2}+y^{2}+z^{2}}\) is the distance from the origin. The origin of the kernel, (0, 0, 0), is considered the location of the features of interest (FOI), so a particle that is placed in that field is able to move towards the FOI, which in this case is the centerline. Thus, the further away the particles are from the origin, the smaller the influence of the FOI, and the magnitude of the vector field kernel is a decreasing function of distance from the origin:  
\[\mathbf{m}(x,y,z)=(r+\epsilon)^{-\gamma} \tag{5}\]  
where \(\gamma\) is a parameter that controls the influence of the FOI, and should be changed according to the signal-to-noise ratio, and \(\epsilon\) is a small positive constant that avoids dividing by zero.  
The VFC external force \(\mathbf{f}_{\text{{\tiny{$\circ$}}fc}}(x,y,z)\) is calculated by finding the convolution between the vector field kernel \(\mathbf{k}(x,y,z)\) and the intensity image \(I(x,y,z)\). For a 3D image, the VFC force field would be comprised by a three directional vector field in which the vectors point towards the centerline of a 3D object.  
Figure 2 depicts the VFC field on a microglia image. A 3D image of microglia is convolved with the vector kernel in Equation (3) to produce a VFC field that points to the centerline of the objects. Although not shown in the figure, the 3D vector field points to the center line in the x-y-z direction. The vector's magnitude and direction relies on the intensity of the image and the parameters of the kernel. In a real image, the noise pulls the vectors in the background but the large capture range of the kernel pull the vectors towards the higher intensity of the foreground object, or the centerline.  
In a real image, there is varying intensity throughout the object, where some intensities may be stronger in thicker parts of the object. Thus, there are non-zero vectors on the centerline that would move free particles towards a converging point, where ideally we would like the seeds to stop in the centerline. Our workflow solves these challenges by detecting and labeling the cells, using the VFC field to find critical points in the cells, and tracing them back to the soma.