Nanomesh

Nanomesh: A Python workflow tool for generating meshes from image data - Published in JOSS (2022)

https://github.com/hpgem/nanomesh

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

finite-element-methods image-processing meshing microscopy python

Keywords from Contributors

standardization

Scientific Fields

Artificial Intelligence and Machine Learning Computer Science - 83% confidence
Last synced: 6 months ago · JSON representation ·

Repository

Python workflow tool for generating meshes from 2D and 3D image data

Basic Info
Statistics
  • Stars: 41
  • Watchers: 6
  • Forks: 6
  • Open Issues: 1
  • Releases: 10
Topics
finite-element-methods image-processing meshing microscopy python
Created over 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

Documentation Status tests Coverage PyPI - Python Version PyPI DOI JOSS

Nanomesh banner

Nanomesh

Nanomesh is a Python workflow tool for generating meshes from 2D and 3D image data. It has an easy-to-use API that can help process and segment image data, generate quality meshes (triangle / tetrahedra), and write the data to many mesh formats. Nanomesh also contains tools to inspect the meshes, visualize them, and generate cell quality metrics.

  • Easy-to-use Python API
  • Segment and mesh 2D or 3D image data
  • Mesh visualization
  • Calculate and plot cell metrics
  • Export to many mesh formats

Documentation: https://nanomesh.readthedocs.io/en/latest/

Check out the paper on Nanomesh in JOSS: https://doi.org/10.21105/joss.04654

Try nanomesh in your browser!

| Generate a 2D mesh | Calculate mesh metrics | | - | - | | Generate a 2D mesh | Calculate mesh metrics |

Show me an example!

This example shows the workflow for generating a mesh from segmented data, and demonstrates a few of the features of Nanomesh. It uses a synthetic binary image with several rounded blob-like objects generated by skimage.

```pycon

from skimage.data import binary_blobs from nanomesh import Image

blobs = binaryblobs(length=100, volumefraction=0.25, seed=2102) plane = Image(blobs)

print(plane) Plane(shape=(100, 100), range=(False,True), dtype=bool) ```

Image is essentially a container for a numpy array with some methods for image segmentation and visualization.

```pycon

plane.show() ```

drawing

Generating a mesh from image data is simple in Nanomesh using Plane.generate_mesh(). The options opts are passed to the triangulation function (nanomesh.triangulate). In this example, we use q30 to generate a quality mesh with minimum angles of 30°, and a50 to limit the triangle size to 50 pixels.

The returned mesh is a MeshContainer that contains the generated triangles and line segments.

```pycon

mesh = plane.generate_mesh(opts='q30a10') mesh Number of points: 932 Number of cells: triangle: 1754 line: 2685 Point data: physical Cell data: physical Field data: feature, background ```

In the next cell, we plot the triangles.

```pycon

mesh.plot('triangle') ```

drawing

With the metrics submodule, Nanomesh can also calculate cell quality metrics and show them as a colored triangle or histogram plot.

```pycon

from nanomesh import metrics trianglemesh = mesh.get('triangle') metrics.histogram(trianglemesh, metric='radius_ratio') ```

drawing

Nanomesh uses meshio to write data to most meshing formats.

```pycon

mesh.write('mesh.vtk') Warning: VTK requires 3D points, but 2D points given. Appending 0 third component. ```

That's it! There is a lot more that Nanomesh can do, check out the examples for an overview.

Installation

One of the goals for Nanomesh is that it is easy to install. This means that all dependencies are available from PyPi.

If you use conda, it is advised to create a new environment:

conda create -n nanomesh python=3.9 conda activate nanomesh

Install nanomesh:

pip install nanomesh

For the full installation instructions, see the installation guidelines.

Development

Check out our Contributing Guidelines to get started with development.

Owner

  • Name: hpgem
  • Login: hpgem
  • Kind: organization

JOSS Publication

Nanomesh: A Python workflow tool for generating meshes from image data
Published
October 09, 2022
Volume 7, Issue 78, Page 4654
Authors
Stef Smeets ORCID
Netherlands eScience Center, The Netherlands
Nicolas Renaud ORCID
Netherlands eScience Center, The Netherlands
Lars J. Corbijn van Willenswaard ORCID
University of Twente, The Netherlands
Editor
Prashant Jha ORCID
Tags
finite-element-methods microscopy meshing image-processing

Citation (CITATION.cff)

# YAML 1.2
---
cff-version: "1.1.0"
title: "nanomesh"
abstract: Create 2d and 3d meshes from experimental imaging data.
authors:
  -
    affiliation: "Netherlands eScience Center"
    family-names: Renaud
    given-names: Nicolas
    orcid: "0000-0001-9589-2694"
  -
    affiliation: "Netherlands eScience Center"
    family-names: Smeets
    given-names: Stef
    orcid: "0000-0002-5413-9038"
  -
    affiliation: "University of Twente"
    family-names: "Corbijn van Willenswaard"
    given-names: "Lars J."
    orcid: "0000-0001-6554-1527"
version: "0.9.1"
repository-code: "https://github.com/hpgem/nanomesh"
identifiers:
keywords:
  - "image-analysis"
  - "finite-element-analysis"
  - "materials-science"
  - "mesh-generation"
  - "microscopy"
message: "If you use this software, please cite it using these metadata."
license: "Apache-2.0"

GitHub Events

Total
  • Watch event: 9
  • Fork event: 3
Last Year
  • Watch event: 9
  • Fork event: 3

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 268
  • Total Committers: 4
  • Avg Commits per committer: 67.0
  • Development Distribution Score (DDS): 0.235
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Stef Smeets s****s 205
Nicolas Renaud n****d@g****m 45
github-actions[bot] 4****] 12
Lars Corbijn l****d@u****l 6
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 48
  • Total pull requests: 58
  • Average time to close issues: 3 months
  • Average time to close pull requests: 8 days
  • Total issue authors: 9
  • Total pull request authors: 3
  • Average comments per issue: 1.15
  • Average comments per pull request: 0.03
  • Merged pull requests: 55
  • Bot issues: 0
  • Bot pull requests: 9
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: 7 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • stefsmeets (37)
  • Laar (4)
  • vijaysm (1)
  • adtzlr (1)
  • hamiddhg (1)
  • spectraldecomp (1)
  • jgostick (1)
  • MFV-PS (1)
  • CheLamVien (1)
Pull Request Authors
  • stefsmeets (48)
  • github-actions[bot] (9)
  • prashjha (1)
Top Labels
Issue Labels
documentation (8) bug (4) wontfix (1) enhancement (1)
Pull Request Labels
bug (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,411 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 10
  • Total maintainers: 1
pypi.org: nanomesh

Creates 3d meshes from microscopy experimental data

  • Versions: 10
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 1,411 Last month
Rankings
Dependent packages count: 10.1%
Stargazers count: 13.7%
Forks count: 16.9%
Average: 17.1%
Dependent repos count: 21.6%
Downloads: 23.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish master composite
.github/workflows/test.yaml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • schneegans/dynamic-badges-action v1.6.0 composite
.github/workflows/update_dependencies.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • peter-evans/create-pull-request v3 composite
docs/requirements.txt pypi
  • autodocsumm *
  • ipython *
  • matplotlib *
  • meshio *
  • nbsphinx *
  • nbsphinx-link *
  • numpy *
  • readthedocs-sphinx-search *
  • scikit-image *
  • scikit-learn *
  • scipy *
  • sphinx *
  • sphinx_rtd_theme *
  • triangle *
notebooks/requirements.txt pypi
  • plotly *
pyproject.toml pypi
setup.py pypi
environment.yml conda
  • nodejs >=12
  • python 3.9
  • tetgen