forked from invesalius/invesalius3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84be9ad
commit 3ed5b04
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from vtk import vtkPolyData | ||
|
||
class Mesh: | ||
def __init__(self, pd: vtkPolyData | None = None, other: Mesh | None = None) -> None: ... | ||
def copy_to(self, other: Mesh) -> None: | ||
""" | ||
Copies self content to other. | ||
""" | ||
def to_vtk(self) -> vtkPolyData: | ||
""" | ||
Converts Mesh to vtkPolyData. | ||
""" | ||
|
||
def ca_smoothing(mesh: Mesh, T: float, tmax: float, bmin: float, n_iters: int) -> None: | ||
""" | ||
This is a implementation of the paper "Context-aware mesh smoothing for | ||
biomedical applications". It can be used to smooth meshes generated by | ||
binary images to remove its staircase artifacts and keep the fine features. | ||
Params: | ||
mesh: Mesh | ||
T: Min angle (between vertex faces and stack_orientation) to consider a | ||
vertex a staircase artifact | ||
tmax: max distance the vertex must be to its nearest artifact vertex | ||
to considered to calculate the weight | ||
bmin: The minimum weight | ||
n_iters: Number of iterations. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import Iterable | ||
|
||
import numpy as np | ||
|
||
def floodfill( | ||
data: np.ndarray, | ||
i: int, | ||
j: int, | ||
k: int, | ||
v: int, | ||
fill: int, | ||
out: np.ndarray | None, | ||
) -> np.ndarray | None: ... | ||
def floodfill_threshold( | ||
data: np.ndarray, | ||
seeds: list[Iterable[int]], | ||
t0: int, | ||
t1: int, | ||
fill: int, | ||
strct: np.ndarray, | ||
out: np.ndarray | None, | ||
) -> np.ndarray | None: ... | ||
def floodfill_auto_threshold( | ||
data: np.ndarray, seeds: list[Iterable[int]], p: float, fill: int, out: np.ndarray | None | ||
) -> np.ndarray | None: ... | ||
def fill_holes_automatically( | ||
mask: np.ndarray, labels: np.ndarray, nlabels: int, max_size: int | ||
) -> bool: ... |