$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
We applied a DFT to calculate the main components of the shape corresponding to the cell projections. The Fourier descriptors were obtained by applying the DFT algorithm to the xy-coordinate pairs of the fitted periphery of the cell projections, obtained as the output of the AbSnake part of our workflow. These xycoordinate pairs can be handled as a complex-valued 2D vector "g":

From the vector "g", we use DFT to calculate the complex-valued Fourier spectrum:

Based on well-known formulas of the discrete Fourier spectrum, and using the complex-number labeling of "g" as:

We get:
(1)
We can calculate the real ("A") and imaginary ("B") components of
:
(2)
(3)
Here, the first DFT component G0 corresponds to m = 0, which gives:
(4)
(5)
Consequently, this component describes the geometrical center of the original object.
The second element of the DFT forward spectrum, G1, corresponds to m = 1:

(6)
From Eq.6 we conclude that these points form a circle with a radius of
and starting angle
, where the circle describes one complete revolution while the shape is traced once. The center of the circle is located at the origin (0, 0), the radius is |G1| and the starting point is:
(7)
In general, for a single Fourier coefficient
, the coordinates are described as:

(8)
Similarly to Eq.6, Eq.8 also describes a circle, but with a radius of Rm=|Gm|, a starting angle
and a starting point at
, where the contour is traced once whilst the circle runs through "m" full orbits16,17.
Shape parameters as SOM input
The workflow, as described in Figure 1, was applied to a deconvolved (using a measured Point Spread Function) intravital multi-photon microscopy dataset of microglial cells to characterize their morphological changes in healthy or cancerous cortical tissue18. Twenty DFT components were calculated for each 2D projection of the reconstructed 3D surfaces and the results were used as an input for the SOM training. Under physiological conditions, the microglia presented a rather complex shape with multiple, highly branched processes (Figure 2a). When placed in a cancerous environment (cortical tumor model), the microglia changed to a simpler, more spindle-like shape (Figure 2b).
The trained SOM was tested in order to evaluate its ability to distinguish between healthy and cancerous cells. The healthy cell population was projected onto a single area of the SOM (Figure 2c). The SOM responded to the cancerous microglia dataset with a dumbbell-shaped active region (Figure 2d). A blindly mixed input data set that consisted of DFT shape components from both the healthy and the cancerous group was projected by the SOM into two distinct groups, whilst keeping the shape of their individual contours similar to those of the separated groups (Figure 2e; compare with 2c and 2d). It can be concluded that the mixed dataset was successfully clustered by the SOM.
We tested the performance of the SOM by comparing its projections with the manual analysis of the same data by a medical expert, who classified the dataset based on their spatio-temporal behavior. The expert identified four distinct cell groups (resting cells, phagocytosing cells, interacting cells, and mobile cells18), which were reconstructed and used to train a 12x12 SOM. The trained network (Figure 3a) shows groups of high hit-value artificial neurons, especially in the bottom left and the middle areas of the SOM. The response of the trained network was also tested with four randomly selected subsets (which were not part of the training dataset) of images from the four different groups identified by the expert18. These image subsets resulted in four well-defined responses by the SOM, as shown in Figure 3b. The resting cells exhibit the most complex shape and showed the highest separation level within the neural network (Figure 3b "resting" panel). The other three identified cell types shared a common area of the SOM in the bottom left corner, but were otherwise separated by the SOM. The bottom left corner SOM area thus corresponds to the lower-index DFT values.
The robustness of the SOM approach was tested by using the trained SOM with three random subsets of the same -resting- cell type (not part of the training dataset). The response of the SOM to this input exhibits a very similar response (Figure 3c, subsets 1-3), demonstrating the robustness of our approach.
Time-dependent cell shape changes are precisely characterized by DFT
In order to examine the effect of time-dependent changes of the cell shape on the DFT components, one to three cells per subgroup (see Figure 3b) were tracked for 13 to 28 time points. Figure 4 shows the first ten DFT components of a mobile cell (Figure 4a) and an interacting cell (Figure 4b), which were plotted as a function of time. The mobile cell exhibits a permanently altering shape (see Supplementary Video 4 in 8), which is reflected by a rougher DFT surface. The bursts of the DFT amplitude in the first third of the time course for the interacting cell coincide with the fast and vast cell shape changes as shown in Supplementary Video 5 in 8.
The time course of all 19 DFT components was also characterized for these two cells at three separate time points during the tracking of a mobile cell (Figure 5a) and of an interacting cell (Figure 5b). The perpendicular axes represent hereby the six rotation angles and indicate that all projections are equally important for the characterization of the shape for both cell types.

Figure 1. Step by step workflow of the data processing to identify cell clustering based on the shape of cells. Surfaces reconstructed in 3D were used as input to Blender for automated 3D-to-2D projections. The periphery of each projection was located and the DFT components were calculated. The components served as an input either to a trained SOM in Matlab, or to train a new SOM. Please click here to view a larger version of this figure.

Figure 2. Typical appearance of mouse cortical microglia cells under control conditions (a) and in cancerous tissue (b) Screenshots of reconstructed microglia surfaces. SOM projections were created from the three groups of microglia samples from the mouse cortex: control (non-tumorous) cells (c), tumor cells (d), and a mixed population of cells (e). This figure has been modified with permission8. Please click here to view a larger version of this figure.

Figure 3. (a, left) Self-Organizing Map of a mouse microglia dataset consisting of 768 input feature vectors. The dataset was used to train a 12x12 artificial neural network, using hexagonal neighborhood geometry, random initialization and 2000 epochs. (a, right) The corresponding SOM input planes of the first 10 DFT components (b) The responses of the SOM depicted in (a), to one random VRML file subset each from the four cell types "mobile," "interacting," "resting," and "phagocytic" as first described in Figure 5 of Bayerl et al.18. (c) The response of the same SOM as in (a, left) to three random subsets of the entire dataset (which were thus not part of the training dataset) of the "resting cells"-type 3D surfaces. The similarity amongst the three responses is notable. This figure has been modified with permission8. Please click here to view a larger version of this figure.

Figure 4. (a) Time dependence of the first 10 DFT components during an intravital imaging experiment of mouse microglia. This panel shows data for a cell of the "Mobile Cells" type. The x-axis corresponds to time points of the experiment at 60 s time resolution, the y-axis shows the amplitude of the DFT components in arbitrary units (a.u.), whereas the z-axis corresponds to the DFT component from 1 to 10. (b) As in (a) but for a cell of the "Interacting Cells" type. This figure has been modified with permission8. Please click here to view a larger version of this figure.

Figure 5. (a) The behavior of all 19 DFT components of a cell of the "Mobile Cells" type at the beginning, at the middle and at the end of the experiment. The numbers on the x-axis correspond to the DFT component ID from 1 to 19. The y-axis shows the DFT component amplitude in arbitrary units (a.u.), whilst the z -axis marks the six random rotation angles. (b) Same as in (a) but for a cell of the "Interacting Cells" type. This figure has been modified with permission8. Please click here to view a larger version of this figure.