LabPlot 2.2.0 released
The main new feature of this release is a new tool that allows you to easily extract data from image files – Datapicker. This tool was contributed by Ankit Wagadre during GSoC2015, s.a. his final report, who continued to work on this tool even after the summer program was over.
The process of data extraction consists mainly out of the following steps:
- Import an image containing plots and curves where you want to read the data points from
- Select the plot type (cartesian, polar, etc.)
- Select tree reference points and provide values for them. With the help of these points the logical coordinate system is determined.
- Create a new datapicker curve and set the type of the error bars
- Switch to the mouse mode “Set Curve Points” and start selecting points on the imported image – the coordinates for the selected points are determined and added to the spreadhseet “Data”
It is possible to add more then one datapicker curve. This is useful in case the imported image contains several curves that need to be digitized. The datapicker curve that is currently being selected in the Project Explorer is the “active” one – points clicked on the datapicker image will be calculated and added to its data spreadhseet. Calculated values are stored in different columns in data spreadsheets in the datapicker. These columns behave exactly the same like other columns in usual spreadsheets and can be directly used as source columns for curves in your own plots.
Datapicker supports the process of the data extraction with several helpers. To place the points more precisely, a magnification glass with different magnification levels is available. Also, the last selected point can be shifted with the help of the navigation keys. Furthermore, when reading data points having error bars, datapicker automatically creates bars indicating the end points of the error bars. Those bars can be pulled with the mouse until the required length (the distance to the data point) is reached.
The procedure for the extraction of data from an imported plot as described above is feasible when dealing with a limited number of points. In case the curves in the imported image are given as solid lines, the datapicker tool in LabPlot; allows to read them (semi-)automatically. For this, after a new datapicker curve was added as described above, switch to the mouse mode “Select Curve Segments”. The curves on the plot are recognized and highlighted. By clicking on a highlighted curve (or one of its segments), points along this curve are created. The length of a segment and the density of created points (separation between two points) are adjustable parameters.
In many cases the plot is not as simple as above (single black curve on white background) and contains grid lines, many curves of different color and thinness and a non-white background. In such a case the automatic detection fails (too many or no objects are highlighted). To help the datapicker to determine the curve(s) correctly, the user has to limit the allowed ranges in the HSV (or HSI) colour spaces. To subtract the non-white background it is possible to limit the range for the foreground colour, too. Internally, each pixel of the image is converted to black and white where only the points fitting into the user-defined ranges for hue, saturation, value, intensity and foreground are set to black.
In the screenshots below, the blue curves in the original image were projected onto by having appropriately reduced the allowed ranges in the colour space (note the peak for blue in the histogram for the hue). The transformed black and white image contains only the curves the user is interested in and it is now an easy task for the datapicker to determine the curves and to place points on them.
As another new feature in this release a new custom point was implemented which allows the user to add a symbol to the plot at user-defined position, see the screenshot below:
Such a point can be moved freely around the plot area with the mouse or by directly specifying it’s coordinates in the corresponding dock widget.
LabPlot accepts now drag&drop-events. You can drag the file you want to import from your file manager and drop it on LabPlot – the import dialog will pop up and you can proceed importing the data as usual.
Finally, some speed-up in the rendering of the image view of the matrix was achieved by utilizing the multi-threading and the support for GSL 2.x was added. The release also includes several bug fixes, the details for them can be found in the ChangeLog-file.