Add mesh3D test suite and wire it into CI - #138
Conversation
Covers Mesh3D save/load, SegmentationMesh, POIMesh, mesh_colors, Preview_Settings, and make_snapshot3D end-to-end. Tests skip cleanly when optional deps (pyvista, vtk, fury, Pillow, xvfbwrapper, Xvfb) are missing so they can run outside CI without failing. mesh3D coverage: 38% -> 86% (mesh.py 0% -> 82%, snapshot3D.py 0% -> 77%, html_preview.py 0% -> 64%). Also: - Fill in missing SegmentationMesh.__init__ / POIMesh.__init__ docstrings. - Rewrite mesh3D/README.md — symbols and examples referenced names that no longer exist (Mesh, LABEL_COLORS, label_to_color, create_snapshot3D, create_html_preview, seg.unique_labels()). - Pin fury >=0.9,<2.0. fury 2.x is a pygfx-based rewrite that removed window.record and changed ShowManager/Scene signatures snapshot3D.py depends on; pinning is the minimal fix until snapshot3D is ported. - Add fury, Pillow, xvfbwrapper to the dev poetry group and install the dev group + xvfb/libgl1 in tests.yml / tests_mr.yml so the CPU-only mesh3D tests actually run in CI instead of being silently skipped. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
# Conflicts: # .github/workflows/tests_mr.yml
Benchmark comparisonSpeed (wall time per call)baseline Showing the 5 most-changed measurements per case; the rest are collapsed. Rows with a baseline below 3 ms are tagged
|
| Measurement | baseline ms (median ±½·range) | head ms (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_filter_connected_components |
4.19 ±0.03 | 4.25 ±0.05 | +1.5% | 0.040 |
nii_rescale_seg |
3.11 ±0.02 | 3.08 ±0.02 | -1.0% | 0.126 |
nii_dilate_msk |
119.38 ±0.32 | 118.33 ±0.50 | -0.9% | 0.004 |
nii_save |
11.64 ±0.03 | 11.55 ±0.02 | -0.8% | 0.001 |
nii_fill_holes |
4.61 ±0.03 | 4.64 ±0.06 | +0.6% | 0.101 |
… 31 more measurements
| Measurement | baseline ms (median ±½·range) | head ms (median ±½·range) | Δ % | p |
|---|---|---|---|---|
poi_calc_centroids_nocrop |
4.40 ±0.04 | 4.42 ±0.06 | +0.6% | 0.390 |
poi_calc_poi_from_subreg_vert |
11.57 ±0.15 | 11.51 ±0.10 | -0.5% | 0.684 |
nii_erode_msk |
6.09 ±0.07 | 6.06 ±0.05 | -0.4% | 0.918 |
nii_load_img |
11.79 ±0.07 | 11.74 ±0.07 | -0.4% | 0.633 |
nii_rescale |
39.74 ±0.19 | 39.80 ±0.19 | +0.2% | 0.293 |
nii_resample_from_to |
41.48 ±0.21 | 41.51 ±0.26 | +0.1% | 0.661 |
metric_voxels |
250463.00 ±0.00 | 250463.00 ±0.00 | +0.0% | — |
metric_labels |
3.00 ±0.00 | 3.00 ±0.00 | +0.0% | — |
metric_foreground_pct |
14.51 ±0.00 | 14.51 ±0.00 | +0.0% | — |
poi_rescale |
0.19 ±0.01 | 0.26 ±0.05 | +39.5% (noise) | 0.025 |
nii_get_array |
0.05 ±0.01 | 0.03 ±0.00 | -26.1% (noise) | 0.056 |
poi_reorient |
0.34 ±0.01 | 0.42 ±0.06 | +22.3% (noise) | 0.028 |
nii_pad_to |
0.67 ±0.04 | 0.55 ±0.01 | -19.0% (noise) | 0.001 |
poi_map_labels |
0.15 ±0.01 | 0.18 ±0.02 | +18.5% (noise) | 0.026 |
nii_extract_label |
0.40 ±0.01 | 0.34 ±0.01 | -14.3% (noise) | 0.000 |
poi_to_global |
0.17 ±0.01 | 0.19 ±0.02 | +11.9% (noise) | 0.023 |
nii_compute_crop |
0.33 ±0.01 | 0.29 ±0.01 | -11.5% (noise) | 0.001 |
poi_save |
0.38 ±0.02 | 0.42 ±0.04 | +11.3% (noise) | 0.042 |
nii_map_labels |
0.89 ±0.02 | 0.81 ±0.02 | -8.8% (noise) | 0.000 |
nii_reorient |
0.69 ±0.02 | 0.63 ±0.03 | -8.2% (noise) | 0.042 |
nii_unique |
0.63 ±0.01 | 0.58 ±0.01 | -7.2% (noise) | 0.001 |
poi_load |
0.86 ±0.02 | 0.91 ±0.03 | +5.3% (noise) | 0.023 |
nii_apply_crop |
0.61 ±0.05 | 0.58 ±0.03 | -4.9% (noise) | 0.079 |
poi_calc_centroids |
2.39 ±0.03 | 2.48 ±0.03 | +3.8% (noise) | 0.001 |
nii_set_dtype |
0.40 ±0.03 | 0.39 ±0.02 | -3.4% (noise) | 0.412 |
poi_local_to_global_arr |
0.25 ±0.01 | 0.25 ±0.01 | +2.8% (noise) | 0.585 |
nii_volumes |
1.94 ±0.02 | 1.90 ±0.01 | -2.0% (noise) | 0.002 |
nii_load_seg |
2.69 ±0.03 | 2.73 ±0.12 | +1.6% (noise) | 0.198 |
nii_get_connected_components |
2.01 ±0.03 | 2.04 ±0.03 | +1.6% (noise) | 0.065 |
poi_resample_from_to |
0.59 ±0.04 | 0.59 ±0.14 | +1.6% (noise) | 0.290 |
nii_center_of_masses |
1.83 ±0.01 | 1.81 ±0.14 | -1.4% (noise) | 0.499 |
ct_2d — shape (73, 47, 1)
| Measurement | baseline ms (median ±½·range) | head ms (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_rescale |
5.34 ±0.13 | 5.57 ±0.18 | +4.3% | 0.109 |
nii_resample_from_to |
7.15 ±0.08 | 7.43 ±0.17 | +4.0% | 0.014 |
nii_dilate_msk |
13.71 ±0.10 | 13.85 ±0.08 | +1.0% | 0.122 |
metric_voxels |
3431.00 ±0.00 | 3431.00 ±0.00 | +0.0% | — |
metric_labels |
3.00 ±0.00 | 3.00 ±0.00 | +0.0% | — |
… 30 more measurements
| Measurement | baseline ms (median ±½·range) | head ms (median ±½·range) | Δ % | p |
|---|---|---|---|---|
metric_foreground_pct |
37.60 ±0.00 | 37.60 ±0.00 | +0.0% | — |
nii_unique |
0.13 ±0.01 | 0.15 ±0.01 | +16.9% (noise) | 0.004 |
nii_filter_connected_components |
0.85 ±0.03 | 0.97 ±0.21 | +13.9% (noise) | 0.163 |
nii_apply_crop |
0.67 ±0.02 | 0.75 ±0.01 | +11.6% (noise) | 0.000 |
nii_get_array |
0.02 ±0.00 | 0.02 ±0.00 | +11.5% (noise) | 0.157 |
poi_to_global |
0.27 ±0.01 | 0.24 ±0.01 | -10.9% (noise) | 0.005 |
nii_pad_to |
0.58 ±0.02 | 0.64 ±0.01 | +10.3% (noise) | 0.000 |
poi_reorient |
0.49 ±0.01 | 0.45 ±0.04 | -9.2% (noise) | 0.177 |
nii_save |
1.31 ±0.02 | 1.43 ±0.03 | +8.5% (noise) | 0.000 |
nii_load_img |
1.45 ±0.01 | 1.57 ±0.06 | +7.9% (noise) | 0.005 |
poi_save |
0.54 ±0.03 | 0.50 ±0.03 | -7.4% (noise) | 0.146 |
nii_compute_crop |
0.16 ±0.00 | 0.17 ±0.02 | +7.0% (noise) | 0.076 |
nii_load_seg |
1.59 ±0.03 | 1.69 ±0.07 | +6.9% (noise) | 0.044 |
poi_rescale |
0.29 ±0.01 | 0.27 ±0.01 | -6.6% (noise) | 0.011 |
poi_local_to_global_arr |
0.31 ±0.01 | 0.29 ±0.01 | -6.2% (noise) | 0.010 |
nii_center_of_masses |
0.24 ±0.01 | 0.25 ±0.01 | +5.5% (noise) | 0.476 |
nii_extract_label |
0.47 ±0.02 | 0.49 ±0.01 | +5.0% (noise) | 0.238 |
nii_volumes |
0.31 ±0.02 | 0.33 ±0.01 | +4.5% (noise) | 0.029 |
nii_reorient |
0.79 ±0.02 | 0.83 ±0.03 | +4.5% (noise) | 0.023 |
poi_calc_centroids |
0.94 ±0.01 | 0.98 ±0.02 | +4.0% (noise) | 0.009 |
poi_map_labels |
0.22 ±0.00 | 0.23 ±0.01 | +4.0% (noise) | 0.076 |
nii_erode_msk |
0.99 ±0.01 | 1.03 ±0.03 | +3.9% (noise) | 0.028 |
nii_set_dtype |
0.41 ±0.00 | 0.43 ±0.01 | +3.2% (noise) | 0.007 |
nii_get_connected_components |
0.70 ±0.02 | 0.68 ±0.05 | -2.5% (noise) | 0.563 |
nii_map_labels |
0.53 ±0.01 | 0.54 ±0.06 | +2.4% (noise) | 0.864 |
poi_calc_centroids_nocrop |
1.13 ±0.02 | 1.16 ±0.06 | +2.3% (noise) | 0.227 |
nii_rescale_seg |
0.80 ±0.01 | 0.81 ±0.03 | +1.5% (noise) | 0.200 |
nii_fill_holes |
0.88 ±0.01 | 0.89 ±0.01 | +1.0% (noise) | 0.088 |
poi_resample_from_to |
0.72 ±0.01 | 0.72 ±0.03 | -0.6% (noise) | 0.940 |
poi_load |
1.01 ±0.02 | 1.01 ±0.01 | -0.2% (noise) | 0.258 |
mri_3d — shape (68, 52, 67)
| Measurement | baseline ms (median ±½·range) | head ms (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_fill_holes |
5.50 ±0.04 | 5.61 ±0.03 | +2.0% | 0.004 |
nii_filter_connected_components |
4.61 ±0.05 | 4.68 ±0.06 | +1.4% | 0.658 |
poi_calc_poi_from_subreg_vert |
10.78 ±0.10 | 10.91 ±0.14 | +1.2% | 0.129 |
nii_resample_from_to |
39.12 ±0.11 | 39.46 ±0.36 | +0.9% | 0.046 |
poi_calc_centroids_nocrop |
9.01 ±1.28 | 9.08 ±0.05 | +0.8% | 0.329 |
… 31 more measurements
| Measurement | baseline ms (median ±½·range) | head ms (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_load_img |
9.57 ±0.04 | 9.63 ±0.17 | +0.6% | 0.320 |
nii_save |
9.66 ±0.08 | 9.61 ±0.03 | -0.5% | 0.763 |
nii_erode_msk |
7.60 ±0.08 | 7.64 ±0.99 | +0.5% | 0.367 |
nii_rescale_seg |
3.11 ±0.02 | 3.13 ±0.03 | +0.5% | 0.343 |
nii_dilate_msk |
153.25 ±1.74 | 153.85 ±1.16 | +0.4% | 0.701 |
nii_rescale |
37.39 ±0.24 | 37.44 ±0.35 | +0.1% | 0.335 |
metric_voxels |
236912.00 ±0.00 | 236912.00 ±0.00 | +0.0% | — |
metric_labels |
8.00 ±0.00 | 8.00 ±0.00 | +0.0% | — |
metric_foreground_pct |
18.21 ±0.00 | 18.21 ±0.00 | +0.0% | — |
nii_get_array |
0.04 ±0.00 | 0.06 ±0.00 | +34.6% (noise) | 0.001 |
poi_to_global |
0.28 ±0.01 | 0.30 ±0.02 | +7.8% (noise) | 0.051 |
nii_extract_label |
0.48 ±0.02 | 0.50 ±0.01 | +5.1% (noise) | 0.029 |
nii_pad_to |
0.72 ±0.02 | 0.76 ±0.01 | +4.3% (noise) | 0.058 |
poi_resample_from_to |
0.76 ±0.02 | 0.79 ±0.02 | +4.0% (noise) | 0.012 |
poi_map_labels |
0.25 ±0.01 | 0.26 ±0.01 | +4.0% (noise) | 0.769 |
poi_save |
0.58 ±0.02 | 0.60 ±0.02 | +3.8% (noise) | 0.043 |
poi_local_to_global_arr |
0.29 ±0.01 | 0.30 ±0.01 | +3.6% (noise) | 0.384 |
nii_set_dtype |
0.55 ±0.02 | 0.53 ±0.02 | -3.4% (noise) | 0.292 |
nii_unique |
0.61 ±0.01 | 0.63 ±0.01 | +3.1% (noise) | 0.082 |
poi_load |
2.06 ±0.02 | 2.12 ±0.02 | +3.1% (noise) | 0.002 |
nii_compute_crop |
0.36 ±0.00 | 0.35 ±0.01 | -2.5% (noise) | 0.104 |
nii_apply_crop |
0.75 ±0.02 | 0.74 ±0.02 | -1.6% (noise) | 0.851 |
nii_load_seg |
2.86 ±0.03 | 2.90 ±0.07 | +1.3% (noise) | 0.129 |
poi_calc_centroids |
2.86 ±0.02 | 2.90 ±0.01 | +1.3% (noise) | 0.006 |
nii_map_labels |
1.01 ±0.01 | 1.00 ±0.02 | -0.8% (noise) | 0.137 |
nii_reorient |
0.84 ±0.02 | 0.84 ±0.03 | -0.7% (noise) | 0.914 |
nii_volumes |
2.03 ±0.02 | 2.05 ±0.02 | +0.7% (noise) | 0.035 |
poi_rescale |
0.30 ±0.00 | 0.30 ±0.01 | +0.6% (noise) | 0.484 |
poi_reorient |
0.49 ±0.02 | 0.49 ±0.03 | +0.3% (noise) | 0.213 |
nii_center_of_masses |
2.08 ±0.01 | 2.09 ±0.02 | +0.3% (noise) | 0.480 |
nii_get_connected_components |
2.09 ±0.03 | 2.09 ±0.02 | +0.1% (noise) | 0.518 |
mri_2d — shape (68, 52, 1)
| Measurement | baseline ms (median ±½·range) | head ms (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_rescale |
5.38 ±0.17 | 5.57 ±0.03 | +3.6% | 0.228 |
nii_resample_from_to |
7.13 ±0.13 | 7.31 ±0.15 | +2.6% | 0.369 |
nii_dilate_msk |
18.13 ±0.05 | 18.27 ±0.10 | +0.8% | 0.112 |
metric_voxels |
3536.00 ±0.00 | 3536.00 ±0.00 | +0.0% | — |
metric_labels |
7.00 ±0.00 | 7.00 ±0.00 | +0.0% | — |
… 30 more measurements
| Measurement | baseline ms (median ±½·range) | head ms (median ±½·range) | Δ % | p |
|---|---|---|---|---|
metric_foreground_pct |
50.17 ±0.00 | 50.17 ±0.00 | +0.0% | — |
nii_get_array |
0.02 ±0.01 | 0.02 ±0.00 | -5.6% (noise) | 0.497 |
nii_load_seg |
1.58 ±0.02 | 1.66 ±0.03 | +5.5% (noise) | 0.002 |
nii_map_labels |
0.50 ±0.02 | 0.52 ±0.03 | +4.5% (noise) | 0.210 |
poi_to_global |
0.28 ±0.01 | 0.29 ±0.00 | +4.4% (noise) | 0.093 |
poi_map_labels |
0.26 ±0.01 | 0.24 ±0.01 | -4.1% (noise) | 0.298 |
nii_center_of_masses |
0.39 ±0.01 | 0.41 ±0.01 | +4.1% (noise) | 0.050 |
nii_compute_crop |
0.16 ±0.01 | 0.16 ±0.01 | -4.0% (noise) | 0.345 |
nii_unique |
0.14 ±0.01 | 0.14 ±0.02 | -3.7% (noise) | 0.804 |
nii_load_img |
1.46 ±0.04 | 1.50 ±0.02 | +3.2% (noise) | 0.008 |
poi_resample_from_to |
0.76 ±0.02 | 0.78 ±0.04 | +3.1% (noise) | 0.274 |
nii_extract_label |
0.43 ±0.02 | 0.44 ±0.01 | +2.2% (noise) | 0.478 |
nii_get_connected_components |
0.66 ±0.03 | 0.68 ±0.05 | +2.2% (noise) | 0.883 |
poi_rescale |
0.32 ±0.01 | 0.31 ±0.02 | -2.1% (noise) | 0.262 |
nii_rescale_seg |
0.79 ±0.02 | 0.78 ±0.02 | -2.1% (noise) | 0.169 |
poi_reorient |
0.49 ±0.02 | 0.50 ±0.03 | +1.9% (noise) | 0.591 |
nii_pad_to |
0.57 ±0.03 | 0.56 ±0.01 | -1.8% (noise) | 0.320 |
nii_save |
1.36 ±0.03 | 1.38 ±0.03 | +1.4% (noise) | 0.319 |
poi_calc_centroids_nocrop |
1.34 ±0.04 | 1.36 ±0.04 | +1.4% (noise) | 0.730 |
nii_filter_connected_components |
0.87 ±0.02 | 0.86 ±0.01 | -1.4% (noise) | 0.257 |
nii_reorient |
0.81 ±0.01 | 0.82 ±0.04 | +1.4% (noise) | 0.710 |
poi_local_to_global_arr |
0.28 ±0.01 | 0.29 ±0.01 | +1.3% (noise) | 0.184 |
nii_fill_holes |
1.04 ±0.02 | 1.05 ±0.02 | +1.3% (noise) | 0.388 |
poi_load |
1.85 ±0.01 | 1.88 ±0.05 | +1.2% (noise) | 0.097 |
nii_apply_crop |
0.68 ±0.02 | 0.69 ±0.02 | +1.1% (noise) | 0.635 |
nii_erode_msk |
1.20 ±0.06 | 1.19 ±0.03 | -0.9% (noise) | 0.437 |
nii_set_dtype |
0.42 ±0.01 | 0.42 ±0.02 | +0.9% (noise) | 0.450 |
poi_save |
0.54 ±0.02 | 0.55 ±0.01 | +0.8% (noise) | 0.775 |
nii_volumes |
0.46 ±0.01 | 0.46 ±0.00 | +0.3% (noise) | 0.166 |
poi_calc_centroids |
1.14 ±0.03 | 1.14 ±0.02 | +0.0% (noise) | 0.551 |
Gate: a measurement fails when the baseline is ≥ 1 ms, the median grows by ≥ 50%, and Welch's t-test gives p < 0.05. metric_* rows are context only.
Memory (peak RSS growth per call)
baseline ed09457 vs head ed09457 · python 3.11.16 · 5 repeats + 1 warmup · sampler proc-status, isolation fork · measurement floor ≈ 0.90 MiB
Showing the 5 most-changed measurements per case; the rest are collapsed. Rows with a baseline below 3 MiB are tagged (noise) — runner jitter on those swamps any real change.
ct_3d — shape (73, 47, 73)
| Measurement | baseline MiB (median ±½·range) | head MiB (median ±½·range) | Δ % | p |
|---|---|---|---|---|
poi_resample_from_to |
5.18 ±0.00 | 5.27 ±0.00 | +1.7% | — |
nii_set_dtype |
5.18 ±0.00 | 5.27 ±0.00 | +1.7% | — |
nii_pad_to |
5.36 ±0.00 | 5.45 ±0.00 | +1.7% | — |
nii_extract_label |
5.37 ±0.00 | 5.46 ±0.00 | +1.7% | — |
nii_map_labels |
5.43 ±0.00 | 5.52 ±0.00 | +1.7% | — |
… 31 more measurements
| Measurement | baseline MiB (median ±½·range) | head MiB (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_reorient |
5.80 ±0.00 | 5.89 ±0.00 | +1.5% | — |
nii_apply_crop |
5.80 ±0.00 | 5.89 ±0.00 | +1.5% | — |
poi_calc_centroids_nocrop |
5.86 ±0.00 | 5.95 ±0.00 | +1.5% | — |
poi_calc_centroids |
5.99 ±0.00 | 6.08 ±0.00 | +1.5% | — |
nii_rescale_seg |
5.88 ±0.00 | 5.97 ±0.00 | +1.5% | — |
nii_load_seg |
5.91 ±0.00 | 6.00 ±0.00 | +1.5% | — |
nii_resample_from_to |
6.20 ±0.00 | 6.29 ±0.00 | +1.5% | — |
nii_rescale |
6.07 ±0.00 | 6.16 ±0.00 | +1.4% | — |
nii_fill_holes |
6.22 ±0.00 | 6.31 ±0.00 | +1.4% | — |
nii_get_connected_components |
6.55 ±0.00 | 6.64 ±0.00 | +1.4% | — |
nii_filter_connected_components |
6.80 ±0.00 | 6.89 ±0.00 | +1.3% | — |
poi_calc_poi_from_subreg_vert |
7.05 ±0.00 | 7.14 ±0.00 | +1.3% | — |
nii_dilate_msk |
5.87 ±0.00 | 5.93 ±0.00 | +1.1% | — |
nii_erode_msk |
5.87 ±0.00 | 5.93 ±0.00 | +1.1% | — |
poi_to_global |
3.08 ±0.00 | 3.09 ±0.00 | +0.1% | — |
nii_center_of_masses |
3.27 ±0.00 | 3.28 ±0.00 | +0.1% | — |
nii_volumes |
3.52 ±0.00 | 3.53 ±0.00 | +0.1% | — |
nii_save |
3.71 ±0.00 | 3.71 ±0.00 | +0.1% | — |
poi_reorient |
3.83 ±0.00 | 3.84 ±0.00 | +0.1% | — |
nii_load_img |
3.53 ±0.00 | 3.53 ±0.00 | +0.0% | — |
metric_voxels |
250463.00 ±0.00 | 250463.00 ±0.00 | +0.0% | — |
metric_labels |
3.00 ±0.00 | 3.00 ±0.00 | +0.0% | — |
metric_foreground_pct |
14.51 ±0.00 | 14.51 ±0.00 | +0.0% | — |
poi_rescale |
2.61 ±0.00 | 2.61 ±0.00 | +0.1% (noise) | — |
nii_compute_crop |
2.90 ±0.00 | 2.90 ±0.00 | +0.1% (noise) | — |
poi_local_to_global_arr |
2.96 ±0.00 | 2.96 ±0.00 | +0.1% (noise) | — |
nii_unique |
2.96 ±0.00 | 2.96 ±0.00 | +0.1% (noise) | — |
nii_get_array |
1.65 ±0.00 | 1.65 ±0.00 | +0.0% (noise) | — |
poi_save |
1.41 ±0.00 | 1.41 ±0.00 | +0.0% (noise) | — |
poi_map_labels |
1.78 ±0.00 | 1.78 ±0.00 | +0.0% (noise) | — |
poi_load |
1.62 ±0.00 | 1.62 ±0.00 | +0.0% (noise) | — |
ct_2d — shape (73, 47, 1)
| Measurement | baseline MiB (median ±½·range) | head MiB (median ±½·range) | Δ % | p |
|---|---|---|---|---|
poi_resample_from_to |
5.11 ±0.00 | 5.20 ±0.00 | +1.8% | — |
nii_set_dtype |
5.11 ±0.00 | 5.20 ±0.00 | +1.8% | — |
nii_pad_to |
5.30 ±0.00 | 5.39 ±0.00 | +1.7% | — |
nii_extract_label |
5.30 ±0.00 | 5.39 ±0.00 | +1.7% | — |
nii_map_labels |
5.36 ±0.00 | 5.45 ±0.00 | +1.7% | — |
… 30 more measurements
| Measurement | baseline MiB (median ±½·range) | head MiB (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_reorient |
5.74 ±0.00 | 5.83 ±0.00 | +1.6% | — |
nii_apply_crop |
5.74 ±0.00 | 5.83 ±0.00 | +1.6% | — |
nii_load_seg |
5.84 ±0.00 | 5.93 ±0.00 | +1.5% | — |
poi_calc_centroids_nocrop |
5.86 ±0.00 | 5.95 ±0.00 | +1.5% | — |
poi_calc_centroids |
5.93 ±0.00 | 6.02 ±0.00 | +1.5% | — |
nii_rescale_seg |
5.82 ±0.00 | 5.90 ±0.00 | +1.5% | — |
nii_resample_from_to |
6.13 ±0.00 | 6.22 ±0.00 | +1.5% | — |
nii_rescale |
6.00 ±0.00 | 6.09 ±0.00 | +1.4% | — |
nii_fill_holes |
6.16 ±0.00 | 6.24 ±0.00 | +1.4% | — |
nii_get_connected_components |
6.49 ±0.00 | 6.58 ±0.00 | +1.4% | — |
nii_filter_connected_components |
6.74 ±0.00 | 6.83 ±0.00 | +1.3% | — |
nii_dilate_msk |
5.80 ±0.00 | 5.87 ±0.00 | +1.1% | — |
nii_erode_msk |
5.80 ±0.00 | 5.87 ±0.00 | +1.1% | — |
poi_to_global |
3.02 ±0.00 | 3.02 ±0.00 | +0.1% | — |
nii_center_of_masses |
3.21 ±0.00 | 3.21 ±0.00 | +0.1% | — |
nii_volumes |
3.46 ±0.00 | 3.46 ±0.00 | +0.1% | — |
nii_load_img |
3.46 ±0.00 | 3.46 ±0.00 | +0.1% | — |
nii_save |
3.64 ±0.00 | 3.65 ±0.00 | +0.1% | — |
poi_reorient |
3.77 ±0.00 | 3.77 ±0.00 | +0.1% | — |
metric_voxels |
3431.00 ±0.00 | 3431.00 ±0.00 | +0.0% | — |
metric_labels |
3.00 ±0.00 | 3.00 ±0.00 | +0.0% | — |
metric_foreground_pct |
37.60 ±0.00 | 37.60 ±0.00 | +0.0% | — |
poi_rescale |
2.54 ±0.00 | 2.54 ±0.00 | +0.2% (noise) | — |
nii_compute_crop |
2.83 ±0.00 | 2.84 ±0.00 | +0.1% (noise) | — |
poi_local_to_global_arr |
2.89 ±0.00 | 2.89 ±0.00 | +0.1% (noise) | — |
nii_unique |
2.89 ±0.00 | 2.90 ±0.00 | +0.1% (noise) | — |
nii_get_array |
1.59 ±0.00 | 1.59 ±0.00 | +0.0% (noise) | — |
poi_save |
1.34 ±0.00 | 1.34 ±0.00 | +0.0% (noise) | — |
poi_map_labels |
1.71 ±0.00 | 1.71 ±0.00 | +0.0% (noise) | — |
poi_load |
1.55 ±0.00 | 1.55 ±0.00 | +0.0% (noise) | — |
mri_3d — shape (68, 52, 67)
| Measurement | baseline MiB (median ±½·range) | head MiB (median ±½·range) | Δ % | p |
|---|---|---|---|---|
poi_resample_from_to |
5.11 ±0.00 | 5.20 ±0.00 | +1.8% | — |
nii_set_dtype |
5.18 ±0.00 | 5.27 ±0.00 | +1.7% | — |
nii_pad_to |
5.30 ±0.00 | 5.39 ±0.00 | +1.7% | — |
nii_extract_label |
5.30 ±0.00 | 5.39 ±0.00 | +1.7% | — |
nii_map_labels |
5.36 ±0.00 | 5.45 ±0.00 | +1.7% | — |
… 31 more measurements
| Measurement | baseline MiB (median ±½·range) | head MiB (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_reorient |
5.74 ±0.00 | 5.83 ±0.00 | +1.6% | — |
nii_apply_crop |
5.74 ±0.00 | 5.83 ±0.00 | +1.6% | — |
poi_calc_centroids_nocrop |
5.80 ±0.00 | 5.89 ±0.00 | +1.5% | — |
nii_load_seg |
5.84 ±0.00 | 5.93 ±0.00 | +1.5% | — |
poi_calc_centroids |
5.93 ±0.00 | 6.02 ±0.00 | +1.5% | — |
nii_rescale_seg |
5.82 ±0.00 | 5.90 ±0.00 | +1.5% | — |
nii_resample_from_to |
6.13 ±0.00 | 6.22 ±0.00 | +1.5% | — |
nii_rescale |
6.00 ±0.00 | 6.09 ±0.00 | +1.4% | — |
nii_fill_holes |
6.16 ±0.00 | 6.24 ±0.00 | +1.4% | — |
nii_get_connected_components |
6.49 ±0.00 | 6.58 ±0.00 | +1.4% | — |
nii_filter_connected_components |
6.74 ±0.00 | 6.83 ±0.00 | +1.3% | — |
poi_calc_poi_from_subreg_vert |
7.05 ±0.00 | 7.14 ±0.00 | +1.3% | — |
nii_dilate_msk |
5.80 ±0.00 | 5.87 ±0.00 | +1.1% | — |
nii_erode_msk |
5.80 ±0.00 | 5.87 ±0.00 | +1.1% | — |
poi_to_global |
3.02 ±0.00 | 3.02 ±0.00 | +0.1% | — |
nii_center_of_masses |
3.21 ±0.00 | 3.21 ±0.00 | +0.1% | — |
nii_volumes |
3.46 ±0.00 | 3.46 ±0.00 | +0.1% | — |
nii_load_img |
3.52 ±0.00 | 3.53 ±0.00 | +0.1% | — |
nii_save |
3.64 ±0.00 | 3.65 ±0.00 | +0.1% | — |
poi_reorient |
3.77 ±0.00 | 3.77 ±0.00 | +0.1% | — |
metric_voxels |
236912.00 ±0.00 | 236912.00 ±0.00 | +0.0% | — |
metric_labels |
8.00 ±0.00 | 8.00 ±0.00 | +0.0% | — |
metric_foreground_pct |
18.21 ±0.00 | 18.21 ±0.00 | +0.0% | — |
poi_rescale |
2.54 ±0.00 | 2.54 ±0.00 | +0.2% (noise) | — |
nii_compute_crop |
2.83 ±0.00 | 2.84 ±0.00 | +0.1% (noise) | — |
poi_local_to_global_arr |
2.89 ±0.00 | 2.89 ±0.00 | +0.1% (noise) | — |
nii_unique |
2.89 ±0.00 | 2.90 ±0.00 | +0.1% (noise) | — |
nii_get_array |
1.59 ±0.00 | 1.59 ±0.00 | +0.0% (noise) | — |
poi_save |
1.40 ±0.00 | 1.40 ±0.00 | +0.0% (noise) | — |
poi_map_labels |
1.71 ±0.00 | 1.71 ±0.00 | +0.0% (noise) | — |
poi_load |
1.55 ±0.00 | 1.55 ±0.00 | +0.0% (noise) | — |
mri_2d — shape (68, 52, 1)
| Measurement | baseline MiB (median ±½·range) | head MiB (median ±½·range) | Δ % | p |
|---|---|---|---|---|
poi_resample_from_to |
5.11 ±0.00 | 5.20 ±0.00 | +1.8% | — |
nii_set_dtype |
5.18 ±0.00 | 5.27 ±0.00 | +1.7% | — |
nii_pad_to |
5.30 ±0.00 | 5.39 ±0.00 | +1.7% | — |
nii_extract_label |
5.30 ±0.00 | 5.39 ±0.00 | +1.7% | — |
nii_map_labels |
5.36 ±0.00 | 5.45 ±0.00 | +1.7% | — |
… 30 more measurements
| Measurement | baseline MiB (median ±½·range) | head MiB (median ±½·range) | Δ % | p |
|---|---|---|---|---|
nii_reorient |
5.74 ±0.00 | 5.83 ±0.00 | +1.6% | — |
nii_apply_crop |
5.74 ±0.00 | 5.83 ±0.00 | +1.6% | — |
nii_load_seg |
5.84 ±0.00 | 5.93 ±0.00 | +1.5% | — |
poi_calc_centroids_nocrop |
5.86 ±0.00 | 5.95 ±0.00 | +1.5% | — |
poi_calc_centroids |
5.93 ±0.00 | 6.02 ±0.00 | +1.5% | — |
nii_rescale_seg |
5.82 ±0.00 | 5.90 ±0.00 | +1.5% | — |
nii_resample_from_to |
6.13 ±0.00 | 6.22 ±0.00 | +1.5% | — |
nii_rescale |
6.00 ±0.00 | 6.09 ±0.00 | +1.4% | — |
nii_fill_holes |
6.16 ±0.00 | 6.24 ±0.00 | +1.4% | — |
nii_get_connected_components |
6.49 ±0.00 | 6.58 ±0.00 | +1.4% | — |
nii_filter_connected_components |
6.74 ±0.00 | 6.83 ±0.00 | +1.3% | — |
nii_dilate_msk |
5.80 ±0.00 | 5.87 ±0.00 | +1.1% | — |
nii_erode_msk |
5.80 ±0.00 | 5.87 ±0.00 | +1.1% | — |
poi_to_global |
3.02 ±0.00 | 3.02 ±0.00 | +0.1% | — |
nii_center_of_masses |
3.21 ±0.00 | 3.21 ±0.00 | +0.1% | — |
nii_volumes |
3.46 ±0.00 | 3.46 ±0.00 | +0.1% | — |
nii_load_img |
3.52 ±0.00 | 3.53 ±0.00 | +0.1% | — |
nii_save |
3.64 ±0.00 | 3.65 ±0.00 | +0.1% | — |
poi_reorient |
3.77 ±0.00 | 3.77 ±0.00 | +0.1% | — |
metric_voxels |
3536.00 ±0.00 | 3536.00 ±0.00 | +0.0% | — |
metric_labels |
7.00 ±0.00 | 7.00 ±0.00 | +0.0% | — |
metric_foreground_pct |
50.17 ±0.00 | 50.17 ±0.00 | +0.0% | — |
poi_rescale |
2.54 ±0.00 | 2.54 ±0.00 | +0.2% (noise) | — |
nii_compute_crop |
2.83 ±0.00 | 2.84 ±0.00 | +0.1% (noise) | — |
poi_local_to_global_arr |
2.89 ±0.00 | 2.89 ±0.00 | +0.1% (noise) | — |
nii_unique |
2.89 ±0.00 | 2.90 ±0.00 | +0.1% (noise) | — |
nii_get_array |
1.59 ±0.00 | 1.59 ±0.00 | +0.0% (noise) | — |
poi_save |
1.40 ±0.00 | 1.40 ±0.00 | +0.0% (noise) | — |
poi_map_labels |
1.71 ±0.00 | 1.71 ±0.00 | +0.0% (noise) | — |
poi_load |
1.55 ±0.00 | 1.55 ±0.00 | +0.0% (noise) | — |
Gate: a measurement fails when the baseline is ≥ 1 MiB, the median grows by ≥ 50%, and Welch's t-test gives p < 0.05. metric_* rows are context only.
Body:
Summary
unit_tests/test_mesh3D.pycoveringMesh3Dsave/load,SegmentationMesh,POIMesh,mesh_colors,Preview_Settings, andmake_snapshot3Dend-to-end.Tests skip cleanly when optional deps (pyvista, vtk, fury, Pi
Xvfb) are missing.
TPTBox.mesh3Dcoverage: 38% → 86% (mesh.py 0→82, snapshot3D.py 0→77,html_preview.py 0→64).
SegmentationMesh.__init__/POIMesh.__init rewritemesh3D/README.md— old symbols (Mesh,LABEL_COLORS,label_to_color,create_snapshot3D,create_html_preview,seg.unique_labels()`) no longer exist.fury >=0.9,<2.0. fury 2.x is a pygfx-based rewrite thatwindow.recordand changedShowManager/Scenesignaturessnapshot3D.pyrelies on. Pinning is the minimal fix until snapshot3D is por
fury,Pillow,xvfbwrapperto thedevpoetry group and install thedev group +
xvfb/libgl1intests.yml/tests_mr.ymlso the CPU-onlymesh3D tests actually run in CI.
Test plan
poetry install --with devsucceeds on Linux (and skipsxvfbwrapperon other OSes).pytest unit_tests/test_mesh3D.py— 27 pass, 1 skip on mter]/trame`.tests.ymlandtests_mr.ymlsucceed on the PR — verify the new mesh3Dtests aren't silently skipped.