Tensor interpolation package
Project description
Image source Oreo: https://news.mit.edu/2022/oreometer-cream-0419
Graphic by Blarr
Interpolation of tensors of second and fourth order via decomposition approach
Disclaimer
This code was published alongside the raw data of the CT scans and the evaluated tensor data first as research data set here: https://doi.org/10.5445/IR/1000153725. The paper describing the scientific background and the methods underlying this repository is: Blarr, J., Sabiston, T., Krauß, C. et al. Implementation and comparison of algebraic and machine learning based tensor interpolation methods applied to fiber orientation tensor fields obtained from CT images. Computational Materials Science, 2023. If you use the code in this repository, please cite both DOIs.
Content
OrioPy is a Python package to interpolate fiber orientation tensors (or tensors of any kind for that matter) of second or fourth order. Both methods make use of the fact that symmetric positive definite tensors can be decomposed into eigenvalues and eigenvectors in spectral decomposition. In terms of the visualization of tensors in the form of tensor glyphs, the eigenvalues are responsible for the shape, while the eigenvectors are responsible for the orientation of the tensor in space.
In case of the tensors of fourth order, these eigenvalues and eigenvectors (in the form of the rotation matrix R) are directly weighted according to Shepard's inverse distance weighting, interpolated separately and then recomposed into a tensor.
In case of the orientation tensors of second order, instead of the eigenvalues another group of invariants, so-called orthogonal invariants, are used. The eigenvectors are also recalculated to quaternions and then interpolated. The reasons for this detour is explained in the paper mentioned above. The approach is additionally visualized in the following graphic:
Usage
In the folder "oriopy" there are three Python scripts. The "component_averaging_interpolation.py" and the "decomposition_interpolation.py" work the same: The script needs an input .txt-file with coordinates and the corresponding fiber orientation tensors (the example used in the publication is given in the folder "example" (file "input_file_FOT.txt")). After running the code you are asked in the console for the name of the output file and for lower and upper x and y limit, which are 1 and 13, respectively, in the given case. The scripts then calculate the fiber orientation tensors at all missing positions with the respective method, which are then written into a MATLAB file (which is named the way you input in the console). This MATLAB file is structured in a way that the fiber orientation tensors can be plotted directly with the tensor glyph visualization function of Barmpoutis ("plotDTI"): https://de.mathworks.com/matlabcentral/fileexchange/27462-diffusion-tensor-field-dti-visualization. The third file "4th_order_decomposition_interpolation.py" works basically the same way, aside from the fact that it needs fourth order tensors as an input and outputs fourth order tensors. In the "example"-folder, there is another input file named "input_file_FOT_4th_order.txt", which can be used for this purpose. Please be aware that there is the possibility for the visualization of fourth order tensors within the mentioned Matlab methods, however, this takes up quite some time to plot the entire field of fourth order tensors. Be free to only use the methods of the oriopy package for interpolation and write your own visualization function instead of using this Matlab visualization or the proposed main of the authors.
An example of a fiber orientation tensor field generated with the decomposition method for tensors of second order can be seen below.
Details and background
The authors originally determined fiber orientation tensors (FOT) of second and fourth order from µCT scans of carbon fiber reinforced polyamide 6 specimen. The C++ code for the FOT determination works with a structure tensor approach, is explained in this paper and can be found here: Pinter P, Dietrich S, Bertram B, Kehrer L, Elsner P, Weidenmann KA. Comparison and error estimation of 3D fibre orientation analysis of computed tomography image data for fibre reinforced composites. NDT & E International 2018; 95:26–35. https://doi.org/10.1016/j.ndteint.2018.01.001. https://sourceforge.net/p/composight/code/HEAD/tree/trunk/SiOTo/StructureTensorOrientation/FibreOrientation/StructureTensorOrientationFilter.cxx#l186
The specimens were cut from a 400 mm x 400 mm x 4 mm plate to 10 mm x 10 mm x 4 mm in order to be able to have a high enough resolution to detect fibers in the CT in general. That resulted in very local information of the fiber orientation in the plate. Hence, the idea was to generate a full field of FOT across the plate in order to gain a more holistic idea of the flow behavior in the process and of the mechanical properties of the plate. In the paper of Blarr et al., three tensor interpolation methods for tensors of second order were compared, of which the decomposition method showed the most reliable results and was therefore evolved into the oriopy package. The component averaging method can be found as well. Only the code for the ANN is not available here, but the Jupyter notebook can also be accessed through the data set mentioned above.
The method for the interpolation of tensors of fourth order was implemented later and is described in a following paper, where the results are also assessed in terms of their mechanical meaningfulness. Hence, the results are used for both the Mori Tanaka and the Halpin Tsai homogenization to predict stiffnesses, which are then compared to tensile test based results of Young's moduli.
For further questions, please consider the documentation in the paper Blarr et al. (2023).
Version
The current version oriopy 0.0.3 will be further developed into classes soon.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oriopy-0.0.4.tar.gz.
File metadata
- Download URL: oriopy-0.0.4.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a58cf7d091de87d402f9224848ac04afef116cca00fa9522e5d6fdaaed16050
|
|
| MD5 |
986a3ed699e1c104d231733c5b81c5b3
|
|
| BLAKE2b-256 |
701c6fd66bcc0e8a44e47d00f55f8731b5a5e18f364f7063369fb367e8a69a99
|
File details
Details for the file oriopy-0.0.4-py3-none-any.whl.
File metadata
- Download URL: oriopy-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2376ac0962d54fd3decd9d94db9c22748dce12cc46b6a08326a08f4761a63f09
|
|
| MD5 |
bda24dde51ce32d9e65e5859532af07d
|
|
| BLAKE2b-256 |
561613bfeb9162dc067c86cd425b70d1cb0f24324beb0d2243988baa5501b51c
|