The boundary delimitation algorithm (BDA) for approximating the basal area of the cell soma of bipolar cells was divided into four steps as depicted in Figure 2. OPCs in culture generally have two long processes at opposite poles of an ellipsoidal soma, and move in the direction of one of them. Whereas a single image does not allow the identification of the direction of movement it still allows the determination of the direction of the processes. We call this the "heading direction" of the cell. As the first step of the BDA the heading direction of the bipolar cell, indicated by the angle drawn in Figure 2A, was estimated and subsequently the cell rotated in order to position the heading direction of the cell parallel to the abscissa (Figure 2B). Second, the cell was divided into its front and rear parts at the level of the nucleus. Third, starting at the nucleus, the contour of the soma was approximated by linewise (as indicated by the dashed lines in Figure 2B) fitting of polynomials to the data for the frontal and the rear parts of the cell separately. The root of the fit for every single line, indicated by the red dot in Figure 2C, was used to delimit the cell soma from the cell processes (Figure 2D). A compressed archive of the Matlab functions used to perform the BDA as detailed in the following is available as Additional File 1.
Approximation of the position of the nucleus
Atomic force microscopy measurements on hippocampal neurons revealed that the higher parts of the cell body form a harder structure and correspond most likely to the nucleus [20]. In order to determine a single point that represents the location of the nucleus the following procedure was employed: We stained the nucleus using Hoechst 33342 dye and recorded an epifluorescence as well as a phase contrast image.
Subsequently an SICM scan was performed and the relative position of the SICM scan was determined within the micrograph [19]. We then investigated the distance of the centroid of different horizontal sections through the SICM scans to the centroid of the Hoechst-stained nucleus. The horizontal sections consisted of the areas that were covered by pixels P
i
= (x
i
, y
i
, z
i
) (with i denoting the number of the pixel) exceeding a certain height T zmax, where T denotes a predefined threshold and zmax denotes the maximum cell height. To calculate the position of the centroid C
T
we reduced the z-coordinates of P
i
to boolean values z
T,i
= [z
i
>T zmax]. The square brackets indicate a Heaviside-like function that yields 1 if the enclosed condition is true and 0 otherwise [21, 22]. Furthermore, we assumed constant step sizes between the pixels and thus calculated the x-coordinate of C
T
,
, as:
was calculated in the same manner.
We next investigated the distance between C
T
and the centroid of the Hoechst 33342 staining of the nucleus (see Methods section) for various thresholds T.
Figure 3A-C show the phase contrast, epifluorescence and SICM image of an OPC. The position of the SICM scan within the light microscopic image is depicted as the black square in Figure 3A. The positions of C
T
for T = 0.1, 0.15,..., 0.9 and the centroid of the nucleus obtained from the epifluorescence staining (Cfluo) are depicted in Figure 3D. C90 (note that we use T in percent when indexing or labeling, thus CT = 0.9≡ C90) exhibited the minimal distance to Cfluo. Figure 3E shows the average distances between C
T
and Cfluo obtained from three different recordings. This confirms that C90 is located closest to Cfluo. Note that representations determined by using a larger threshold such as C95 often base on disjunct areas and were not investigated in detail. Thus we used C90 to approximate the position of the nucleus in the following.
Estimation of the heading direction of the cell
OPCs display a bipolar phenotype terminating in two cell processes that are most commonly originating from the opposite ends of the cell soma. This enables one to approximate the heading direction θh of an OPC by rotating a straight line
through C90 as the approximation of a straight line through the nucleus. In order to determine the heading direction of the cell we considered the arcs from each pixel representing the cell to y(x, θ) Let ϕ
i
(θ) denote the smallest angle between P
i
and y(x, θ) and r
i
denote the distance from C90 to P
i
. Then the length s
i
(θ) of the corresponding arc is calculated as s
i
(θ) = ϕ
i
(θ)r
i
. Figure 4A illustrates the relations between the introduced angles, lines and points for two different pixels P
i
located at opposite sides of C90. We now defined the angle θh, that minimized the sum of s
i
(θ) and thus matched the condition
as the heading direction of the cell. Here we assumed that pixels that exhibited a height of ≤1 μm represented the cell culture dish rather than the cell. Equation (3) was solved numerically by testing all angles 0 ≤ θ ≤ π in steps of ∆θ = 2π/360.
Rotating and interpolating the data
After determining the heading direction of the cell data were rotated in order to position the cell parallel to the abscissa and translated such that C90 was shifted into the origin of the new coordinate system. We denote the axes of the new coordinate system as x'-, y'- and z'- axes and a rotated and translated pixel as
, with j indicating the number of the pixel in the rotated scan. To determine the lateral extent of the rotated scan we considered the distances of the vertices of the original scan and y (x, θh) or a straight line through C90 perpendicular to y (x, θh) as illustrated in Figure 4C. Since the approximation of the single line boundaries of the cell soma required lines of data points parallel to the heading direction of the cell, we defined the grid consisting of the projections
of Q
j
to the x', y' plane of the rotated and translated scan such that
Here
is the negative representation of the length
as a coordinate, Δx and Δy denote the step sizes of the original scan in the x- and y-directions, respectively, and the truncated square brackets represent the ceil and the floor functions [22, 23].
To obtain the z'- coordinate of a pixel Q
j
we rotated its projection
into the original scan dataset by applying the inverse rotation matrix
and subsequently re-translated it by
. We refer to the resulting projection as
. If
was located outside the original scan, we defined
. Otherwise we considered the four projections
(here
denotes the projection of P
i
to the x-, y-plane) that surrounded
as depicted in Figure 5B. The z-coordinates of the corresponding pixels were known from the original data. Each set of three out of these four projections defines a triangle as indicated by the dotted lines in Figure 5B. In the following we refer to the four triangles as M
k
(with k = 1, 2, 3, 4) and to the vertices of one triangle as
with l = 1, 2, 3. We selected l such that the right angle was located at
and furthermore such that
and
. An example is shown in Figure 5C. If and only if
was located inside M
k
the sum ζ
k
of the angles at
to the vertices of M
k
amounted to 2π [24].
We next considered the plane defined by the pixels M
k,l
that corresponded to the projections
. The z-value z
k
(x, y) of this plane at a position (x, y) is given by
We now interpolated
as the average of
if
was located inside Mk :
Approximation of the contour of a single data row
To trace the contour of the cell soma and thus to crop the processes we now considered every data row (all data points with the same y') separately. The corresponding y'-values were defined by equation (4). Figure 6 shows sketches of the contours of two characteristic cell shapes; an almost circular cell body that is easy to distinguish from the cell processes (Figure 6A) and a cell soma that protruded into the direction of one of the extensions (Figure 6B). Thus, as indicated in Figure 6B, we assumed that a polynomial of third degree was convenient to approximate the cell soma contour but still suitable to crop the cell process.
To approximate both ends of the cell within a single data row at a fixed y'-level we subdivided the data into positive and negative, or frontal and rear, parts with respect to the corresponding x'-coordinates. In the following we describe the fitting procedure for the positive part, thus x' > 0.
was defined as the projection of Q
j
to the x', z'-plane and furthermore
with p = 0, 1, 2,... as the set of projections at a constant y' such that for all p > 0
Furthermore, we defined
such that
. This definition only included pixels with non zero z'-coordinates (since the data points were filtered this is equivalent to z' > 1 μm, see Methods section). In general n + 2 data points are needed to fit a polynomial of n th degree (n + 1 data points define the polynomial). Furthermore, we assumed that the cell body is represented by the data points whose x'-coordinates are located close to zero. Thus we additionally tested whether there was no gap within
and it therefore matched the condition
Otherwise, data points with x'-coordinates close to zero existed with z' = 0. This most likely occured at the borders of the cell soma in ± y'-direction and was treated as a special case described later in this section.
To fit a polynomial of n th degree to the data we used the function fit from Matlab's Curve Fitting Toolbox that implements a least square algorithm [25, 26]. It provides, among others, the value
that represents the goodness of the fit considering the number of data points that were approximated by the fit. We investigated the goodness of the fits to an increasing number r of data points. We refer to the subset of S
y'
that contains the first r elements as
and we denote the goodness of the fit to S
r,y'
as
Additionally, we defined X
y'
(r) to be the smallest, positive, non-complex root of the polynomial
that was determined by the function fit. We approximated the polynomial boundary of the cell soma for each line segment towards the direction of fitting as the X
y'
(r) that matched the condition
with r = n + 1, n + 2,..., pmax. Here pmax denotes the largest index p of the projections included in S
y'
Figure 7 shows examples of the fitting procedure for r = 4, 8, 9 and 14, respectively, with n = 3, hence fitting polynomials of third degree. For r = 4 and r = 14 (Figure 7A and 7D) F
y'
(r) had no real root with a corresponding positive x'-coordinate, thus these fits were not taken into consideration. Since
(Figure 7B and 7C) X
y'
(r = 8) (indicated by the red arrow-head in Figure 7C) was used to approximate the cell soma boundary at the corresponding y'-level. Note that the goodness of the fit to S
8,y'
was larger than those of all other fits that exhibited X
y'
(r ≠ 8) but are not shown in Figure 7 for clarity.
If the procedure failed to determine a cell soma boundary for the investigated set of data points S
y'
no r with a corresponding X
y'
(r) existed. We then defined the boundary to be X
y'
(r = n), if it existed. Note that
(r = n) is not defined [26]. If X
y'
(r = n) did also not exist we repeated the procedure with n : = n - 1 as long as n > 1, thus fitting polynomials of a reduced degree. In all cases investigated this procedure led to detection of bordering pixels.
Figure 8 summarizes the fitting procedure as described above in a flow chart. Due to space restrictions the chart omits the test of whether
(r = n) existed as well as the test of whether n > 1, indicated by the dotted arrow in the lower right part of the chart. This procedure was named fitBest.
Special cases of the fitting procedure
As indicated in Figure 8 an error was returned if the investigated set of data points did not match the conditions listed in equation (9). In this case data points with a corresponding
existed within the first n + 1 data points in the fit direction. This most likely occurred at the borders of the cell soma in ± y'-direction. This special situation might occur under two conditions. In the first case the cell body approximates to a circular shape causing the boundary perpendicular to the direction of fitting to consist of only a few pixels. Furthermore, the number of pixels available to the fitting procedure as depicted in Figure 7 is decreased by the division of the cell into its frontal and its rear part. Secondly, OPCs in a later stage of development might exhibit small additional extensions that grow perpendicularly to the heading direction.
It was important to consider these cases in order to provide an errorless and thus automatic processing of the data. There are different strategies to determine the boundary of the cell soma at these locations depending either on the chosen degree of the polynomial fitted to S
y'
as well as whether potential extensions at these sides of the cell soma should be included or excluded from the soma approximation. The most restrictive and simple solution would be to omit and thus to crop these lines.
To obtain a more accurate fit and to include potential cell extensions at these sides we introduced three more functions: fitOnePoint, fitTwoPoints and fitThreePoints that were executed depending on the number of data points with z' > 0. We considered the set of pixels
that matched all conditions listed in equation (8) except one: The z'-coordinate was not tested, thus T
y'
might also include projections with z' = 0. Let
be the number of projections with a z'-coordinate exceeding zero. If N = 4 we executed the function fitBest. If N = 1, N = 2 or N = 3 we executed the functions fitOnePoint, fitTwoPoints or fitThreePoints, respectively. Note that these functions might result in more than one boundary for the particular y' level, thus the resulting approximated cell soma might appear jagged.
The simplest case is N = 1 and the corresponding function fitOnePoint. We refer to the non-zero data point as
and used the roots of a parabola through
as the boundary if u < 4, otherwise the line was cropped.
Let the two non-zero projections be
and
with u <v in the case of N = 2 (function fitTwoPoints). We first considered the case v - u = 1, hence, the two points were neighbors. We fitted a polynomial of third degree to
and
and used its roots as the boundary in this case except if v = 4 and
. In the latter case we cropped the structure assuming that it did not belong to the cell soma.
If v - u > 1 we only assigned
to the cell soma and approximated the contour of the cell soma by the roots of the parabola through
as in the function fitOnePoint.
The most complicated case was N = 3. We refer to the single projection with zero z'-coordinate as
In this case the approximation was performed differently for varying values of u. If u = 1 we considered the z'-coordinate of the projection
. If
we assumed that the cell soma exhibited an asymmetric shape and applied the function fitBest. Otherwise, if
we approximated the cell soma boundary for the particular y' by the roots of a polynomial of third degree fitted to
.
If u ∈ {2, 3} we applied fitOnePoint to the single, non-zero projection and fitTwoPoints to the two neighboring non-zero projections, respectively. If u = 4 we considered the z'-coordinate of the first point opposite to the direction of fitting,
. If
we applied fitBest, otherwise we approximated the cell soma boundary at the current y'-level by the roots of a polynomial of third degree fitted to
.
Approximation of the volume of the cell soma
To approximate the cell soma volume we summed the z-coordinates of every pixel located within the approximated boundaries of the cell soma. This required that the height of every pixel located within the approximated cell soma boundary was known. Hence, if a single delimitation of the cell soma was located outside the original scan we were not able to approximate the cell soma volume and the recording was discarded. This happened if the cell body was in part located outside of the SICM image or very close to its borders.
Evaluation of the procedure
To evaluate the BDA we simulated objects of known volume and applied the morphometric fitting procedure to investigate any potential effect of geometry on the volume determinations. We have previously determined the restrictions of scan size and resolution for the successful investigation of migrating OPCs [27]. In brief, to image migrating OPCs with a suitable frame rate using our present SICM the dimensions of the recordings had to be restricted to 30 μm squares with a lateral step size of 1 μm, limiting the SICM images to 900 pixels.
We first applied the BDA to a hemisphere with a radius of r0 = 5 pixels (since the length of the cell body of an OPC is approximately 10 μm) in a data set consisting of 900 pixels as depicted in Figure 9A. The volume Vcomp computed by the BDA (omitting the determination of a heading direction as well as rotation and translation) was the same as the volume Vsum calculated by summing the volume of the columns above each pixel.
We next compared the determination of the volume of an half-ellipsoid with the two methods. A possible effect of the direction of fitting was tested by applying the BDA to an ellipsoid defined by the three radii r
x
, r
y
and r
z
with r
x
> ry and vice versa, as depicted in Figure 9B and 9C (the corresponding radii are r
x
= 0.8r0, r
y
= 1.25r0, r
z
= r0 and r
x
= 1.25r0, r
y
= 0.8r0, r
z
= r0). Again, no difference was found between Vcomp and Vsum.
To investigate whether the BDA in principle allows one to determine the volume of an object that flattens but maintains its volume by a compensatory widening we computed the volumes of an ellipsoid defined by the radii r
y
= r0, r
x
= t r0 and r
z
= r0/t with 1 ≤ t ≤ 2 in step sizes of Δt = 0.05. Figure 9G (blue crosses) shows the computed volume normalized to Vsum for every investigated value of t. There is no difference between Vcomp and Vsum, thus V
n
= 1. In contrast, the computed volume did not match Vsum when it was determined by using the method that every pixel exceeding a predefined threshold was assigned to the cell soma [16, 19]. The normalized volumes are displayed in Figure 9G (red dots and cross-hairs) for an absolute and a relative threshold. In the following we only consider the determination using a relative threshold since it is clearly visible that the use of an absolute threshold leads to increasing differences in the determination of the soma with increasing elongation of the ellipsoid. Additionally, we observed no difference in the volume determined by the BDA and Vsum when varying r
y
instead of r
x
or when varying both lateral radii by defining r
x
= r
y
= t1/2r0.
To simulate a bipolar cell we added extensions in ± x'-direction to a hemisphere of radius r0 as well as to the ellipsoids. Images of the resulting objects are depicted in Figure 9D-F. The height of the extension was chosen as r0/2 and its width as 2 r0/5. Every z-value at the corresponding positions was adjusted to r0/2 if the z-value calculated by equation (11) (see Methods section) was below r0/2. This avoids a gap between the half-ellipsoid and the extension but also increases the z-value of some pixels of the half-ellipsoid such that the volume differs from the volume Vsum computed by summing the z-values of the mere half-ellipsoid as depicted in Figure 9I. To our knowledge no exact definition exists describing where the cell soma ends and the cell process starts. At positions where the soma merges into the neurite a gradual decline of the soma and a corresponding increase of soma volume most likely occurs (Figure 9I).
Here we chose to use the calculated volume of the half-ellipsoid without extension as reference. Since we calculated the soma volume by summing all z-values corresponding to pixels within the approximated soma boundary an overestimation of the soma volume at positions merging into the neurites (Figure 9I) could be induced by the BDA.
The approximated volume, normalized to Vsum of the corresponding hemisphere or ellipsoid without extension, is shown in Figure 9H. As expected, the BDA (blue bars in Figure 9H) overestimates the volume with respect to Vsum. In contrast, the approximation via the threshold method [16, 19], in this case applied using a threshold of r0/2, underestimates the volume with respect to Vsum since it omits all sections of the ellipsoid with a height below the selected threshold. Putative cell shape changes as depicted in Figure 9E-G would result in detections of relative soma volumes as indicated in the gray boxes in Figure 9H. Erroneous changes due to different shapes are indicated by the arrows. Both methods lead to almost similar errors (about 5%) in the determination of soma volume changes.
Since it is unlikely that the shape of the soma changes while the extensions maintain their shape we next investigated the impact of changes in the shape of the extensions. Figure 10A shows the volume determined by the BDA when applied to a hemisphere with adjacent extensions (as depicted in Figure 9E) of varying relative height h r0, normalized to Vsum of the hemisphere without extensions. As expected from the result shown in Figure 9H, our method overestimates the volume with increasing height. An increase in the height of the extension from h = 0.2 to h = 0.6 results in an erroneous detection of a soma volume increase of about 6%. Although the relation seems to be linear in the depicted range, it is more complex: A threefold increase in the height of the extension from h = 0.3 to h = 0.9 leads to an erroneous detection of a volume increase of about 9% whereas a threefold increase from h = 0.1 to h = 0.3 leads to an erroneous detection of a volume increase of about 3%. In contrast, the thresholding method (red cross-hairs) shows an underestimation of the soma volume that increases stepwise but maintains a constant volume over a range of heights. However, the stepwise decrease of the calculated volume and thus the determination of a constant volume over a certain range of heights results from the imprecision that occurs due to the rasterization of the sphere as shown by the investigation of a simulated scan with a tenfold resolution (red dots in Figure 10A). An increase in the height of the extension from h = 0.2 to h = 0.6 results in an erroneous detection of a volume decrease of about 16% for the low resolution simulation and of 32% in the high resolution simulation. We observed similar results when performing the same investigation on the objects depicted in Figure 9F and 9G with only slight differences in the amount of errors determined by the two methods.
We used h r0 as threshold in these investigations. Note that the height of the processes of a live cell is much more difficult to determine due to the more complex and irregular shape and thus adds additional uncertainties to the determination of the soma volume.
Figure 10B shows the impact of various widths of the extension on the soma volume determination. As expected, the overestimation of the soma volume increases with increasing extension width w 2 r0. A fourfold widening of the extension leads to an erroneous determination of a soma volume increase of 11%. Since the height of the extension defines the threshold for the thresholding method the increasing width of the extension is not detected by this method. Thus it computes a constant volume under these conditions.
Figure 10C and 10D show the impact of a combined variation of the radii and the height of the extension. We investigated the radii r
x
(t) = r
y
(t) = t1/2 r0 and r
z
(t) = r0/t for 1 ≤ t ≤ 2 and the fraction h of the height h rz (t) of the extension for 0.2 ≤ h ≤ 0.6. Particularly when minor changes in shape were simulated, the BDA (Figure 10C) detects smaller erroneous volume changes compared with the thresholding method (Figure 10).
Application to live cells
We next applied the BDA to determine soma volumes in SICM recordings of live cells that exhibited both a much more irregular shape than the simulated objects as well as extensions that might be more difficult to distinguish from the cell soma. The corresponding data is available as Additional File 2. Figure 11 shows the results of the BDA applied to four different OPCs from rat brain. Note that the cells were positioned along the diagonal of the scan field in order to include as many details of the cell ramifications as possible. Whereas the cell somata depicted in Figure 11 Aa and Ba approximate a circular shape the OPCs shown in Figure 11 Ca and Da exhibited a more elongated cell soma that merged into one of the processes. The determination of the heading direction of the OPC shown in Figure 11 Aa selected the direction of the major process. Note that this might not be true when the fraction of the minor process that is located within the scan area notably exceeds the fraction of the major process. This might not impair the determination of the cell soma from a single scan but might have an impact when investigating the soma volume of a cell that migrates along the major process.
Figure 11B shows color coded representations of the rotated, translated and interpolated data sets. It is clearly visible that the transformed data faithfully represent the original data. Figure 11C shows the approximated basal area of the cell soma and the relative contribution of each pixel to the entire cell soma. A considerable difference becomes visible between the circular and the elongated cell somata. In the latter case the major part of the expansion into the process is assigned to the cell soma. The reason for this becomes more apparent in the three dimensional representation of an OPC exhibiting this type of soma shape as depicted in Figure 12A. At the left side of the SICM image the soma merges smoothly into the process. Hence, it is a comprehensible interpretation to assign this part of the cell to the cell soma.
In the second recording the cell changed its shape to be more circular and thus the determined basal area of the cell soma only shows a slight expansion as clearly visible by the comparison of Figure 12Ab and 12Bb. Note that it is known that migrating OPCs show an average velocity of 10 μm/h [28] and that migrating OPCs show notable changes in shape [27]. The detailed analysis of the parameters of the cell shape and soma shows that the cell swelled by approximately 29% and that this swelling was dominated by an increase in cell height whereas the length of the soma decreased. Most notably, this challenges the method to approximate the volume of a cell from light microscopic images by interpolation via the width and the length of its soma. This approximation, in contrast, would detect a slight cell shrinkage since the basal area covered by the cell soma was reduced as depicted in Figure 12E. The separate consideration of the frontal and rear soma volume by dividing the cell soma at the level of C90 perpendicular to y (x, θh) yields that the volume increase is dominated by an increase in the frontal volume (Figure 12E). Figure 12F summarizes the changes in the lateral dimensions as well as the changes of area and volume between both scans.