Skip to content

Commit f5a6104

Browse files
authored
Merge pull request #371 from jo-mueller/added-binary-fill-to-surface-labelled-droplet-reconstruction
Added binary fill to surface labelled droplet reconstruction
2 parents 9e413ea + 93a6adf commit f5a6104

9 files changed

Lines changed: 586 additions & 0 deletions

docs/04_FAQ/bulk_vs_surface.ipynb

Lines changed: 542 additions & 0 deletions
Large diffs are not rendered by default.
701 KB
Loading
946 KB
Loading
260 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
gamma: 6.0
2+
max_degree: 20
3+
n_quadrature_points: 590
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
edge_type: interior
2+
fit_type: fancy
3+
interpolation_method: linear
4+
n_points: 256
5+
n_smoothing_iterations: 15
6+
n_tracing_iterations: 1
7+
outlier_tolerance: 1.5
8+
remove_outliers: true
9+
resampling_length: 5.0
10+
sampling_distance: 1.0
11+
smoothing_sigma: 1.0
12+
target_voxelsize: 0.2868
13+
trace_length: 30.0
14+
return_intermediate_results: true
15+
voxelsize: !!ndarray
16+
- 0.47
17+
- 0.1036
18+
- 0.1036
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
edge_type: surface
2+
fit_type: fancy
3+
interpolation_method: linear
4+
n_points: 256
5+
n_smoothing_iterations: 15
6+
n_tracing_iterations: 1
7+
outlier_tolerance: 1.5
8+
remove_outliers: true
9+
resampling_length: 5.0
10+
sampling_distance: 1.0
11+
smoothing_sigma: 1.0
12+
target_voxelsize: 0.2868
13+
trace_length: 30.0
14+
return_intermediate_results: true
15+
voxelsize: !!ndarray
16+
- 0.47
17+
- 0.1036
18+
- 0.1036

docs/_toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ parts:
5757
chapters:
5858
- file: 04_FAQ/Installation
5959
- file: 04_FAQ/Acknowledgement_and_citation
60+
- file: 04_FAQ/bulk_vs_surface
6061
- file: 04_FAQ/Validation
6162
sections:
6263
- file: 04_FAQ/validation/validation_stress_paper

src/napari_stress/_reconstruction/toolbox.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ def reconstruct_droplet(
274274
from skimage import filters, transform
275275
from .refine_surfaces import resample_pointcloud
276276
from .patches import iterative_curvature_adaptive_patch_fitting
277+
from scipy.ndimage import binary_fill_holes
277278

278279
scaling_factors = voxelsize / target_voxelsize
279280
rescaled_image = transform.rescale(
@@ -283,6 +284,9 @@ def reconstruct_droplet(
283284
threshold = filters.threshold_otsu(rescaled_image)
284285
binarized_image = rescaled_image > threshold
285286

287+
if edge_type == "surface":
288+
binarized_image = binary_fill_holes(binarized_image)
289+
286290
# convert to surface
287291
label_image = nsbatwm.connected_component_labeling(binarized_image)
288292
surface = nppas.largest_label_to_surface(label_image)

0 commit comments

Comments
 (0)