# Deep Learning-Based Algorithms for Real-Time Lung Ultrasound Assisted Diagnosis
## 2 Methods
### Post-Processing Block
#### 2.5.4 Visualization  
Two single-shot timers are programmed, one for the real-time representation of ultrasound images and another for the rendering of predictions. This approach ensures that both renderings operate independently, without compromising real-time performance. As soon as both timers have new content to render, it will be displayed on the screen.  
Figure 13 shows the screen shown to the user. On the left, the acquired sector-scan images are shown in real-time, with several overlays coming from the processing algorithm. When the image is valid for being evaluated, the contour of the image turns green, and so the label \"movement\" on the upper right corner. If the image fails to pass any of this criterion, the contour line turns red, and so the labels that triggered the event. Therefore, the physician can freely move the probe on the patient chest until theses indications turn green, and then hold probe steady to acquire a video of 3 s that will be saved for each of the 12 regions to be examined according to the protocol.  
This image also overlays, in real-time, the findings of the neural network. The pleura is marked with blue points, A-Lines with green points, B-Lines with orange points, and consolidations with red points. Furthermore, a series of statistics and messages are shown in the lower part of this image: the percentage of frames with A-Lines in the last 6 s; the number of isolated B-Lines, calculated as the sub-regions with an average 6 dB drop in the angular direction within the region where B-Lines were detected; the percentage of the affected pleura calculated as the number of scan lines affected by B-Lines over the total number of scan lines where the pleura was detected; and a label in red indicating that a consolidation when present.  
On the right of the screen, an image we refer as pleura C-scan is shown. The C-Scan is a type of image widely used in Non-Destructive Testing (NDT) applications where B-scan images are acquired while the probe is moving and a visual representation of the whole component is needed [33]. For each image line within the B-Scan, the maximum amplitude is obtained within a gate at some depth, which assembles an ensemble image that can be interpreted like a top view of the component, with defects information at a certain depth. We adapted this concept using a gate at the depth of the pleura, obtained from the pleura mask given by the model, and substituting the mechanical movement of the probe in an NDT scan, by the time index in the acquired video. Therefore, each horizontal line in the pleura C-Scan correspond to a frame in the video, and it shows the brightness of the pleura line along the horizontal dimension of the image. At each of these lines, landmarks with the previously defined colours are also plotted. As the video progresses, the C-Scan image is constructed frame by frame from top to bottom and, at the end, all the relevant information of the video is condensed in only one image. The presence of A-Lines, B-Lines, and consolidations and their extension with regard to the pleura width can be appreciated, and also the pleura sliding effect as the indications move laterally during the scan. Furthermore, these images could be saved for each acquired region in the chest and shown in a single panel that depicts the global condition of the lung in a single view, without the need to review each of the acquired videos for the whole examination, which could help to reduce time during follow up of patients.