Skip to content

Commit

Permalink
Merge pull request #23 from haesleinhuepf/open3d-vedo-conversion
Browse files Browse the repository at this point in the history
Open3d vedo conversion
  • Loading branch information
haesleinhuepf authored Feb 18, 2023
2 parents a6c9113 + 72d9c95 commit 4300db3
Show file tree
Hide file tree
Showing 28 changed files with 9,437 additions and 1,108 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
# this runs the platform-specific tests declared in tox.ini
- name: Test with tox
uses: GabrielBB/xvfb-action@v1
uses: aganders3/headless-gui@v1
with:
run: python -m tox
env:
Expand Down
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Development Status](https://img.shields.io/pypi/status/napari-process-points-and-surfaces.svg)](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-process-points-and-surfaces)](https://napari-hub.org/plugins/napari-process-points-and-surfaces)

Process and analyze surfaces using [open3d](http://www.open3d.org/) and [vedo](https://vedo.embl.es/) in [napari].
Process and analyze surfaces using [vedo](https://vedo.embl.es/) in [napari].

## Usage

Expand All @@ -21,12 +21,12 @@ The Standford Bunny example dataset has been taken from the [The Stanford 3D Sca

For processing meshes in Python scripts, see the [demo notebook](https://github.com/haesleinhuepf/napari-process-points-and-surfaces/blob/main/docs/demo.ipynb). There you also learn how this screenshot is made:

![img.png](https://github.com/haesleinhuepf/napari-process-points-and-surfaces/raw/main/docs/screenshot.png)
![img.png](https://github.com/haesleinhuepf/napari-process-points-and-surfaces/raw/main/docs/screenshot1.png)

For performing quantitative measurements of meshes in Python scripts, see the [demo notebook](https://github.com/haesleinhuepf/napari-process-points-and-surfaces/blob/main/docs/quality_measurements.ipynb).
There you also learn how this screenshot is made:

![img.png](https://github.com/haesleinhuepf/napari-process-points-and-surfaces/raw/main/docs/screenshot2.png)
![img.png](https://github.com/haesleinhuepf/napari-process-points-and-surfaces/raw/main/docs/screenshot4.png)

### Surface measurements and annotations

Expand Down Expand Up @@ -57,20 +57,28 @@ measurements and annotations side-by-side.

## Installation

You can install `napari-process-points-and-surfaces` via [pip] and conda:
You can install `napari-process-points-and-surfaces` via mamba/conda and pip:

```
conda create -n nppas-env -c conda-forge -c open3d-admin python=3.9 open3d napari
conda activate nppas-env
mamba install vedo vtk libnetcdf=4.7.4 -c conda-forge
pip install napari-process-points-and-surfaces
```

f### Troubleshooting: Open3d installation

Since version 0.4.0, `nppas` does no longer depend on [open3d](http://www.open3d.org/).
Some deprecated functions still use Open3d though.
Follow the installation instructions in the [open3d documentation](http://www.open3d.org/docs/release/getting_started.htm) to install it and keep using those functions.
Also consider updating code and no longer using these deprecated functions.
See [release notes](https://github.com/haesleinhuepf/napari-process-points-and-surfaces/releases/tag/0.4.0) for details.

## See also

There are other napari plugins with similar / overlapping functionality
* [pymeshlab](https://www.napari-hub.org/plugins/napari-pymeshlab)
* [morphometrics](https://www.napari-hub.org/plugins/morphometrics)
* [napari-pyclesperanto-assistant](https://www.napari-hub.org/plugins/napari-pyclesperanto-assistant)
* [napari-stress](https://www.napari-hub.org/plugins/napari-stress)

## Contributing

Expand All @@ -82,6 +90,11 @@ the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the [BSD-3] license,
"napari-process-points-and-surfaces" is free and open source software

## Acknowledgements

Some code snippets and example data were taken from the [vedo](https://vedo.embl.es/) and [open3d](http://www.open3d.org/)
repositories and documentation. See [thirdparty licenses](https://github.com/haesleinhuepf/napari-process-points-and-surfaces/tree/main/licenses_third_party) for licensing details.

## Issues

If you encounter any problems, please create a thread on [image.sc] along with a detailed description and tag [@haesleinhuepf].
Expand Down
847 changes: 847 additions & 0 deletions docs/branchoid.ipynb

Large diffs are not rendered by default.

427 changes: 427 additions & 0 deletions docs/branchoid2.ipynb

Large diffs are not rendered by default.

859 changes: 859 additions & 0 deletions docs/creating_surfaces.ipynb

Large diffs are not rendered by default.

267 changes: 118 additions & 149 deletions docs/curvature_measurement.ipynb

Large diffs are not rendered by default.

737 changes: 248 additions & 489 deletions docs/demo.ipynb

Large diffs are not rendered by default.

354 changes: 145 additions & 209 deletions docs/quality_measurements.ipynb

Large diffs are not rendered by default.

Binary file removed docs/screenshot.png
Binary file not shown.
Binary file added docs/screenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshot4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,323 changes: 3,323 additions & 0 deletions docs/surface_vertex_classification.ipynb

Large diffs are not rendered by default.

116 changes: 116 additions & 0 deletions docs/table_row_classifier.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
OpenCL RandomForestClassifier
classifier_class_name = TableRowClassifier
feature_specification = Quality.AREA Quality.ASPECT_RATIO Quality.GAUSS_CURVATURE Quality.MEAN_CURVATURE Quality.SPHERE_FITTED_CURVATURE_HECTA_VOXEL Quality.SPHERE_FITTED_CURVATURE_KILO_VOXEL
num_ground_truth_dimensions = 1
num_classes = 2
num_features = 6
max_depth = 2
num_trees = 10
feature_importances = 0.014774211871627363,0.045757080610021775,0.4964465603808598,0.10980786142320526,0.3332142857142857,0.0
apoc_version = 0.12.0
*/
__kernel void predict (IMAGE_in0_TYPE in0, IMAGE_in1_TYPE in1, IMAGE_in2_TYPE in2, IMAGE_in3_TYPE in3, IMAGE_in4_TYPE in4, IMAGE_in5_TYPE in5, IMAGE_out_TYPE out) {
sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
const int x = get_global_id(0);
const int y = get_global_id(1);
const int z = get_global_id(2);
float i0 = READ_IMAGE(in0, sampler, POS_in0_INSTANCE(x,y,z,0)).x;
float i1 = READ_IMAGE(in1, sampler, POS_in1_INSTANCE(x,y,z,0)).x;
float i2 = READ_IMAGE(in2, sampler, POS_in2_INSTANCE(x,y,z,0)).x;
float i3 = READ_IMAGE(in3, sampler, POS_in3_INSTANCE(x,y,z,0)).x;
float i4 = READ_IMAGE(in4, sampler, POS_in4_INSTANCE(x,y,z,0)).x;
float i5 = READ_IMAGE(in5, sampler, POS_in5_INSTANCE(x,y,z,0)).x;
float s0=0;
float s1=0;
if(i2<0.01253616251051426){
s0+=13.0;
} else {
if(i1<1.5743114948272705){
s1+=16.0;
} else {
s0+=2.0;
}
}
if(i2<0.013402309268712997){
if(i2<0.007590430788695812){
s0+=13.0;
} else {
s0+=2.0;
s1+=1.0;
}
} else {
s1+=15.0;
}
if(i2<0.00794646143913269){
s0+=21.0;
} else {
s1+=10.0;
}
if(i4<0.00028659982490353286){
s0+=17.0;
} else {
s1+=14.0;
}
if(i3<9.934128320310265e-05){
if(i1<1.3991124629974365){
s0+=9.0;
} else {
s0+=3.0;
s1+=4.0;
}
} else {
s1+=15.0;
}
if(i4<0.00029376597376540303){
s0+=21.0;
} else {
s1+=10.0;
}
if(i3<9.934128320310265e-05){
if(i2<0.007590430788695812){
s0+=16.0;
} else {
s0+=1.0;
s1+=3.0;
}
} else {
if(i2<0.04185527563095093){
s0+=1.0;
s1+=7.0;
} else {
s0+=3.0;
}
}
if(i4<0.00028545514214783907){
s0+=14.0;
} else {
s1+=17.0;
}
if(i2<0.006332993507385254){
s0+=11.0;
} else {
if(i4<0.00028545514214783907){
s0+=3.0;
} else {
s1+=17.0;
}
}
if(i0<26.780094146728516){
s1+=3.0;
} else {
if(i2<0.011249952018260956){
s0+=16.0;
} else {
s0+=1.0;
s1+=11.0;
}
}
float max_s=s0;
int cls=1;
if (max_s < s1) {
max_s = s1;
cls=2;
}
WRITE_IMAGE (out, POS_out_INSTANCE(x,y,z,0), cls);
}
1,771 changes: 1,771 additions & 0 deletions docs/tabular_quality_measurements.ipynb

Large diffs are not rendered by default.

341 changes: 341 additions & 0 deletions docs/visualizing_surfaces.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 4300db3

Please sign in to comment.