Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conversion of 3D label maps to labeled meshes with SurfaceNets. #5176

Merged
merged 16 commits into from
Nov 20, 2023

Conversation

jmargeta
Copy link
Contributor

@jmargeta jmargeta commented Nov 5, 2023

Overview

This PR adds support for conversion of 3D label maps to labeled surfaces for colored visualization using vtkSurfaceNets3D algorithm from VTK. This is particularly useful for visualization of anatomical structures in medical images from their labels or the outputs of multi-label segmentation maps.

Resolves #5170

Details

  • added contour_labeled to ImageData - contours can be extracted with label_map.contour_labeled()
  • added example into the gallery with the frog tissue labels and a simple test for the number of extracted labels in the output mesh
    image
  • Note, vtk 9.3+ must be used which is currently in the pre-release stage on PyPI. Otherwise, the support with throw an exception. The example will, however, not be generated, and the test will be blank.

As mentioned in the issue, another appealing example could be made using the great Neuroparc project. Is it acceptable to make an example with an external dataset?

import pooch
import pyvista as pv
file_name = pooch.retrieve(
    "https://github.com/neurodata/neuroparc/raw/master/atlases/label/Human/Schaefer1000_space-MNI152NLin6_res-1x1x1.nii.gz",
    known_hash="c3efe797aab3b3d9e705645bf29fac4e932c88dbe54ccaeb03982f11e66b3249",
)
label_map = pv.read(file_name)
label_map.contour_labeled(smoothing=True).plot(cmap="glasbey_bw")

image

Does the name contour_labeled fit well with PyVista, or would you suggest a better one?

Also, I added types to the function, and had to silence these Mypy errors (as in #3837):

pyvista/core/filters/image_data.py:853: error: Argument 1 to "set_default_active_scalars" has incompatible type "ImageDataFilters"; expected "DataSet"  [arg-type]
pyvista/core/filters/image_data.py:854: error: "ImageDataFilters" has no attribute "active_scalars_info"  [attr-defined]
pyvista/core/filters/image_data.py:858: error: "ImageDataFilters" has no attribute "get_array_association"  [attr-defined]

More info about the algorithm: Sarah F. Frisken, SurfaceNets for Multi-Label Segmentations with Preservation of Sharp Boundaries, Journal of Computer Graphics Techniques (JCGT), vol. 11, no. 1, 34-54, 2022. Available online http://jcgt.org/published/0011/01/03/

ImageData.contour_labeled is added and SurfaceNets3D algorithm from
a pre-release version of VTK is used. This is particularly useful for
visualization of medical images with their labels and the outputs of
multi-label segmentation maps.

Implements pyvista#5170

Note, version of vtk 9.3+ must be used which is currently in the pre-release
stage. Otherwise, the example is not generated and the test is not run.

See also:
Sarah F. Frisken, SurfaceNets for Multi-Label Segmentations with Preservation
of Sharp Boundaries, Journal of Computer Graphics Techniques (JCGT), vol. 11,
no. 1, 34-54, 2022. Available online http://jcgt.org/published/0011/01/03/

Note, silencing Mypy errors (as in pyvista#3837):
pyvista/core/filters/image_data.py:853: error: Argument 1 to "set_default_active_scalars" has incompatible type "ImageDataFilters"; expected "DataSet"  [arg-type]
pyvista/core/filters/image_data.py:854: error: "ImageDataFilters" has no attribute "active_scalars_info"  [attr-defined]
pyvista/core/filters/image_data.py:858: error: "ImageDataFilters" has no attribute "get_array_association"  [attr-defined]
@github-actions github-actions bot added documentation Anything related to the documentation/website enhancement Changes that enhance the library labels Nov 5, 2023
Copy link

codecov bot commented Nov 5, 2023

Codecov Report

Merging #5176 (b1bb05e) into main (4e804c4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5176   +/-   ##
=======================================
  Coverage   96.11%   96.11%           
=======================================
  Files         131      131           
  Lines       21877    21914   +37     
=======================================
+ Hits        21026    21063   +37     
  Misses        851      851           

@user27182
Copy link
Contributor

Awesome feature! Thanks for your contribution. This should be linked with #4802 in terms of PyVista VTK 9.3 support. PackLabels is used internally by SurfaceNets.

@jmargeta
Copy link
Contributor Author

jmargeta commented Nov 6, 2023

Thanks, @user27182, for the pointer and for linking the two as it should be! Great to see the support for PackLabels.
Once your PR gets merged, I will be happy to adopt your vtk 9.3 detection logic.
Cannot wait to see the latest capabilities of vtk in PyVista.

@MatthewFlamm
Copy link
Contributor

vtk 9.3 is now in the CI, so it can be tested directly

pyvista/core/filters/image_data.py Show resolved Hide resolved
pyvista/core/filters/image_data.py Outdated Show resolved Hide resolved
examples/01-filter/contouring.py Outdated Show resolved Hide resolved
pyvista/core/filters/image_data.py Show resolved Hide resolved
pyvista/core/filters/image_data.py Outdated Show resolved Hide resolved
pyvista/core/filters/image_data.py Outdated Show resolved Hide resolved
jmargeta and others added 5 commits November 15, 2023 17:25
Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
@jmargeta
Copy link
Contributor Author

@MatthewFlamm, thanks a lot for the update on the CI and your review!
I believe to have addressed all your comments and consider the wrapper complete functionally-wise.

Any feedback on what else I can do here to make the API better, please? In particular, does the contour_labeled name align well with the spirit of PyVista? I chose it primarily for easier discoverability under the contour«TAB»-completion.

def contour_labeled(
    self,
    n_labels: Optional[int] = None,
    smoothing: bool = False,
    smoothing_num_iterations: int = 50,
    smoothing_relaxation_factor: float = 0.5,
    smoothing_constraint_distance: float = 1,
    output_mesh_type: str = 'quads',
    output_style: str = 'default',
    scalars: Optional[str] = None,
    progress_bar: bool = False,
) -> 'pyvista.PolyData'

More explicit alternatives could be something like segmentaton, label_contours, label_map, surface_nets, label, label_surfaces, extract_label_map, segmentation_contours...

@tkoyama010, any chance for this to get into the November Release (#5138)?

@tkoyama010 tkoyama010 mentioned this pull request Nov 15, 2023
26 tasks
@tkoyama010
Copy link
Member

@jmargeta I added this PR to the waiting list in the release. Let's add this to the next release!

@jmargeta
Copy link
Contributor Author

Awesome, thanks @tkoyama010 !

Copy link
Member

@banesullivan banesullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really awesome work! Happy to approve this, but I'm wondering if you can bump up the code coverage in the tests since some of the conditional options are not currently covered.

Otherwise small comments

pyvista/core/filters/image_data.py Outdated Show resolved Hide resolved
pyvista/core/filters/image_data.py Show resolved Hide resolved
@jmargeta
Copy link
Contributor Author

How about the name of the function itself? labels.contour_labeled() works well.
However, after using this internally for a while, it feels that labels.surfaces_labeled() or just labels.surfaces() would be slightly more ergonomic alternatives.

'contour' suggests computation of an iso-contour. Here, 'labels' are a label map as an output from an image segmentation algorithm (3D image with discrete labels per voxel) we want to extract a surface "per label" rather than an iso-contour.
What do you think? Or is the original name fine?

@banesullivan
Copy link
Member

How about the name of the function itself? labels.contour_labeled() works well.

+1 for contour_labeled as that is consistent with the few other contouring methods and makes it a bit more discovered with tab-complete. see also: contour_banded()

In my mind "contouring" is simply a geometry reducing operation: volume -> surface, surface -> line, line -> point. Since this is taking a volume (ImageData) and producing surfaces (PolyData), this naming feels appropriate to me.

Otherwise, since this is a direct wrapping of vtkSurfaceNets3D I don't think anyone could argue against surface_nets()

@jmargeta
Copy link
Contributor Author

@banesullivan, thank you very much for your thoughts. contour_labeled it is, and I am fairly happy with the PR now.
Please, do not hesitate to ping me if you see anything else to add/change.

Copy link
Member

@banesullivan banesullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for your contributions, @jmargeta!

@banesullivan banesullivan merged commit c213b90 into pyvista:main Nov 20, 2023
25 checks passed
@jmargeta jmargeta deleted the feat/add-surfacenets3d branch November 20, 2023 09:59
@eigenvivek
Copy link

Thank you for this PR, it is very very helpful!

When I use contour_labeled, it prints some internal messages from VTK. Is there a way to suppress this by default? I don't want this showing up on a docs page I'm building. Also, messages like this don't show up when you use marching cubes, for example.

Thank you very much for your work, have been looking forward to the possibility of using SurfaceNets in PyVista for a few months now!

Screen Shot 2023-11-25 at 11 33 28

@banesullivan
Copy link
Member

@eigenvivek, can you share a pv.Report()? I mainly want to know what your VTK version is

@jmargeta
Copy link
Contributor Author

Hi @eigenvivek,
Great to hear you are using this functionality!

You can try to change the vtk logging level before the contour_labeled execution. For example, this mutes the messages for me:

import vtk
vtk.vtkLogger.SetStderrVerbosity(vtk.vtkLogger.ConvertToVerbosity(-1))

Disclaimer, I am not sure, this is the official way to do it :)

@jmargeta
Copy link
Contributor Author

All this is happening within the compiled part of VTK.
vtkLog(INFO, "Executing Surface Nets 3D");

@eigenvivek
Copy link

@jmargeta thank you for the suggestion, that worked perfectly :)

@banesullivan using vtk==9.3.0

Screen Shot 2023-11-25 at 14 10 40

@banesullivan
Copy link
Member

Glad you got it fixed! FYI, this discussion also has some tips for suppressing these logs: #3495

@jmargeta and @eigenvivek, if either of you think we should perform this suppression in this filter directly, don't hesitate to add that

@jmargeta
Copy link
Contributor Author

Hi @banesullivan, thanks for the pointer, vtk.vtkLogger.SetStderrVerbosity(vtk.vtkLogger.VERBOSITY_OFF) from the discussion you mentioned looks good. PR incoming.

ChristosT pushed a commit to ChristosT/pyvista that referenced this pull request Nov 28, 2023
…yvista#5176)

* Add conversion of 3D label maps to labeled meshes.

ImageData.contour_labeled is added and SurfaceNets3D algorithm from
a pre-release version of VTK is used. This is particularly useful for
visualization of medical images with their labels and the outputs of
multi-label segmentation maps.

Implements pyvista#5170

Note, version of vtk 9.3+ must be used which is currently in the pre-release
stage. Otherwise, the example is not generated and the test is not run.

See also:
Sarah F. Frisken, SurfaceNets for Multi-Label Segmentations with Preservation
of Sharp Boundaries, Journal of Computer Graphics Techniques (JCGT), vol. 11,
no. 1, 34-54, 2022. Available online http://jcgt.org/published/0011/01/03/

Note, silencing Mypy errors (as in pyvista#3837):
pyvista/core/filters/image_data.py:853: error: Argument 1 to "set_default_active_scalars" has incompatible type "ImageDataFilters"; expected "DataSet"  [arg-type]
pyvista/core/filters/image_data.py:854: error: "ImageDataFilters" has no attribute "active_scalars_info"  [attr-defined]
pyvista/core/filters/image_data.py:858: error: "ImageDataFilters" has no attribute "get_array_association"  [attr-defined]

* Refer to the contouring example

* Add tests for SurfaceNets contour extraction

* Update comments

* Update pyvista/core/filters/image_data.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Update pyvista/core/filters/image_data.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Update examples/01-filter/contouring.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Update pyvista/core/filters/image_data.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Use FieldAssiciation enums

* Use FieldAssociation enums correctly

* Add tests for improved coverage

* Add tests for improved coverage

* Fix quotes in tests

---------

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>
banesullivan added a commit that referenced this pull request Dec 14, 2023
* DynamicScraper: Add support for .png and .gif files

Query the plotter and use gif files if they are requested.
Use interactive (i.e.) vtksz files only if a scene exists in the plotter
fallback to static png if it does not.

* plot_directive: Add support for interactive scenes vis vrksz files

* plot_directive: Add option 'force_static'

Give the option to force a static image even if an interactive scene exists.
This allows to skip cases where the interactive scene is buggy or not as
expected.

* Replace "pyvista" scraper with DynamicScraper

* Use plot-directive instead of jupyter-execute in user-guide/*.rst

* plot-directive instead of jupyter-execute in sources/index.rst

* Apply suggestions from code review

* ViewerDirective: Support figure paths in either source or build directory.

The gallery extension generates the vtksz files under the source while the rest
of the documentation under build.  The ViewerDirective path replacements are
able to handle both now.

* sphinx_gallery: Add support for forcing static images

The sphinx gallery will look for the boolean variable
`PYVISTA_GALLERY_FORCE_STATIC_IN_DOCUMENT` in the parsed code to figure out if
static images should be generated instead of an interactive vtksz file.

Generation of static images can be also controlled at a block-level  defining
"PYVISTA_GALLERY_FORCE_STATIC = True" or "PYVISTA_GALLERY_FORCE_STATIC = False"
within the block.

* docs: use static images in examples that interactive does not look right

* docs: flying edges examples remove specular

It does not work well with interactive scenes and since flying edges is all
about creating a mesh it makes sense to sacrifice specular int his case.

* docs: plot-directive instead of jupyter-execute in getting-started/why

* Update tinypages test for offlineviewer

* docs: viewer_directive do path operation only on directories

strip filename using ".parent" to make sure we are operating on paths.
use "resolve()" to make comparing paths easier

* test_tinypages: Allow for both interactive scenes and static images

* test_tinypages: use static images for captions

the offlineviewer does not support captions yet.

* viewer_directive: offer alternative for is_relative for python < 3.9

`pathlib.Path.is_relative_to` was introduced in 3.9 while pyvista supports 3.8+.

* Update sphinx_gallery.py

* Update sphinx_gallery.py

* Apply suggestions from code review

* Update pyvista/ext/viewer_directive.py

* docs: add serve-html target

Add a target to allow serving the documentation via a http server.
This is required when generating interactive vtksz scenes.

* Update CONTRIBUTING.rst

* Update CONTRIBUTING.rst

* Update pyvista/ext/viewer_directive.py

* Update extrude-trim.py

* Update distance-between-surfaces.py

* Update sphinx_gallery.py

* Update preview-docs.yml

* Update preview-docs.yml

* Update docs.yml

* Update preview-docs.yml

* Delete .github/workflows/preview-docs.yml

* Update docs.yml

* sphinx-gallery: offer static and interactive scene as tabs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* docs: serve-html target use any available port

By default `python -m http.server` uses port 8000. This allows to pick some available port.

Co-authored-by: Bane Sullivan <banesullivan@gmail.com>

* docs: user-guide/index remove PBR

PBR is not yet supported by vtk.js

* tests: simplify working in tinypages test

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* docs: update trimesh.org domain

Fixes intersphinx error: XXX

* tinypages: Add support for tabs

* docs: plot_directive will now produce tabbed documentation

* plot_directive: Add support for docsets

Using pyvista-plot:: in docset causes the snippet to appear twice during
parsing. Once including the `pyvista-plot` command and arguments as part of the
code  and once without.  We only process the second since this is when the
directive options are properly read.

* docs: make all docsets in charts.py static

* create-point-could example use static for first case

eye_dome_lighting is not implemented in vtk-js.

* [create-pull-request] update local intersphinx (#5161)

Co-authored-by: MatthewFlamm <MatthewFlamm@users.noreply.github.com>
Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* [pre-commit.ci] pre-commit autoupdate (#5180)

updates:
- [github.com/psf/black: 23.9.1 → 23.10.1](psf/black@23.9.1...23.10.1)
- [github.com/keewis/blackdoc: v0.3.8 → v0.3.9](keewis/blackdoc@v0.3.8...v0.3.9)
- [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.1](pre-commit/mirrors-mypy@v1.5.1...v1.6.1)
- [github.com/asottile/pyupgrade: v3.14.0 → v3.15.0](asottile/pyupgrade@v3.14.0...v3.15.0)
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.4.0...v4.5.0)
- [github.com/python-jsonschema/check-jsonschema: 0.27.0 → 0.27.1](python-jsonschema/check-jsonschema@0.27.0...0.27.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix rotation bug with 90 degrees (#5181)

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* remove deprecated multi_samples kwarg (#5185)

* Support button release events on interactor (#5160)

* Support button release events on interactor

* Fix AffineWidget usage

---------

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* fix trimesh intersphinx (#5187)

* Enchance BUILDING_GALLERY flag code (#5189)

* Changed the way BUILDING_GALLERY flag was defined to a better way

* Support python 3.12 and vtk 9.3.0 in CI (#5196)

* support python 3.12 and vtk 9.3.0 in CI

* fix mpl version constraint

* test 3.12 on windows

* Update .github/workflows/testing-and-deployment.yml

* fix typo

* use rc aiohttp for now

* fix vtk change for Tetrahedra in docstring

* comment for aiohttp pin

* use in vtk master testing

* add to classifiers

* Apply suggestions from code review

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

---------

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Add option to get `figure_path` from environment variables (#5194)

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Remove `cell_arrays` in documentation (#5199)

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Add option to always get screenshots from plotter shows (#5197)

* feat: Add option to always get screenshots from plotter shows

* Add test

* Update pyvista/plotting/plotter.py

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Substitute all SCREENSHOT_ONLY appearences

* Update test_plotter.py

* Update test_plotter.py

* Use tmpdir

* Add global variable reset fixture

---------

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Add conversion of 3D label maps to labeled meshes with SurfaceNets. (#5176)

* Add conversion of 3D label maps to labeled meshes.

ImageData.contour_labeled is added and SurfaceNets3D algorithm from
a pre-release version of VTK is used. This is particularly useful for
visualization of medical images with their labels and the outputs of
multi-label segmentation maps.

Implements #5170

Note, version of vtk 9.3+ must be used which is currently in the pre-release
stage. Otherwise, the example is not generated and the test is not run.

See also:
Sarah F. Frisken, SurfaceNets for Multi-Label Segmentations with Preservation
of Sharp Boundaries, Journal of Computer Graphics Techniques (JCGT), vol. 11,
no. 1, 34-54, 2022. Available online http://jcgt.org/published/0011/01/03/

Note, silencing Mypy errors (as in #3837):
pyvista/core/filters/image_data.py:853: error: Argument 1 to "set_default_active_scalars" has incompatible type "ImageDataFilters"; expected "DataSet"  [arg-type]
pyvista/core/filters/image_data.py:854: error: "ImageDataFilters" has no attribute "active_scalars_info"  [attr-defined]
pyvista/core/filters/image_data.py:858: error: "ImageDataFilters" has no attribute "get_array_association"  [attr-defined]

* Refer to the contouring example

* Add tests for SurfaceNets contour extraction

* Update comments

* Update pyvista/core/filters/image_data.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Update pyvista/core/filters/image_data.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Update examples/01-filter/contouring.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Update pyvista/core/filters/image_data.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Use FieldAssiciation enums

* Use FieldAssociation enums correctly

* Add tests for improved coverage

* Add tests for improved coverage

* Fix quotes in tests

---------

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>

* Add more typehints (#5171)

* add typehints

* use forward declaration

* moar types

* Update pyvista/core/utilities/helpers.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

* pin numpy>=1.21.0

* Wide types

* final touch on pointset

---------

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Use python 3.12 and vtk 9.3.0 in Build Documentation (#5202)

* Use python 3.12 and vtk 9.3.0 in Build Documentation

* Apply suggestions from code review

* Bump jupyterlab from 4.0.7 to 4.0.9 (#5219)

Bumps [jupyterlab](https://github.com/jupyterlab/jupyterlab) from 4.0.7 to 4.0.9.
- [Release notes](https://github.com/jupyterlab/jupyterlab/releases)
- [Changelog](https://github.com/jupyterlab/jupyterlab/blob/@jupyterlab/lsp@4.0.9/CHANGELOG.md)
- [Commits](https://github.com/jupyterlab/jupyterlab/compare/@jupyterlab/lsp@4.0.7...@jupyterlab/lsp@4.0.9)

---
updated-dependencies:
- dependency-name: jupyterlab
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump trimesh from 3.23.5 to 4.0.5 (#5222)

Bumps [trimesh](https://github.com/mikedh/trimesh) from 3.23.5 to 4.0.5.
- [Release notes](https://github.com/mikedh/trimesh/releases)
- [Commits](mikedh/trimesh@3.23.5...4.0.5)

---
updated-dependencies:
- dependency-name: trimesh
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump trame from 3.2.8 to 3.3.0 (#5223)

Bumps [trame](https://github.com/Kitware/trame) from 3.2.8 to 3.3.0.
- [Release notes](https://github.com/Kitware/trame/releases)
- [Changelog](https://github.com/Kitware/trame/blob/master/CHANGELOG.md)
- [Commits](Kitware/trame@v3.2.8...v3.3.0)

---
updated-dependencies:
- dependency-name: trame
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump osmnx from 1.7.0 to 1.7.1 (#5220)

Bumps [osmnx](https://github.com/gboeing/osmnx) from 1.7.0 to 1.7.1.
- [Changelog](https://github.com/gboeing/osmnx/blob/main/CHANGELOG.md)
- [Commits](gboeing/osmnx@v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: osmnx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump scipy from 1.11.3 to 1.11.4 (#5221)

Bumps [scipy](https://github.com/scipy/scipy) from 1.11.3 to 1.11.4.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](scipy/scipy@v1.11.3...v1.11.4)

---
updated-dependencies:
- dependency-name: scipy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add `input_validation` package (#5100)

* Add input_validation package

* Update typing

* Update check_is_instance

* Revert updates to pyvista_ndarray.py

* Remove 'not not' repetition

* Update test_check_is_type

* Update test_check_is_subdtype

* Pre-commit

* Remove use of check_is_ArrayLike

* Update test_check_is_type

* Update test_check_is_type

* Update cast_array_to_NDArray

* Update cast_array_to_NDArray

* Remove np.zeros validation from coerce_shapelike_as_shape

* Update cast_array_to_NDArray

* Update docstrings

* Add check_is_iterable

* Add positional, kwarg special parameters

* Update docstrings, remove NumPy typing, rename functions

* Refactor coerce_arrayNx3 into validate_arrayNx3

* Split into separate modules

* Update module docstrings

* Move array casting to utilities

* Remove redundant calls to check_is_string

* Update test_utilities.py

* Pre-commit

* Rename validate_numeric_array -> validate_array

* Pre-commit

* Add validate_arrayN and check_length

* Pre-commit

* Add check length params to validate_array

* Improve test coverage

* Update tests

* Add check_is_sequence_of_strings

* Add check_string_is_in_list

* Add length, broadcast, and reshape options; add validate_array3

* Update typing

* Update typing

* Add must_be_nonnegative constraint; validate_uintlike_array

* Rename constraint params with 'must_be' prefix

* Update test_validate_uintlike_arrayN

* Remove redundant function

* Update test coverage

* Update docs

* Update docs; add check_is_scalar; minor code changes

* Improve test coverage

* Update docs, add examples

* Update pyvista/core/input_validation/validate.py

* Add API TOC autosummary

* Rename check_length -> check_has_length

* Change 'check that' to 'check if' in docs

* Rename check_string_is_in_iterable -> check_is_string_in_iterable

* Rename validate_transform_as_array3x3 -> validate_transform3x3

* Rename validate_transform_as_array4x4 -> validate_transform4x4

* Rename validate_uintlike_arrayN -> validate_arrayN_uintlike

* Update function special args to be consisent

* Rename transform input arg: transformlike -> transform

* Update module headers

* Update validation.rst

* Update CONTRIBUTING.rst

* Update docstrings

* Update validation.rst

* Update docstrings to fix build failure

* Add short-circuit return to avoid call to np.asanyarry

* Avoid redundant dtype check

* Rework _validate_shape_value to improve performance

* Update docstrings to fix build failure

* Fix typo

* Rework check_has_shape to improve performance

* Rework dtype checks to improve performance

* Optimization: replace calls to cast_to_ndarray with isinstance checks

* Add early retun for common cases in check_is_real

* Update validate.py

* Update CONTRIBUTING.rst

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Update tests/core/test_input_validation.py

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Update tests, improve coverage

* Update CONTRIBUTING.rst

* Update validate.py

* Update docs

* Update docs

* Update docs

* Update docs, add 'See Also'

* Update docs and typing

* Pre-commit

* Update docs, typing, add cross-references

* Update docs, add examples, minor fixes/edits

* Rename reshape -> reshape_to

* Add strict and axis params to check_is_sorted

* Update docstring

* Improve test coverage

* Simplify error re-raises

* Add validate_axes

* Update docstring

* Update tests

* Apply suggestions from code review

* Add name param to validate_axes

---------

Co-authored-by: Erik Bedard <bedarder@gmail.com>
Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Fix small typo (#5225)

* Add Text3DSource class (#5218)

* Add Text3DSource class

* Update docstring

* Update depth arg position

* Update tests

* Update geometric_sources.py

* Refactor tests

* Update tests

* Update tests

* Update tests

* Apply suggestions from code review

---------

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* Add `edge_opacity` property to `Property` class (#5192)

* Add `edge_opacity` property to `Property` class

* Update _property.py

* Update _property.py

* Update test_property.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update _property.py

* Update pyvista/plotting/_property.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Update test_property.py

* Update pyvista/plotting/_property.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Update pyvista/plotting/_property.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add `edges_opacity` property to `Theme` class

* Apply suggestions from code review

* Update themes.py

* Apply suggestions from code review

* Update _property.py

* Update _property.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add `edge_opacity` as a keyword arg to `add_mesh`

* Apply suggestions from code review

* Update _property.py

* Update _property.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update _property.py

* Update _property.py

* Apply suggestions from code review

* Update pyvista/plotting/_property.py

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

* Fix numpydoc-validation error

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>

* Add embeddable jupyter widget (#5168)

* Add embeddable jupyter widget

* Fix debugging

* Add basic test

* Add test-case in tinypages test for new widget (#5206)

Co-authored-by: Christos Tsolakis <christos.tsolakis@kitware.com>

* Add jupyter_sphinx to test dependencies

* Remove the tinypages test

* Remove jupyter_sphinx extension from test

---------

Co-authored-by: Christos Tsolakis <christos.tsolakis@kitware.com>

* Add `pack_labels` and `sort_labels` filters (#4802)

* Add pack_labels and sort_labels filters

* Fix failed doctest, remove unused test

* Add checks for VTK>=9.3

* Add doctest skips

* Generalize pack_labels to work with VTK < 9.3

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_dataset_filters.py

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update data_set.py

* Update data_set.py

* Update data_set.py

* Update data_set.py

* Update docs and vtk checks

* Update filter to limit copying

* Update docstring

---------

Co-authored-by: Erik Bedard <bedarder@gmail.com>
Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Add local suppression of VTK debug messages (#5228)

Co-authored-by: Bane Sullivan <banesullivan@gmail.com>

* Deprecate/fix `PolyData.n_faces` (#5229)

* deprecate n_faces

* indent deprecation comment

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* move module globals to class variables

* Remove the PolyData.n_faces example

Deprecation warning was causing failure during doctest

* fix n_faces_strict doc example

---------

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* plot_directive: allow captions when tabs are used

* charts: doc_subs indent replacements to accommodate pyvista-plot directive

* tinypages: Add sphinx-design plugin to give access to tabs

* Update pointset.py

* Update requirements_test.txt

* docs: force interactive plot in create-pixel-art example

* Add documentation about PYVISTA_GALLERY_FORCE_STATIC* flags

* docs: fix spacing in PYVISTA_GALLERY_FORCE_STATIC_IN_DOCUMENT documentation

* docs: Various spelling and style fixes

Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>

* docs: set port of make serve to something predictable

Co-authored-by: Bane Sullivan <banesullivan@gmail.com>

* tests: make package requirements for tests less strict

Follows the current convention where:

- requirements_docs.txt: pin everything because our documentation build tends to be fragile and is only fully executed around releases
- requirements_test.txt: limit dependencies by minor release and let dependabot bump these which we can easily pick up on errors, deprecation warnings, or breakages
- requirements.txt: same as requirements_test.txt but this is just the core dependencies

Co-authored-by: Bane Sullivan <banesullivan@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>
Co-authored-by: Christos Tsolakis <ChristosT@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: MatthewFlamm <MatthewFlamm@users.noreply.github.com>
Co-authored-by: Kevin Marchais <kevinmarchais@gmail.com>
Co-authored-by: Alex Kaszynski <akascap@gmail.com>
Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
Co-authored-by: Amirhossein Safarzadeh <includesafarof@gmail.com>
Co-authored-by: Alex Fernandez <21alex295@gmail.com>
Co-authored-by: Jan Margeta <jmargeta@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: user27182 <89109579+user27182@users.noreply.github.com>
Co-authored-by: Erik Bedard <bedarder@gmail.com>
Co-authored-by: darikg <darikg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Anything related to the documentation/website enhancement Changes that enhance the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SurfaceNets to visualize 3D label maps
6 participants