Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,6 @@ venv/

# Dask
dask-worker-space/

# MyST build outputs
_build
3 changes: 0 additions & 3 deletions docs/01_code_usage/01_toolboxes/Readme.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/01_code_usage/02_example_workflows/Readme.md

This file was deleted.

2 changes: 0 additions & 2 deletions docs/02_interactive_usage/01_toolboxes/Readme.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/02_interactive_usage/02_example_workflows/Readme.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ This tutorial shows how to handle ellipse-fitting in napari-stress. It covers th

To get started, create a pointcloud according to the workflow suggestions in this repository or load the sample data from napari-stress (`File > Open Sample > napari-stress: Dropplet pointcloud`).

![](../../imgs/viewer_screenshots/open_sample_droplet.png)
![](../../imgs/viewer_screenshots/open_sample_droplet1.png)
![](../imgs/viewer_screenshots/open_sample_droplet.png)
![](../imgs/viewer_screenshots/open_sample_droplet1.png)

(fit_ellipsoid:major_minor_axes)=
## Finding the major and minor axes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

This tutorial will explain how to perform a spherical harmonics surface expansion with napari-stress interactively from the napari viewer. To get started, open your own data or use the provided sample data from napari-stress ([raw data source](https://github.com/campaslab/STRESS)):

![](../../imgs/viewer_screenshots/open_sample_droplet.png)
![](../../imgs/viewer_screenshots/open_sample_droplet1.png)
![](../imgs/viewer_screenshots/open_sample_droplet.png)
![](../imgs/viewer_screenshots/open_sample_droplet1.png)

You can then approximate this pointcloud with a [](spherical_harmonics:mathematical_basics) expansion. In brief, this fits a set of basis functions to the input pointcloud and returns an analytical representation of the points on the surface. This then allows to sample any number of points on the approximated surface and derive further characteristic surface parameters.

Select the spherical harmonics expansion from the tools menu (`Tools > Points > Fit spherical harmonics (n-STRESS)`):

![](../../imgs/viewer_screenshots/fit_spherical_harmonics.png)
![](../imgs/viewer_screenshots/fit_spherical_harmonics.png)

This will bring up a dialogue with the available options:

Expand All @@ -25,21 +25,21 @@ This will bring up a dialogue with the available options:

Applying a spherical harmonics expansion of `max_degree = 5` will lead to the following result. The colorcoding of the fitted points corresponds to the fit remainder of the spherical harmonics expansion.

![](../../imgs/viewer_screenshots/fit_spherical_harmonics2.png)
![](../imgs/viewer_screenshots/fit_spherical_harmonics2.png)

Lowering the value to `max_degree = 1` will lead to only the first *mode* of spherical harmonics being used, which corresponds to fitting a sphere to the pointcloud:

![](../../imgs/viewer_screenshots/fit_spherical_harmonics3.png)
![](../imgs/viewer_screenshots/fit_spherical_harmonics3.png)

**Layer display settings**

napari may default to innapropriate settings for the pointcloud (e.g., inproper point size or color). To change this, select the malformated layer, click the `select_points` icon in the top left:

![](../../imgs/viewer_screenshots/change_layer_settings.png)
![](../imgs/viewer_screenshots/change_layer_settings.png)

Then, drag a box over all points and change the point size and face color with the slider and the color selecter, respectively. Alternatively, you can also open the code terminal with the icon in the bottom-left:

![](../../imgs/viewer_screenshots/open_terminal.png)
![](../imgs/viewer_screenshots/open_terminal.png)

and type:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@

This tutorial will explain how to perform a surface reconstruction with napari-stress interactively from the napari viewer. This plugin implements the [respective function](https://vedo.embl.es/autodocs/content/vedo/pointcloud.html#vedo.pointcloud.Points.reconstructSurface) from the [vedo](https://vedo.embl.es) library. To get started, open your own data or use the provided sample data from napari-stress ([raw data source](https://github.com/campaslab/STRESS)):

![](../../imgs/viewer_screenshots/open_sample_droplet.png)
![](../../imgs/viewer_screenshots/open_sample_droplet1.png)
![](../imgs/viewer_screenshots/open_sample_droplet.png)
![](../imgs/viewer_screenshots/open_sample_droplet1.png)

Select the `Reconstruct surface` function from the plugin menu:

![](../../imgs/viewer_screenshots/reconstruct_surface.png)
![](../imgs/viewer_screenshots/reconstruct_surface.png)

This will bring up the plugin widget:

![](../../imgs/viewer_screenshots/reconstruct_surface1.png)
![](../imgs/viewer_screenshots/reconstruct_surface1.png)

## Results

The `radius` controls the search radius of the algorithm: To reconstruct a surface, the function finds all neighboring points for a given point in the pointcloud to be considered for a surface. Setting this value too low will result in a leaky surface:

![](../../imgs/viewer_screenshots/reconstruct_surface2.png)
![](../imgs/viewer_screenshots/reconstruct_surface2.png)

In creasing the value will fix this issue:

![](../../imgs/viewer_screenshots/reconstruct_surface3.png)
![](../imgs/viewer_screenshots/reconstruct_surface3.png)

Such surfaces typically consist of a large ammount of vertices. This behaviour can be control with the `padding` parameter: Increasing it will simplify the obtained surface representation:

![](../../imgs/viewer_screenshots/reconstruct_surface4.png)
![](../imgs/viewer_screenshots/reconstruct_surface4.png)

If you are interested in doing this from code, check out this [example notebook](glossary:surface_reconstruction:code)=
49 changes: 19 additions & 30 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,32 @@ options:
numbered: False

parts:

- caption: Usage
chapters:
- file: 01_code_usage/code_usage
sections:
- file: 01_code_usage/01_toolboxes/Readme
sections:
- file: 01_code_usage/01_toolboxes/demo_droplet_reconstruction_toolbox_code
- file: 01_code_usage/01_toolboxes/demo_anisotropic_stresses
- file: 01_code_usage/01_toolboxes/demo_analyze_everything
- file: 01_code_usage/01_toolboxes/demo_analyze_everything_batch

- file: 01_code_usage/02_example_workflows/Readme
sections:
- file: 01_code_usage/02_example_workflows/demo_fit_ellipsoid_code
- file: 01_code_usage/02_example_workflows/demo_measure_patch_fitted_curvature
- file: 01_code_usage/02_example_workflows/demo_surface_reconstruction_code
- file: 01_code_usage/02_example_workflows/demo_surface_tracing
- file: 01_code_usage/02_example_workflows/demo_patch_fitting_reconstruction
- file: 01_code_usage/02_example_workflows/demo_spherical_harmonics_code
- file: 01_code_usage/02_example_workflows/demo_measure_intensity_on_surface
- file: 01_code_usage/02_example_workflows/demo_measure_intensity_on_vectors
- file: 01_code_usage/demo_droplet_reconstruction_toolbox_code
- file: 01_code_usage/demo_anisotropic_stresses
- file: 01_code_usage/demo_analyze_everything
- file: 01_code_usage/demo_analyze_everything_batch
- file: 01_code_usage/demo_fit_ellipsoid_code
- file: 01_code_usage/demo_measure_patch_fitted_curvature
- file: 01_code_usage/demo_surface_reconstruction_code
- file: 01_code_usage/demo_surface_tracing
- file: 01_code_usage/demo_patch_fitting_reconstruction
- file: 01_code_usage/demo_spherical_harmonics_code
- file: 01_code_usage/demo_measure_intensity_on_surface
- file: 01_code_usage/demo_measure_intensity_on_vectors

- file: 02_interactive_usage/interactive_usage
sections:
- file: 02_interactive_usage/01_toolboxes/Readme
sections:
- file: 02_interactive_usage/01_toolboxes/demo_droplet_reconstruction_toolbox
- file: 02_interactive_usage/01_toolboxes/demo_stress_toolbox_interactive

- file: 02_interactive_usage/02_example_workflows/Readme
sections:
- file: 02_interactive_usage/02_example_workflows/demo_fit_ellipsoid_interactive
- file: 02_interactive_usage/02_example_workflows/demo_surface_reconstruction_interactive
- file: 02_interactive_usage/02_example_workflows/demo_spherical_harmonics_interactive
- file: 02_interactive_usage/02_example_workflows/demo_measure_curvature
- file: 02_interactive_usage/02_example_workflows/visualize_measurements_in_viewer
- file: 02_interactive_usage/demo_droplet_reconstruction_toolbox
- file: 02_interactive_usage/demo_stress_toolbox_interactive
- file: 02_interactive_usage/demo_fit_ellipsoid_interactive
- file: 02_interactive_usage/demo_surface_reconstruction_interactive
- file: 02_interactive_usage/demo_spherical_harmonics_interactive
- file: 02_interactive_usage/demo_measure_curvature
- file: 02_interactive_usage/visualize_measurements_in_viewer

- caption: Glossary
chapters:
Expand Down
4 changes: 2 additions & 2 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Welcome to the documentation for napari-stress! This ressource provides informat

## Contents

- [Usage from code](topic:01_code_usage): Overview about modular functions in napari-stress and how to use them from code or interactively from the napari viewer. Among others, you'll find examples for how to use [toolbox functions](topic:01_code_usage:toolboxes), which bundle up many functionalities of the STRESS workflow in few lines of code.
- [Usage from code](topic:01_code_usage): Overview about modular functions in napari-stress and how to use them from code or interactively from the napari viewer. Among others, you'll find examples for how to use toolbox functions, which bundle up many functionalities of the STRESS workflow in few lines of code. See demo notebook for [reconstruction and analysis](toolboxes:analyze_everything)

- [Interactive usage](topic:interactive_usage): If you want to do the analysis in an interactive fashion, you can do so directly in the napari viewer. Again, the provided [toolboxes](topic:interactive_usage:toolboxes).
- [Interactive usage](topic:interactive_usage): If you want to do the analysis in an interactive fashion, you can do so directly in the napari viewer. Again, the provided toolboxes for [reconstruction](glossary:surface_reconstruction:interactive) and [measurement](toolboxes:stress_toolbox:stress_toolbox_interactive) should come in handy.

![](imgs/viewer_screenshots/all_outputs.png)

Expand Down
Loading