The MultiFlow shiny app (Chang et al. 2020) can be used to analyse images of lateral flow assays and to calculate intensity values for the lines of the photographed strips. The intensity values can be merged with information about the experiment and preprocessed by averaging technical replicates. Finally, one can perform a calibration analysis for the data by arbitrary linear models.
In addition to starting with the images, the app also offers further options. One can also start with intensity data on Tab 3, with merged data (intensity data merged with experiment information) on Tab 4, or with preprocessed data on Tab 5.
The first step consists of loading an image of one or several lateral flow strips. For trying out the app one can also load a sample image provided with the package. For the purpose of demonstration we use the sample image provided with the package.
In the second step, one needs to select the number of strips shown in the image and the number of lines per strip.
The maximum number of strips per image is 10, but in principle could be extended to a higher number. The only requirements is that the strips are regularly spaced with identical or at least similar spaces between them and between the lines. The minimum number of lines per strip is two, the maximum number of lines per strip is six since we are not aware of any lateral flow assay having more than six lines.
After loading the image and selecting the number of strips as well as lines per strip, one needs to click on the image and drag to generate a rectangular selection region on the image. It is best, if each line is roughly in the middle of a respective segment. In addition, there is a segment between two consecutive bands. This segment should not include any part of a line since it can be used for background correction; see below. An example of a well selected cropping region is shown in the following screenshot.
Clicking "3) APPLY CROP" the original image is cropped to the region selected. An example can be seen in the screenshot below. If you want to change the cropped region after clicking "3) APPLY CROP", you have to upload the original image again.
The cropping was adapted from the shiny app provided by package ShinyImage (Fu, Shin, and Matloff 2017).
Clicking "4) APPLY SEGMENTATION" segments the image and changes to the second tab. The segments between the bands are used in our quantile background correction method; see below.
If there is more than one strip on the analysed image, one first needs to select, which strip shall be analysed.
If the image is a color image, it will be transformed to grayscale. By default, we apply the luminance approach, which converts color to grayscale preserving luminance; that is, the grayscale values are obtained by
\[ 0.2126 * R + 0.7152 * G + 0.0722 * B \] where R, G, B stands for the red, green and blue channel of the color image. By selecting mode "gray", the arithmetic mean of the RGB values is used. Furthermore, the selection of mode "red", "green" or "blue" allows a color channel wise analysis of color images.
There are two threshold methods, where the default is Otsu's method (Otsu 1979). Otsu's method returns a single intensity threshold that separates pixels into foreground and background. It is equivalent to k-means clustering of the intensity histogram (Liu and Yu 2009). The quantile method is a simple method that computes the specified quantile of all pixel intensities of the segments lying between the lines (per strip). In most of the images we have analysed so far, Otsu's method performed very well and better than our quantile method. However, in cases where the lines are unsharp and very blurred our quantile method may outperform Otsu's method.
By clicking "2) APPLY TRESHOLD" the selected threshold method is applied to the segemented images of the selected strip. The result is shown in two ways. The first row of images shows the pixels that have intensities above the background. The second row of images shows the images after background subtraction; see the screenshot below.
Clicking "3) ADD TO DATA" adds the mean and median of the background subtracted intensities of the pixels with intensities above the threshold to the data. Now, one can proceed with the second strip of the image, use a different color conversion mode or go back to Tab 1 and load the next image. When all strips and images are processed one can proceed with 4).
Clicking "4) SWITCH TO INTENSITY DATA" changes the Tab to Tab 3.
The "REFRESH DATA" button is provided to make sure that the latest version of the generated intensity data is shown in the Tab. By clicking "2) DOWNLOAD DATA" the data can be saved to a standard csv file.
We also provide a "DELETE DATA" button for restarting with new images or uploading an already existing dataset. To get an empty window again, one needs to click "3) REFRESH DATA".
Instead of generating new data, one can also upload already existing intensity data, that may have been generated even with a different software. Hence, this step could also be seen as a second entry point of our app. The screenshot below shows an example of data that were generated with the app saved and then loaded again.