Skip to content
Snippets Groups Projects
Commit f099d6e4 authored by s193396's avatar s193396
Browse files

Added more example notebooks

parent 08732620
No related branches found
No related tags found
1 merge request!75Added more example notebooks
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
%% Cell type:code id: tags:
``` python
import qim3d
```
%% Output
WARNING:root:Could not load CuPy: No module named 'cupy'
%% Cell type:markdown id: tags:
### Structure tensor notebook
%% Cell type:markdown id: tags:
This notebook shows how to compute eigenvalues and eigenvectors of the **structure tensor** of a 3D volume using the `qim3d` library. The structure tensor (matrix) represents information about the local gradient directions in the volume, such that the eigenvectors represent the orientation of the structure in the volume, and the corresponding eigenvaleus indicate the magnitude.
The function `qim3d.processing.structure_tensor` returns two arrays `val` and `vec` for the eigenvalues and eigenvectors, respectively.\
By having the argument `visulize = True`, the function displays two figures:
* Slice of volume with vector field of the eigenvectors
* Orientation histogram of the eigenvectors
%% Cell type:markdown id: tags:
### **Example 1**: Structure tensor of bone volume
%% Cell type:code id: tags:
``` python
# Import 3D volume of bone
bone = qim3d.examples.bone_128x128x128
# Compute eigenvalues and eigenvectors of the structure tensor
val, vec = qim3d.processing.structure_tensor(bone, visualize = True, axis = 1)
```
%% Output
%% Cell type:markdown id: tags:
### **Example 2:** Structure tensor of brain tissue volume
%% Cell type:code id: tags:
``` python
# Import 3D volume of brain tissue
NT = qim3d.examples.NT_128x128x128
# Compute eigenvalues and eigenvectors of the structure tensor
val, vec = qim3d.processing.structure_tensor(NT, visualize = True, axis = 2)
```
%% Output
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment