Skip to content
Snippets Groups Projects
Commit 25724b70 authored by fima's avatar fima :beers:
Browse files

Merge branch 'doc_update_for_v1.0' into 'main'

Doc update for v1.0

See merge request !149
parents 0a6b3a78 2081a3c7
No related branches found
No related tags found
1 merge request!149Doc update for v1.0
Showing
with 39 additions and 39 deletions
...@@ -199,14 +199,14 @@ def noise_object_collection( ...@@ -199,14 +199,14 @@ def noise_object_collection(
```python ```python
qim3d.viz.slicer(synthetic_collection) qim3d.viz.slicer(synthetic_collection)
``` ```
![synthetic_collection](assets/screenshots/synthetic_collection_default.gif) ![synthetic_collection](../../assets/screenshots/synthetic_collection_default.gif)
```python ```python
# Visualize labels # Visualize labels
cmap = qim3d.viz.colormaps.segmentation(num_labels=num_objects) cmap = qim3d.viz.colormaps.segmentation(num_labels=num_objects)
qim3d.viz.slicer(labels, color_map=cmap, value_max=num_objects) qim3d.viz.slicer(labels, color_map=cmap, value_max=num_objects)
``` ```
![synthetic_collection](assets/screenshots/synthetic_collection_default_labels.gif) ![synthetic_collection](../../assets/screenshots/synthetic_collection_default_labels.gif)
Example: Example:
```python ```python
...@@ -257,7 +257,7 @@ def noise_object_collection( ...@@ -257,7 +257,7 @@ def noise_object_collection(
# Visualize slices # Visualize slices
qim3d.viz.slices_grid(vol, num_slices=15) qim3d.viz.slices_grid(vol, num_slices=15)
``` ```
![synthetic_collection_cylinder](assets/screenshots/synthetic_collection_cylinder_slices.png) ![synthetic_collection_cylinder](../../assets/screenshots/synthetic_collection_cylinder_slices.png)
Example: Example:
```python ```python
...@@ -287,7 +287,7 @@ def noise_object_collection( ...@@ -287,7 +287,7 @@ def noise_object_collection(
# Visualize slices # Visualize slices
qim3d.viz.slices_grid(vol, num_slices=15, slice_axis=1) qim3d.viz.slices_grid(vol, num_slices=15, slice_axis=1)
``` ```
![synthetic_collection_tube](assets/screenshots/synthetic_collection_tube_slices.png) ![synthetic_collection_tube](../../assets/screenshots/synthetic_collection_tube_slices.png)
""" """
if verbose: if verbose:
original_log_level = log.getEffectiveLevel() original_log_level = log.getEffectiveLevel()
......
...@@ -54,7 +54,7 @@ def noise_object( ...@@ -54,7 +54,7 @@ def noise_object(
# Visualize slices # Visualize slices
qim3d.viz.slices_grid(vol, value_min = 0, value_max = 255, num_slices = 15) qim3d.viz.slices_grid(vol, value_min = 0, value_max = 255, num_slices = 15)
``` ```
![synthetic_blob](assets/screenshots/synthetic_blob_slices.png) ![synthetic_blob](../../assets/screenshots/synthetic_blob_slices.png)
Example: Example:
```python ```python
...@@ -78,7 +78,7 @@ def noise_object( ...@@ -78,7 +78,7 @@ def noise_object(
# Visualize slices # Visualize slices
qim3d.viz.slices_grid(vol, num_slices=15, slice_axis=1) qim3d.viz.slices_grid(vol, num_slices=15, slice_axis=1)
``` ```
![synthetic_blob_cylinder_slice](assets/screenshots/synthetic_blob_cylinder_slice.png) ![synthetic_blob_cylinder_slice](../../assets/screenshots/synthetic_blob_cylinder_slice.png)
Example: Example:
```python ```python
...@@ -102,7 +102,7 @@ def noise_object( ...@@ -102,7 +102,7 @@ def noise_object(
# Visualize # Visualize
qim3d.viz.slices_grid(vol, num_slices=15) qim3d.viz.slices_grid(vol, num_slices=15)
``` ```
![synthetic_blob_tube_slice](assets/screenshots/synthetic_blob_tube_slice.png) ![synthetic_blob_tube_slice](../../assets/screenshots/synthetic_blob_tube_slice.png)
""" """
if not isinstance(final_shape, tuple) or len(final_shape) != 3: if not isinstance(final_shape, tuple) or len(final_shape) != 3:
......
...@@ -16,7 +16,7 @@ annotation_tool = qim3d.gui.annotation_tool.Interface() ...@@ -16,7 +16,7 @@ annotation_tool = qim3d.gui.annotation_tool.Interface()
# We can directly pass the image we loaded to the interface # We can directly pass the image we loaded to the interface
app = annotation_tool.launch(vol[0]) app = annotation_tool.launch(vol[0])
``` ```
![gui-annotation_tool](assets/screenshots/gui-annotation_tool.gif) ![gui-annotation_tool](../../assets/screenshots/gui-annotation_tool.gif)
""" """
......
...@@ -13,7 +13,7 @@ import qim3d ...@@ -13,7 +13,7 @@ import qim3d
layers = qim3d.gui.layers2d.Interface() layers = qim3d.gui.layers2d.Interface()
app = layers.launch() app = layers.launch()
``` ```
![gui-layers](assets/screenshots/GUI-layers.png) ![gui-layers](../../assets/screenshots/GUI-layers.png)
""" """
......
...@@ -54,7 +54,7 @@ class Downloader: ...@@ -54,7 +54,7 @@ class Downloader:
qim3d.viz.slicer_orthogonal(data, color_map="magma") qim3d.viz.slicer_orthogonal(data, color_map="magma")
``` ```
![cowry shell](assets/screenshots/cowry_shell_slicer.gif) ![cowry shell](../../assets/screenshots/cowry_shell_slicer.gif)
""" """
def __init__(self): def __init__(self):
......
...@@ -32,7 +32,7 @@ def remove_background( ...@@ -32,7 +32,7 @@ def remove_background(
vol = qim3d.examples.cement_128x128x128 vol = qim3d.examples.cement_128x128x128
fig1 = qim3d.viz.slices_grid(vol, value_min=0, value_max=255, num_slices=5, display_figure=True) fig1 = qim3d.viz.slices_grid(vol, value_min=0, value_max=255, num_slices=5, display_figure=True)
``` ```
![operations-remove_background_before](assets/screenshots/operations-remove_background_before.png) ![operations-remove_background_before](../../assets/screenshots/operations-remove_background_before.png)
```python ```python
vol_filtered = qim3d.operations.remove_background(vol, vol_filtered = qim3d.operations.remove_background(vol,
...@@ -40,7 +40,7 @@ def remove_background( ...@@ -40,7 +40,7 @@ def remove_background(
background="bright") background="bright")
fig2 = qim3d.viz.slices_grid(vol_filtered, value_min=0, value_max=255, num_slices=5, display_figure=True) fig2 = qim3d.viz.slices_grid(vol_filtered, value_min=0, value_max=255, num_slices=5, display_figure=True)
``` ```
![operations-remove_background_after](assets/screenshots/operations-remove_background_after.png) ![operations-remove_background_after](../../assets/screenshots/operations-remove_background_after.png)
""" """
# Create a pipeline with a median filter and a tophat filter # Create a pipeline with a median filter and a tophat filter
...@@ -85,7 +85,7 @@ def fade_mask( ...@@ -85,7 +85,7 @@ def fade_mask(
qim3d.viz.volumetric(vol) qim3d.viz.volumetric(vol)
``` ```
Image before edge fading has visible artifacts from the support. Which obscures the object of interest. Image before edge fading has visible artifacts from the support. Which obscures the object of interest.
![operations-edge_fade_before](assets/screenshots/operations-edge_fade_before.png) ![operations-edge_fade_before](../../assets/screenshots/operations-edge_fade_before.png)
```python ```python
import qim3d import qim3d
...@@ -93,7 +93,7 @@ def fade_mask( ...@@ -93,7 +93,7 @@ def fade_mask(
qim3d.viz.volumetrics(vol_faded) qim3d.viz.volumetrics(vol_faded)
``` ```
Afterwards the artifacts are faded out, making the object of interest more visible for visualization purposes. Afterwards the artifacts are faded out, making the object of interest more visible for visualization purposes.
![operations-edge_fade_after](assets/screenshots/operations-edge_fade_after.png) ![operations-edge_fade_after](../../assets/screenshots/operations-edge_fade_after.png)
""" """
if 0 > axis or axis >= vol.ndim: if 0 > axis or axis >= vol.ndim:
......
...@@ -47,8 +47,8 @@ def segment_layers(data: np.ndarray, ...@@ -47,8 +47,8 @@ def segment_layers(data: np.ndarray,
for layer_line in layer_lines: for layer_line in layer_lines:
plt.plot(layer_line, linewidth = 3) plt.plot(layer_line, linewidth = 3)
``` ```
![layer_segmentation](assets/screenshots/layers.png) ![layer_segmentation](../../assets/screenshots/layers.png)
![layer_segmentation](assets/screenshots/segmented_layers.png) ![layer_segmentation](../../assets/screenshots/segmented_layers.png)
""" """
if isinstance(data, np.ndarray): if isinstance(data, np.ndarray):
......
...@@ -43,7 +43,7 @@ def local_thickness( ...@@ -43,7 +43,7 @@ def local_thickness(
vol = qim3d.examples.fly_150x256x256 vol = qim3d.examples.fly_150x256x256
lt_vol = qim3d.processing.local_thickness(vol, visualize=True, axis=0) lt_vol = qim3d.processing.local_thickness(vol, visualize=True, axis=0)
``` ```
![local thickness 3d](assets/screenshots/local_thickness_3d.gif) ![local thickness 3d](../../assets/screenshots/local_thickness_3d.gif)
```python ```python
import qim3d import qim3d
...@@ -56,10 +56,10 @@ def local_thickness( ...@@ -56,10 +56,10 @@ def local_thickness(
lt_blobs = qim3d.processing.local_thickness(slice, visualize=True) lt_blobs = qim3d.processing.local_thickness(slice, visualize=True)
``` ```
![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" !!! 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) ![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. Performance computed on Intel(R) Xeon(R) Gold 6226 CPU @ 2.70GHz.
......
...@@ -47,11 +47,11 @@ def structure_tensor( ...@@ -47,11 +47,11 @@ def structure_tensor(
vol = qim3d.examples.NT_128x128x128 vol = qim3d.examples.NT_128x128x128
val, vec = qim3d.processing.structure_tensor(vol, visualize = True, axis = 2) val, vec = qim3d.processing.structure_tensor(vol, visualize = True, axis = 2)
``` ```
![structure tensor](assets/screenshots/structure_tensor_visualization.gif) ![structure tensor](../../assets/screenshots/structure_tensor_visualization.gif)
!!! info "Runtime and memory usage of the structure tensor method for different volume sizes" !!! 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) ![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. Performance computed on Intel(R) Xeon(R) Gold 6226 CPU @ 2.70GHz.
......
...@@ -26,7 +26,7 @@ def watershed(bin_vol: np.ndarray, min_distance: int = 5) -> tuple[np.ndarray, i ...@@ -26,7 +26,7 @@ def watershed(bin_vol: np.ndarray, min_distance: int = 5) -> tuple[np.ndarray, i
fig1 = qim3d.viz.slices_grid(bin_vol, slice_axis=1, display_figure=True) fig1 = qim3d.viz.slices_grid(bin_vol, slice_axis=1, display_figure=True)
``` ```
![operations-watershed_before](assets/screenshots/operations-watershed_before.png) ![operations-watershed_before](../../assets/screenshots/operations-watershed_before.png)
```python ```python
labeled_volume, num_labels = qim3d.segmentation.watershed(bin_vol) labeled_volume, num_labels = qim3d.segmentation.watershed(bin_vol)
...@@ -34,7 +34,7 @@ def watershed(bin_vol: np.ndarray, min_distance: int = 5) -> tuple[np.ndarray, i ...@@ -34,7 +34,7 @@ def watershed(bin_vol: np.ndarray, min_distance: int = 5) -> tuple[np.ndarray, i
cmap = qim3d.viz.colormaps.segmentation(num_labels) cmap = qim3d.viz.colormaps.segmentation(num_labels)
fig2 = qim3d.viz.slices_grid(labeled_volume, slice_axis=1, color_map=cmap, display_figure=True) fig2 = qim3d.viz.slices_grid(labeled_volume, slice_axis=1, color_map=cmap, display_figure=True)
``` ```
![operations-watershed_after](assets/screenshots/operations-watershed_after.png) ![operations-watershed_after](../../assets/screenshots/operations-watershed_after.png)
""" """
import skimage import skimage
......
...@@ -43,8 +43,8 @@ def plot_cc( ...@@ -43,8 +43,8 @@ def plot_cc(
qim3d.viz.plot_cc(cc, crop=True, display_figure=True, overlay=None, num_slices=5, component_indexs=[4,6,7]) qim3d.viz.plot_cc(cc, crop=True, display_figure=True, overlay=None, num_slices=5, component_indexs=[4,6,7])
qim3d.viz.plot_cc(cc, crop=True, display_figure=True, overlay=vol, num_slices=5, component_indexs=[4,6,7]) qim3d.viz.plot_cc(cc, crop=True, display_figure=True, overlay=vol, num_slices=5, component_indexs=[4,6,7])
``` ```
![plot_cc_no_overlay](assets/screenshots/plot_cc_no_overlay.png) ![plot_cc_no_overlay](../../assets/screenshots/plot_cc_no_overlay.png)
![plot_cc_overlay](assets/screenshots/plot_cc_overlay.png) ![plot_cc_overlay](../../assets/screenshots/plot_cc_overlay.png)
""" """
# if no components are given, plot the first max_cc_to_plot=32 components # if no components are given, plot the first max_cc_to_plot=32 components
if component_indexs is None: if component_indexs is None:
......
...@@ -81,7 +81,7 @@ def slices_grid( ...@@ -81,7 +81,7 @@ def slices_grid(
vol = qim3d.examples.shell_225x128x128 vol = qim3d.examples.shell_225x128x128
qim3d.viz.slices_grid(vol, num_slices=15) qim3d.viz.slices_grid(vol, num_slices=15)
``` ```
![Grid of slices](assets/screenshots/viz-slices.png) ![Grid of slices](../../assets/screenshots/viz-slices.png)
""" """
if image_size: if image_size:
image_height = image_size image_height = image_size
...@@ -354,7 +354,7 @@ def slicer( ...@@ -354,7 +354,7 @@ def slicer(
vol = qim3d.examples.bone_128x128x128 vol = qim3d.examples.bone_128x128x128
qim3d.viz.slicer(vol) qim3d.viz.slicer(vol)
``` ```
![viz slicer](assets/screenshots/viz-slicer.gif) ![viz slicer](../../assets/screenshots/viz-slicer.gif)
""" """
if image_size: if image_size:
...@@ -427,7 +427,7 @@ def slicer_orthogonal( ...@@ -427,7 +427,7 @@ def slicer_orthogonal(
vol = qim3d.examples.fly_150x256x256 vol = qim3d.examples.fly_150x256x256
qim3d.viz.slicer_orthogonal(vol, color_map="magma") qim3d.viz.slicer_orthogonal(vol, color_map="magma")
``` ```
![viz slicer_orthogonal](assets/screenshots/viz-orthogonal.gif) ![viz slicer_orthogonal](../../assets/screenshots/viz-orthogonal.gif)
""" """
if image_size: if image_size:
...@@ -484,7 +484,7 @@ def fade_mask( ...@@ -484,7 +484,7 @@ def fade_mask(
vol = qim3d.examples.cement_128x128x128 vol = qim3d.examples.cement_128x128x128
qim3d.viz.fade_mask(vol) qim3d.viz.fade_mask(vol)
``` ```
![operations-edge_fade_before](assets/screenshots/viz-fade_mask.gif) ![operations-edge_fade_before](../../assets/screenshots/viz-fade_mask.gif)
""" """
...@@ -623,7 +623,7 @@ def chunks(zarr_path: str, **kwargs)-> widgets.interactive: ...@@ -623,7 +623,7 @@ def chunks(zarr_path: str, **kwargs)-> widgets.interactive:
# Explore chunks # Explore chunks
qim3d.viz.chunks("Escargot.zarr") qim3d.viz.chunks("Escargot.zarr")
``` ```
![chunks-visualization](assets/screenshots/chunks_visualization.gif) ![chunks-visualization](../../assets/screenshots/chunks_visualization.gif)
""" """
# Load the Zarr dataset # Load the Zarr dataset
...@@ -904,7 +904,7 @@ def histogram( ...@@ -904,7 +904,7 @@ def histogram(
vol = qim3d.examples.bone_128x128x128 vol = qim3d.examples.bone_128x128x128
qim3d.viz.histogram(vol) qim3d.viz.histogram(vol)
``` ```
![viz histogram](assets/screenshots/viz-histogram-vol.png) ![viz histogram](../../assets/screenshots/viz-histogram-vol.png)
```python ```python
import qim3d import qim3d
...@@ -912,7 +912,7 @@ def histogram( ...@@ -912,7 +912,7 @@ def histogram(
vol = qim3d.examples.bone_128x128x128 vol = qim3d.examples.bone_128x128x128
qim3d.viz.histogram(vol, bins=32, slice_idx="middle", axis=1, kde=False, log_scale=True) qim3d.viz.histogram(vol, bins=32, slice_idx="middle", axis=1, kde=False, log_scale=True)
``` ```
![viz histogram](assets/screenshots/viz-histogram-slice.png) ![viz histogram](../../assets/screenshots/viz-histogram-slice.png)
""" """
if not (0 <= axis < volume.ndim): if not (0 <= axis < volume.ndim):
......
...@@ -46,7 +46,7 @@ def circles(blobs: tuple[float,float,float,float], vol: np.ndarray, alpha: float ...@@ -46,7 +46,7 @@ def circles(blobs: tuple[float,float,float,float], vol: np.ndarray, alpha: float
# Visualize detected blobs with circles method # Visualize detected blobs with circles method
qim3d.viz.circles(blobs, vol, alpha=0.8, color='blue') qim3d.viz.circles(blobs, vol, alpha=0.8, color='blue')
``` ```
![blob detection](assets/screenshots/blob_detection.gif) ![blob detection](../../assets/screenshots/blob_detection.gif)
""" """
def _slicer(z_slice): def _slicer(z_slice):
......
...@@ -46,7 +46,7 @@ def local_thickness( ...@@ -46,7 +46,7 @@ def local_thickness(
lt_fly = qim3d.processing.local_thickness(fly) lt_fly = qim3d.processing.local_thickness(fly)
qim3d.viz.local_thickness(fly, lt_fly, axis=0) qim3d.viz.local_thickness(fly, lt_fly, axis=0)
``` ```
![local thickness 3d](assets/screenshots/local_thickness_3d.gif) ![local thickness 3d](../../assets/screenshots/local_thickness_3d.gif)
""" """
......
...@@ -69,7 +69,7 @@ def vectors( ...@@ -69,7 +69,7 @@ def vectors(
# Visualize the structure tensor # Visualize the structure tensor
qim3d.viz.vectors(vol, vec, axis = 2, interactive = True) qim3d.viz.vectors(vol, vec, axis = 2, interactive = True)
``` ```
![structure tensor](assets/screenshots/structure_tensor_visualization.gif) ![structure tensor](../../assets/screenshots/structure_tensor_visualization.gif)
""" """
......
...@@ -19,6 +19,6 @@ Example: ...@@ -19,6 +19,6 @@ Example:
display(qim3d.viz.colormaps.qim) display(qim3d.viz.colormaps.qim)
``` ```
![colormap objects](assets/screenshots/viz-colormaps-qim.png) ![colormap objects](../../assets/screenshots/viz-colormaps-qim.png)
""" """
colormaps.register(qim) colormaps.register(qim)
...@@ -71,7 +71,7 @@ def segmentation( ...@@ -71,7 +71,7 @@ def segmentation(
display(cmap_earth) display(cmap_earth)
display(cmap_ocean) display(cmap_ocean)
``` ```
![colormap objects](assets/screenshots/viz-colormaps-objects-all.png) ![colormap objects](../../assets/screenshots/viz-colormaps-objects-all.png)
```python ```python
import qim3d import qim3d
...@@ -83,7 +83,7 @@ def segmentation( ...@@ -83,7 +83,7 @@ def segmentation(
color_map = qim3d.viz.colormaps.segmentation(num_labels, style = 'bright') color_map = qim3d.viz.colormaps.segmentation(num_labels, style = 'bright')
qim3d.viz.slicer(labeled_volume, slice_axis = 1, color_map=color_map) qim3d.viz.slicer(labeled_volume, slice_axis = 1, color_map=color_map)
``` ```
![colormap objects](assets/screenshots/viz-colormaps-objects.gif) ![colormap objects](../../assets/screenshots/viz-colormaps-objects.gif)
Tip: Tip:
It can be easily used when calling visualization functions as It can be easily used when calling visualization functions as
...@@ -95,7 +95,7 @@ def segmentation( ...@@ -95,7 +95,7 @@ def segmentation(
Tip: Tip:
The `min_dist` parameter can be used to control the distance between neighboring colors. The `min_dist` parameter can be used to control the distance between neighboring colors.
![colormap objects mind_dist](assets/screenshots/viz-colormaps-min_dist.gif) ![colormap objects mind_dist](../../assets/screenshots/viz-colormaps-min_dist.gif)
""" """
from skimage import color from skimage import color
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment