Skip to content
Snippets Groups Projects
Commit 68519332 authored by Alessia Saccardo's avatar Alessia Saccardo
Browse files

fix descriptions and examples

parent 0a350b0a
Branches
No related tags found
1 merge request!156Mesh pygel3d
......@@ -8,5 +8,5 @@
- Downloader
- export_ome_zarr
- import_ome_zarr
- save_mesh
- load_mesh
- save_mesh
\ No newline at end of file
......@@ -7,11 +7,35 @@ from qim3d.utils._logger import log
def from_volume(
volume: np.ndarray,
**Kwargs
**kwargs
) -> hmesh.Manifold:
""" Convert a 3D numpy array to a mesh object using the [volumetric_isocontour](https://www2.compute.dtu.dk/projects/GEL/PyGEL/pygel3d/hmesh.html#volumetric_isocontour) function from Pygel3D.
Args:
volume (np.ndarray): A 3D numpy array representing a volume.
**kwargs: Additional arguments to pass to the Pygel3D volumetric_isocontour function.
Raises:
ValueError: If the input volume is not a 3D numpy array.
Returns:
hmesh.Manifold: A Pygel3D mesh object representing the input volume.
Example:
Convert a 3D numpy array to a Pygel3D mesh object:
```python
import qim3d
# Generate a 3D blob
synthetic_blob = qim3d.generate.noise_object(noise_scale = 0.015)
# Convert the 3D numpy array to a Pygel3D mesh object
mesh = qim3d.mesh.from_volume(synthetic_blob)
```
"""
if volume.ndim != 3:
raise ValueError("The input volume must be a 3D numpy array.")
mesh = hmesh.volumetric_isocontour(volume)
mesh = hmesh.volumetric_isocontour(volume, **kwargs)
return mesh
\ No newline at end of file
......@@ -212,6 +212,7 @@ def mesh(
Returns:
k3d.Plot or None:
- If `backend="k3d"`, returns a `k3d.Plot` object.
- If `backend="pygel3d"`, the function displays the mesh but does not return a plot object.
Example:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment