Skip to content
Snippets Groups Projects
Commit aa7cb2f3 authored by s212246's avatar s212246 Committed by fima
Browse files

Plot for documentation

parent f5edf927
No related branches found
No related tags found
1 merge request!86Plot for documentation
docs/assets/screenshots/Local_thickness_time_mem_estimation.png

45.7 KiB

docs/assets/screenshots/Structure_tensor_time_mem_estimation.png

43.4 KiB

...@@ -17,6 +17,13 @@ def local_thickness( ...@@ -17,6 +17,13 @@ def local_thickness(
) -> np.ndarray: ) -> np.ndarray:
"""Wrapper for the local thickness function from the [local thickness package](https://github.com/vedranaa/local-thickness) """Wrapper for the local thickness function from the [local thickness package](https://github.com/vedranaa/local-thickness)
The "Fast Local Thickness" by Vedrana Andersen Dahl and Anders Bjorholm Dahl from the Technical University of Denmark is a efficient algorithm for computing local thickness in 2D and 3D images.
Their method significantly reduces computation time compared to traditional algorithms by utilizing iterative dilation with small structuring elements, rather than the large ones typically used.
This approach allows the local thickness to be determined much faster, making it feasible for high-resolution volumetric data that are common in contemporary 3D microscopy.
Testing against conventional methods and other Python-based tools like PoreSpy shows that the new algorithm is both accurate and faster, offering significant improvements in processing time for large datasets.
Args: Args:
image (np.ndarray): 2D or 3D NumPy array representing the image/volume. image (np.ndarray): 2D or 3D NumPy array representing the image/volume.
If binary, it will be passed directly to the local thickness function. If binary, it will be passed directly to the local thickness function.
...@@ -48,6 +55,11 @@ def local_thickness( ...@@ -48,6 +55,11 @@ def local_thickness(
``` ```
![local thickness 2d](assets/screenshots/local_thickness_2d.png) ![local thickness 2d](assets/screenshots/local_thickness_2d.png)
!!! info "Runtime and memory usage of the local thickness method for different volume sizes"
![local thickness estimate time and mem](assets/screenshots/Local_thickness_time_mem_estimation.png)
Performance computed on Intel(R) Xeon(R) Gold 6226 CPU @ 2.70GHz.
!!! quote "Reference" !!! quote "Reference"
Dahl, V. A., & Dahl, A. B. (2023, June). Fast Local Thickness. 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW). Dahl, V. A., & Dahl, A. B. (2023, June). Fast Local Thickness. 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW).
<https://doi.org/10.1109/cvprw59228.2023.00456> <https://doi.org/10.1109/cvprw59228.2023.00456>
...@@ -63,6 +75,9 @@ def local_thickness( ...@@ -63,6 +75,9 @@ def local_thickness(
month=jun } month=jun }
``` ```
""" """
# Check if input is binary # Check if input is binary
......
...@@ -16,6 +16,13 @@ def structure_tensor( ...@@ -16,6 +16,13 @@ def structure_tensor(
) -> Tuple[np.ndarray, np.ndarray]: ) -> Tuple[np.ndarray, np.ndarray]:
"""Wrapper for the 3D structure tensor implementation from the [structure_tensor package](https://github.com/Skielex/structure-tensor/) """Wrapper for the 3D structure tensor implementation from the [structure_tensor package](https://github.com/Skielex/structure-tensor/)
The structure tensor algorithm is a method for analyzing the orientation of fiber-like structures in 3D images.
The core of the algorithm involves computing a 3-by-3 matrix at each point in a volume, capturing the local orientation. This matrix, known as the structure tensor, is derived from the gradients of the image intensities and integrates neighborhood information using Gaussian kernels.
The implementation here used allows for fast and efficient computation using GPU-based processing, making it suitable for large datasets.
This efficiency is particularly advantageous for high-resolution imaging techniques like X-ray computed microtomography (μCT).
Args: Args:
vol (np.ndarray): 3D NumPy array representing the volume. vol (np.ndarray): 3D NumPy array representing the volume.
sigma (float, optional): A noise scale, structures smaller than sigma will be removed by smoothing. sigma (float, optional): A noise scale, structures smaller than sigma will be removed by smoothing.
...@@ -40,6 +47,13 @@ def structure_tensor( ...@@ -40,6 +47,13 @@ def structure_tensor(
``` ```
![structure tensor](assets/screenshots/structure_tensor.gif) ![structure tensor](assets/screenshots/structure_tensor.gif)
!!! info "Runtime and memory usage of the structure tensor method for different volume sizes"
![structure tensor estimate time and mem](assets/screenshots/Structure_tensor_time_mem_estimation.png)
Performance computed on Intel(R) Xeon(R) Gold 6226 CPU @ 2.70GHz.
!!! quote "Reference" !!! quote "Reference"
Jeppesen, N., et al. "Quantifying effects of manufacturing methods on fiber orientation in unidirectional composites using structure tensor analysis." Composites Part A: Applied Science and Manufacturing 149 (2021): 106541. Jeppesen, N., et al. "Quantifying effects of manufacturing methods on fiber orientation in unidirectional composites using structure tensor analysis." Composites Part A: Applied Science and Manufacturing 149 (2021): 106541.
<https://doi.org/10.1016/j.compositesa.2021.106541> <https://doi.org/10.1016/j.compositesa.2021.106541>
...@@ -58,6 +72,7 @@ def structure_tensor( ...@@ -58,6 +72,7 @@ def structure_tensor(
} }
``` ```
""" """
if vol.ndim != 3: if vol.ndim != 3:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment