Amira-Avizo Software and PerGeos Software integrate Python 3.5. Many packages are available including NumPy and SciPy. NumPy is an extension for handling multi-dimensional array, which allows for elementwise operations, comparisons, logical operations, and statistics among others. SciPy is an extension that provides a toolbox for scientific computing such as interpolation, integration, image processing, linear algebra, signal processing, and statistics. Creating additional GUIs is also supported for e.g. viewing plots with Matplotlib or creating your own user interface with PyQt. For advanced image analysis, scientific packages such as opencv, keras, tensorflow, pytorch or scikit_learn are available in the Thermo Scientific standard bundle.
While providing a long list of packages, the Amira-Avizo Software and PerGeos Software Python integration is not limited to those being installed by default. The package manager allows the user to create multiple self-contained Python environments with their own Python executable and set of packages. Each self-contained environment can then be used by Amira-Avizo Software.
Amira-Avizo Software and PerGeos Software Python integration enables you to use Python tools with the same performance and similar memory consumption inside of Amira-Avizo Software and PerGeos Software as would be expected from any other modern standalone Python release. With its memory sharing technology, Amira-Avizo Software and Thermo Fisher Scientific Python are tightly integrated.
Python expressions specific to Amira-Avizo Software and Pergeos Software allow you to access information and functionalities contained within Amira-Avizo Software and Pergeos Software modules. There are two main ways to interact with Amira-Avizo Software and Pergeos Software using Python:
1. The first way to use Python is through the Python console, which is separate from the TCL console. This is an integrated interpreter which includes completion.
2. The second and most powerful way is through script modules. Script modules act like regular modules in Amira-Avizo Software and can be accessed in the Object Popup menu.
Script module loaded in Amira-Avizo Software
Script module loaded in PerGeos Software
Amira-Avizo Software and PerGeos Software provides multiple resources to quickly learn how to integrate Python functionalities in your processing workflows such as documentation, tutorials and script module examples.
In the following section we highlight some usage of algorithms and technologies from the Python eco-system in Amira-Avizo Software and Pergeos Software:
Deep learned neural networks have proved to be an invaluable tool for many research and industrial purposes in recent years. Using deep learning for processing images allows to go beyond traditional image processing results. Thanks to the Amira-Avizo Software and Pergeos Software’s Python integration, deep learning workflows are possible within Amira-Avizo Software and Pergeos Software.
Users can configure a deep learning environment to use on their preferred DL package (Keras, TensorFlow, PyTorch). They can then train their own model for future prediction.
OpenPNM is a Python open source pore network modeling package. Unlike Amira-Avizo Software and PerGeos Software’s PNM technologies which allows to compute a pore network model from a scanned image to extract its properties, OpenPNM allows building theoretical networks from scratch based on a given set of statistical properties. This is proved to be extremely useful for material science applications to study which parameter can optimize a given material’s performance based on various simulations.
With Amira-Avizo Software and PerGeos Software’s Python integration, it is possible to explore a wide range of network topologies and simulations with the Python OpenPNM library. For example, individual networks can be stitched together to form a single modeling domain. This feature can be used to model the various domain of a fuel cell battery and simulate phase transport.
It is also possible to generate a pore network model in Avizo from an actual scanned data and load it in OpenPNM to run various simulations.
Providing that OpenPNM is installed in the Amira-Avizo Software or PerGeos Software Python environment, it is now directly available from within the software's Python console or from a Python script module (A Python script module allows the user or a custom solution provider to create scripts that fit seamlessly into the Amira-Avizo Software or PerGeos Software's user interface, and define their own user interface components)
The example shown here highlights a weakly/incomplete supervised learning where the user provides only sparse labels that need to be classified. It can be adapted to a robust workflow to train a model for specific rock types and to be reused later. This workflow is based on open source Python API librairies used within the Amira-Avizo Software and Pergeos Software framework thanks to the Python 3.5 interpreter.
Users can load a dataset of their choice and navigate to the segmentation workroom and use the Interactive Brush to add supervised labels to the features in the image to segment on a slice.
Shale/EagleFord sample :
Below we highlight some Python code training a classifier and executed within the PerGeos Software application through a Python script module:
Training a classifier:
Here the slice by slice testing/prediction example code:
Classified 3 phase segmentation result into Grains (Light blue), Organic matter(Dark blue) and Pores (Red)
Sandstone example with 3 phase user labels :
Classified output showing porosity and high density grains (L) and the sample in grayscale (R):
It is possible to use Graphics User Interface windows from within Amira-Avizo Software or PerGeos Software's Python environment.
It can either be created in a Python script module for advanced use or directly from within the Python console. Here is an example showing how easy it is to visualize the histogram of a data loaded in the pool:
In this example, we use openCV and MatplotLib to automatically calculate an optimized parameter for thresholding the data based on various metrics. This technique ensures an accurate and objective selection of the high intensity phase.
In some cases it is beneficial to optimize binarization parameters by using the image itself to compute the threshold level (maximum entropy or mutual information between greyscale and binary) . The otsu method is a good example of this kind of auto-thresholding. The same methodology can be extrapolated to other binarization algorithms (i.e. top-hat, watershed, ...) or binary mask manipulation (erosion, opening, ...) associated with an image transformation (i.e. an image in which the separation power will be calculated). The general principle of such a tool has been easily prototyped in a Python script module.
Below is a simple example of thresholding using entropy or mutual information by using the image itself to compute the optimized threshold level. The thresholding is done based on OpenCV. Matplotlib allows to visualize the metric value based on the current threshold used. The automated optimized parameter is at the maximum of the curve.
Qt is set a of cross-platform C++ libraries that implements high-level APIs for accessing many aspects of modern desktop and mobile systems. PyQt5 is a comprehensive set of Python bindings for Qt v5. It is implemented as more than 35 extension modules.
Amira-Avizo Software and Pergeos Software are fully compatible with PyQt and allow creating PyQt applications in its own environment.
The screenshot below is based on a Python script module creating a PyQt application. This application creates a scatter plot of measures stored in a label-analysis.
Scatter plot of measures stored in a label-analysis created from a PyQt application