When finding the approximate position of molecules, choosing the right
threshold value is important for obtaining good results, because the
threshold influences the number of missed molecules (false negatives)
and the number of erroneous detections of non-existing molecules (false
positive detections). ThunderSTORM uses a single-valued intensity
threshold which is updated for every raw input image
and applied
to the filtered image
. The threshold value can be specified by
users as an expression combining mathematical functions and operators
with variables based on the current raw or filtered image. This is
a powerful option, because users can specify the threshold value systematically
for unknown input images, in which the global intensity may slowly
fluctuate over time.
Our experiments indicate that the local maximum approach with 8-connected neighborhoods provides the highest F1-score compared to other methods. The suggested threshold applied to the filtered images, in the case of the wavelet filter, usually ranges from 0.5 to 2 times the standard deviation of the 1st wavelet level, e.g., 1*std(Wave.F1). Such a value is recommended by Izeddin et al. [1] and works well for typical SMLM data. Increasing the threshold value will lead to less false positive detections at the expense of more missed molecules and vice versa.
The formula interpreter provides several built-in statistical functions and some predefined variables. A brief description of the syntax and semantic rules follows.
Variables used in formulas can be scalars (numbers) or images (matrices). Image variables are provided by image filters. Two variables are always present:
| I | current raw input image |
| F | corresponding filtered image |
Note that some of the filters can provide more variables, see help of individual image filters for possible variable names. The formula interpreter can also use any of the variables provided by image filters even if the filter was not selected for image filtering.
For example, suppose that a Gaussian filter is selected as an image filter and the threshold for the approximate localization of molecules is defined by the formula mean(Med.F)+10*std(Wave.F1). The image filtering operation will run several times in this case, because the formula interpreter will determine the mean intensity value of the input image filtered using a median filter and will add ten times the standard deviation of intensity values obtained as a first wavelet level of the input image. This threshold value will be applied to the input image filtered using the selected Gaussian filter.
Operators can take images or scalars as operands. All image operations are performed element-wise, therefore image matrices must have the same size. The semantics is as follows:
| scalar + scalar = scalar | |
| image + image = image | |
| image + scalar = image | (scalar is added to each element of the image) |
The supported operators are:
| a + b | addition |
|---|---|
| a - b | subtraction |
| a * b | multiplication |
| a / b | division |
| a % b | modulo |
| a ^ b | exponentiation (b must be a scalar) |
Functions can take an image or a scalar as an argument or a result of a function which is an image or a scalar. The supported functions are:
| var(x) | variance of x |
| std(x) | standard deviation of x |
| mean(x) | mean value of x |
| median(x) | median of x |
| min(x) | minimum value in x |
| max(x) | maximum value in x |
| sum(x) | sum of all items in x |
| abs(x) | absolute value of x |