WingAnalogy

WingAnalogy: A Computer Vision-Based Tool for Automated Insect Wing Asymmetry and Morphometry Analysis

WingAnalogy is a computer tool for automated insect wing morphology and asymmetry analysis. It facilitates project management, enabling users to import pairs of wing images obtained from individual insects, such as left and right, fore- and hindwings. WingAnalogy employs image processing and computer vision to segment wing structures and extract cell boundaries, and junctions. It quantifies essential metrics encompassing cell and wing characteristics, including area, length, width, circularity, and centroid positions. It enables users to scale and superimpose wing images utilizing Particle Swarm Optimization. WingAnalogy computes regression, Normalized Root Mean Square Error, various cell based parameters, and distances between cell centroids and junctions. The software generates informative visualizations, aiding researchers in comprehending and interpreting asymmetry patterns. WingAnalogy allows for dividing wings into up to five distinct wing cell sets, facilitating localized comparisons. The software excels in report generation, providing detailed asymmetry measurements in PDF, CSV, and TXT formats.

Download WingAnalogy via the following button:

User Inteface

Home

WingAnalogy is a software designed for measuring the asymmetry of insect wings. This image shows the main window of WingAnalogy. Defining a new project is the first step in using the software. To initiate a new project, users should begin navigating to File > New Project, thereby defining the project properties using the New Project.

New Project 

In the New Project window, as illustrated, the user should select a directory on their computer where all files related to the project will be stored. Additionally, for each project, the user needs to assign a name to the project, specify the project manager, and provide their email address. Furthermore, there is a text box where the user can input any important notes about the project.

Add New Pair

After defining the new project, the user can initiate the process of measuring wing asymmetry by clicking the Add New Pair button. Clicking this button opens a new window, as illustrated. This window is named Add/Edit Pair. In this window, the user must import two insect wing images to be compared. For this purpose, an Add Image button is provided. After both images are imported, from the options panel on the right side of the same window under the Scaling label, the user can scale the imported wing to its actual size. To do this, the user should adjust the line to match the corresponding length of the wing and enter the corresponding real length of the wing in the dedicated text area for this purpose.

Morphometry of the Wing

When an image is imported, the built-in algorithms segment the insect wing image and measure geometric features related to the wing and its cells. As a result, several Figures are accessible for each wing. By using the drop-down under the Add Image button, you can switch between different Figures such as the Binary image, the Skeletonized image, the outline of the wing, extracted cells and junctions, the histogram and distribution contour related to the cell area, length, width, and circularity which are illustrated here. Additionally, in Add/Edit Pair window on the right side of the image name, a button allows you to maximize the Figure for a detailed view. Information regarding the image size, number of cells, junctions, wing area, perimeter, length, and width is displayed on the left side of the display panel for each wing. Furthermore, for each wing, the wing position can be defined.

Superimposing

The next crucial step is superimposing the wings. In the Add/Edit Pair window, this tool can be located in the options panel under the Superimposing label, as depicted here. The display panel in this section presents both wings in red and blue colors, with the blue image being the reference. Users can use the arrows to reposition the red wing until it is properly superimposed. Additionally, a button labeled Auto Superimposing is available in this panel, which can automatically align the wings. We recommend using the auto-superimposing feature. If it does not work properly, you can try aligning the wings manually.

Statistics

After superimposing, as illustrated here, you can observe the results related to the wing comparison through the Statistics labels in the Options panel. The Statistics label includes the NRMSE and regressions concerning the wing cell Area, Length, Width, and Circularity. It also provides the mean distance and standard deviations of mean distances between wing outlines, junctions, and cell centroids. Additionally, the subtracted values of the junctions and cells are presented here. In the Statistics label, there are three columns of results labeled as Mean Value, Image 1, and Image 2. It is important to note that WingAnalogy considers the first image as the reference image in one scenario and the second image in another scenario. Consequently, when presenting the results, both sets of results are presented, along with the mean value calculated from them.

Histograms

The next label, as shown in here, is the Distribution Histogram, which displays the histogram depicting the differences in the corresponding wing cell area, length, width, and circularity. 

Regression

Additionally, the Figures related to regressions are presented under the Regressions label in the Options panel.

Cell View

Another tool, which is illustrated in Figure S8 and embedded in the Options panel, is the Cell View. As mentioned before, when the user imports each image, built-in algorithms segment the wing image and measure the area, length, width, and circularity of wing cells. Consequently, in this panel, the user can view these measurements for each cell from either the first or second image separately.

Local Results

WingAnalogy is not only developed for comparing entire wings, but it also allows for localized comparisons. This means that we have included a tool in which the user can divide the wing into a maximum of five different regions and obtain results for each region separately. This tool is accessible under the Local Results label in the Options panel. As mentioned earlier, the software can consider either the first image or the second image as the reference. Then the user can freely choose one of the images to divide the wing into several regions. Clicking the Edit/View Sets button opens a new window with several embedded tools, enabling the user to specify arbitrary regions within the wing and obtain results for each.

This image displays the Local Result window. In this window, the user can access several tools for dividing the wing into a maximum of five sets. There are blue and red buttons for each set under the Define Set panel. The blue button activates the mouse cursor, allowing the user to outline a region on the wing by drawing a polygon around it. The centroid of each cell inside the selected region is considered part of that set. Once a set is defined, the area of that set appears in the dedicated text box in front of it. Additionally, as soon as one set is defined, the color of that region changes to correspond with the set color, which is defined as red, green, blue, orange, and purple, respectively, for sets one to five. Furthermore, the results are displayed immediately after defining a set under the Sets Overall Result and Statistics panel.

After completing all tasks related to wing pairs, the user can utilize three embedded buttons under the Options panel in the Add/Edit Pair window, to generate a report in three different formats: TXT, PDF, or CSV files. By clicking Apply Changes in Add/Edit Pair, the pair is added to the list of pairs on the left side of the main window, as shown here.

Generate Model and Figures

Clicking on the name of a pair, as shown in the main window displays the images of that pair. The user can click the Edit/Show Pair to adjust information related to the pair. 

In the main window, the user can access the All Pairs Result window via the Result menu, as illustrated. This window compares the results of regression, NRMSE, mean distances, standard deviation of mean distances, subtract values, and wing area differences for all pairs through simple plots and box plots. All defined pairs are displayed on the left side. The numbers on the x-axis of the simple plots correspond to the pair numbers listed. The menus at the top of this window offer the user several options, including exporting Figures and their data as CSV or PDF files.

Preparing image for WingAnalogy (Video S1)

This video shows how to edit and image suitable for WingAnalogy to get the best result

Define new project (Video S2)

Add new pair (Video S3)

Scaling tool in WingAnalogy (Video S4)

Superimposing tool in WingAnalogy (Video S5)

Statistics and regressions in WingAnalogy (Video S6)

Defining cell set in WingAnalogy (Video S7)

Exporting the result of pairs in WingAnalogy (Video S8)

Saving a project in WingAnalogy (Video S9)

Importing a saved project to WingAnalogy (Video S10)

Exporting the result of all pairs in WingAnalogy (Video S11)

Exporting the result of all sets in WingAnalogy (Video S12)