vital-ultrasound / ai-echocardiography-for-low-resource-countries

AI-assisted echocardiography for low-resource countries
1 stars 1 forks source link

Obtaining caliper scale of US image (in px/mm) #5

Closed mxochicale closed 2 years ago

mxochicale commented 2 years ago

🚀 Feature

To implement the obtention of caliper scale of US image (in px/mm).

Motivation

Currently there is no method to obtain US scale (in px/mm).

Methods

While the metric scale of the US images (in px/mm) is usually trivial to obtain during operation, the automatic extraction of this parameter from retro- spectively acquired data proved useful to fully automate the hundreds of mea- surements obtained in this work. Obtaining US scale is always system-dependent because it must be extracted either from the visual interface of the US machine or from the raw data, which requires access to a proprietary API. We use visual interface for scale recovery since we did not have access to the raw data. To obtain the scale, we exploit the consistent interface of the US machine used to acquire our dataset (GE Voluson), namely the caliper visible on the left-hand side of the US images. The ruler markers are detected with simple template matching and their smallest interval (can be either 5mm or 10mm) is determined from the relative size of the markers. The same template matching approach is easy to deploy on systems other than GE Voluson since all medical grade US machines have a similar ruler available Bano et al. 2021 AutoFB: Automating Fetal Biometry Estimation from Standard Ultrasound Planes. https://arxiv.org/abs/2107.05255

The caliper scales are embedded in the ultrasonic structure, and the background noise poses an obstacle to extraction of the scale, as indicated by the blue arrow in Figure 2A. Obviously, the background and caliper scales cannot be distinguished directly via a threshold approach. To eliminate the effects of background noise on scale extraction, we first crop the caliper from the raw image using the bounding box given by Mask R-CNN and process it separately. We then convert the caliper images into gray-scale. The Laplace operator is used for morphological operations after comparing with the experimental results. Large highlighted blocks of complex background are effectively discarded, as shown in Figure 5D. Next, we binarize the gray-scale image using a threshold value of 127 to obtain a monochrome image and then perform a morphological open operation on the monochrome image to eliminate a small amount of background noise. A visualization of these processing steps is shown in Figure 5. Figure 5G displays a binary image without the Laplace and open operations. As indicated by the green arrows in Figures 5F,G, the highlighted object is successfully filtered and the scales are preserved adequately after the Laplace and open operations. The background noise filtering is used preliminarily to filter out the part of the image that does not belong to the caliper. After morphological processing, the background noise is minimized and all contours in the image are obtained by using the “findContours” function of OpenCV, as shown in Figure 6A. These contours consist of pixel points (x, y). From our observations, the caliper scales follow three rules, as shown in Figure 7A. First, the scales belonging to a caliper contain a small number of pixel points. Second, the scales are all on the same y-axis. Third, the distances between adjacent scales are fixed. Although the above step reduces the noise, it still cannot achieve the full denoising effect. To this end, we further propose contour filtering for taking into account prior knowledge of the scale. The aim of the following steps is to thoroughly eliminate noise, so as to identify the type of caliper and determine the PPC more accurately. First, we filter out the contours that have pixel numbers larger than the threshold value of 30, i.e., the large background contours that have not been cleaned by the morphological processing, indicated by the green arrows in Figures 6A,B. Next, we count the contours that intersect with each y-axis by traversing all y-axes in the caliper image. The y-axis with the greatest number of intersecting contours is regarded as the axis along which the scales are located. This step involves filtering out the small and medium contours of the image edge, as indicated by the blue arrows in Figures 6B,C. Then, the mode is obtained as the pixel distance between adjacent scales via calculating and recording the distance between adjacent contours. The position of each contour is represented by the point at the upper left corner of the contour. Finally, all scale contours are obtained via the pixel distance, and the “minAreaRect” function of OpenCV is utilized to generate a rectangular bounding box for each scale contour, to filter out the small contours between scales. After these steps have been applied, the remaining contours are considered the scales of the caliper. This process is illustrated in Figure 6D, where the yellow rectangles indicate the scales of the caliper obtained by our method. After extracting the scales, we calculate the PPC. The two kinds of calipers have their unique rules of change in scale size: the 5-caliper has a “big-small-big” change rule, as shown in Figure 7A, whereas the 10-caliper has adjacent scales of the same size, as shown in Figure 7B. The type of caliper is determined by these rules and the scales extracted using the above procedure. In the case of the 5-caliper, the PPC of the image is the distance between adjacent scales multiplied by 2; for the 10-caliper, the PPC is the distance between adjacent scales. The caliper type and PPC results are shown in Figure 7C at the upper left corner of the image. The green box surrounds the position of the scales obtained by Mask R-CNN, and the yellow box indicates the caliper scale extracted by our method. Chen X, He M, Dan T, Wang N, Lin M, Zhang L, Xian J, Cai H and Xie H (2020) Automatic Measurements of Fetal Lateral Ventricles in 2D Ultrasound Images Using Deep Learning. Front. Neurol. 11:526. doi: 10.3389/fneur.2020.00526

mxochicale commented 2 years ago

See examples of calipers from two clinical US devices:

masked-captured-image-frame

frame_screenshot_W1280H960FPS30_MJPG_X51_adultecho

mxochicale commented 2 years ago

OCR "Expectation-Driven Text Extraction from Medical Ultrasound Images" https://ebooks.iospress.nl/pdf/doi/10.3233/978-1-61499-678-1-712

mxochicale commented 2 years ago

Caliper removal is performed in two stages. First, an inpainting technique for object removal is employed to erase calipers from a set of images.14,15 This algorithm takes as input an image and the target region. Starting from the outer edges, pixels in the labeled region are replaced by averaging pixels from similar patches. Figure 2(a) shows example patches and their corresponding closest neighbor(CN) in the image. Next, a UNET4is trained to automatically remove the calipers. Ideally, the caliper removal should not rely on identifying the text or calipers, therefore, we train a neural network to automate this procedure.

https://www.researchgate.net/publication/349321529_An_automated_framework_for_image_classification_and_segmentation_of_fetal_ultrasound_images_for_gestational_age_estimation

Juan C. Prieto, Hina Shah, Alan J. Rosenbaum, Xiaoning Jiang, Patrick Musonda, Joan T. Price, Elizabeth M. Stringer, Bellington Vwalika, David M. Stamilio, and Jeffrey S. A. Stringer "An automated framework for image classification and segmentation of fetal ultrasound images for gestational age estimation", Proc. SPIE 11596, Medical Imaging 2021: Image Processing, 115961N (15 February 2021); https://doi.org/10.1117/12.2582243

mxochicale commented 2 years ago

Computer-aided segmentation of thyroid nodules in ultrasound imaging could assist in their accurate characterization. In this study, using data for 1278 nodules, we proposed and evaluated two methods for deep learning-based segmentation of thyroid nodules that utilize calipers present in the images. The first method used approximate nodule masks generated based on the calipers. The second method combined manual annotations with automatic guidance by the calipers.

DOI: https://doi.org/10.1016/j.ultrasmedbio.2019.10.003 google-scholar: https://scholar.google.com/scholar?cites=16418435367267185455&as_sdt=2005&sciodt=0,5&hl=en

mxochicale commented 2 years ago

Closing this one but feel free to re-open it and look above references as there are few interesting approaches to discuss.