Skip to content

Stitching refactor + RAM-saving overlap + c_val option + trivial-memory warning - #157

Open
robert-graf wants to merge 9 commits into
mainfrom
robert-pc-pr-stitching-refactor
Open

robert-graf wants to merge 9 commits into
mainfrom
robert-pc-pr-stitching-refactor

Conversation

@robert-graf

Copy link
Copy Markdown
Collaborator

Summary

Follow-up cleanup on top of robert-pc. Four self-contained commits, cherry-picked cleanly onto main:

  • Refactor TPTBox/stitching/stitching.py to use existing TPTBox helpers instead of duplicated logic — ~370 LOC deleted, ~220 added.
  • stitching.py + stitching_tools.py: fix min_value handling and keep the overlap NII smaller to save RAM on multi-station stitches.
  • TPTBox/core/nii_wrapper.py + core/internal/nii_help.py: add a c_val option so callers can control the constant fill value used during padding/resampling.
  • TPTBox/segmentation/VibeSeg/inference_nnunet.py: only warn about memory pressure when the required memory is non-trivial (silences the noisy warning for small volumes).

The four commits do not touch files that any of the open PRs below rewrite, so this can go in independently — but see prerequisites for context.

Prerequisite / related PRs

These are the currently open PRs that were merged into robert-pc while this work was developed. None are strict blockers for this PR (the diff here does not overlap with theirs), but they're the natural merge partners and should land around the same time so robert-pc can be rebased away cleanly:

Test plan

  • pytest unit_tests/ passes
  • ruff check . clean
  • Manual: run stitching on a multi-station CT/MRI case and confirm output matches pre-refactor result within tolerance
  • Manual: run a VibeSeg inference on a small volume and confirm the memory warning is no longer emitted
  • Manual: use the new c_val argument in a NII.resample_* / pad path and confirm the fill value is honored

🤖 Generated with Claude Code

@robert-graf robert-graf self-assigned this Sep 25, 2026
- Reflow docstring to satisfy D205 (blank line between summary and body)
- Replace ambiguous MULTIPLICATION SIGN with ASCII '*' in comment

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Benchmark comparison

Speed (wall time per call)

baseline b6e64a6 vs head b6e64a6 · python 3.11.16 · 5 repeats + 1 warmup

Showing the 5 most-changed measurements per case; the rest are collapsed. Rows with a baseline below 3 ms are tagged (noise) — runner jitter on those swamps any real change.

ct_3d — shape (73, 47, 73)

Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_load_seg 3.13 ±0.07 2.92 ±0.14 -6.9% 0.009
nii_rescale_seg 3.16 ±0.02 3.25 ±0.02 +2.6% 0.000
nii_dilate_msk 124.50 ±0.93 127.49 ±0.59 +2.4% 0.000
nii_erode_msk 6.32 ±0.07 6.44 ±0.12 +1.9% 0.028
nii_fill_holes 4.65 ±0.06 4.74 ±0.10 +1.9% 0.118
… 31 more measurements
Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_filter_connected_components 4.35 ±0.14 4.42 ±0.11 +1.7% 0.080
poi_calc_poi_from_subreg_vert 12.79 ±0.17 12.98 ±0.26 +1.4% 0.173
nii_load_img 10.99 ±0.18 10.85 ±0.10 -1.4% 0.084
nii_resample_from_to 41.82 ±0.22 42.30 ±0.36 +1.2% 0.164
poi_calc_centroids_nocrop 4.56 ±0.11 4.61 ±0.07 +1.1% 0.981
nii_rescale 39.89 ±0.23 40.22 ±0.23 +0.8% 0.069
nii_save 11.94 ±0.08 11.89 ±0.12 -0.4% 0.213
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% —
nii_pad_to 0.67 ±0.09 0.80 ±0.05 +20.6% (noise) 0.014
poi_map_labels 0.16 ±0.01 0.19 ±0.02 +18.5% (noise) 0.126
nii_compute_crop 0.31 ±0.01 0.35 ±0.01 +12.7% (noise) 0.005
poi_rescale 0.22 ±0.02 0.25 ±0.02 +9.9% (noise) 0.098
poi_save 0.44 ±0.06 0.41 ±0.03 -6.6% (noise) 0.399
nii_apply_crop 0.69 ±0.08 0.74 ±0.04 +6.1% (noise) 0.193
nii_extract_label 0.44 ±0.02 0.46 ±0.03 +4.8% (noise) 0.055
nii_set_dtype 0.53 ±0.02 0.51 ±0.05 -4.4% (noise) 0.068
poi_resample_from_to 0.72 ±0.04 0.69 ±0.08 -4.4% (noise) 0.320
poi_calc_centroids 2.61 ±0.16 2.51 ±0.04 -4.0% (noise) 0.179
poi_to_global 0.21 ±0.03 0.20 ±0.02 -3.9% (noise) 0.380
nii_map_labels 1.05 ±0.04 1.07 ±0.02 +2.9% (noise) 0.047
nii_unique 0.69 ±0.01 0.70 ±0.01 +2.4% (noise) 0.045
nii_get_connected_components 2.36 ±0.08 2.31 ±0.06 -2.1% (noise) 0.301
nii_volumes 1.88 ±0.05 1.91 ±0.02 +1.9% (noise) 0.052
poi_reorient 0.44 ±0.01 0.43 ±0.02 -1.1% (noise) 0.898
nii_center_of_masses 1.78 ±0.04 1.77 ±0.01 -1.1% (noise) 0.890
nii_get_array 0.05 ±0.00 0.05 ±0.00 +0.7% (noise) 0.659
poi_local_to_global_arr 0.31 ±0.01 0.31 ±0.05 -0.6% (noise) 0.910
nii_reorient 0.89 ±0.03 0.90 ±0.08 +0.6% (noise) 0.966
poi_load 1.04 ±0.05 1.04 ±0.03 -0.3% (noise) 0.864

ct_2d — shape (73, 47, 1)

Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_dilate_msk 14.67 ±0.09 14.97 ±0.11 +2.0% 0.003
nii_resample_from_to 7.70 ±0.29 7.68 ±0.19 -0.2% 0.592
nii_rescale 5.49 ±0.14 5.49 ±0.15 -0.1% 0.449
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% —
poi_to_global 0.23 ±0.01 0.25 ±0.02 +8.2% (noise) 0.069
poi_map_labels 0.19 ±0.01 0.21 ±0.01 +8.0% (noise) 0.046
nii_compute_crop 0.15 ±0.01 0.16 ±0.02 +7.7% (noise) 0.313
nii_get_connected_components 0.66 ±0.03 0.70 ±0.04 +6.0% (noise) 0.343
nii_save 1.49 ±0.05 1.40 ±0.04 -5.9% (noise) 0.039
nii_set_dtype 0.45 ±0.03 0.42 ±0.03 -5.5% (noise) 0.759
poi_local_to_global_arr 0.33 ±0.01 0.34 ±0.01 +4.8% (noise) 0.006
poi_save 0.49 ±0.02 0.51 ±0.02 +4.6% (noise) 0.186
nii_fill_holes 0.89 ±0.05 0.92 ±0.03 +4.2% (noise) 0.864
poi_load 1.06 ±0.04 1.10 ±0.05 +4.0% (noise) 0.139
poi_rescale 0.27 ±0.01 0.28 ±0.01 +3.7% (noise) 0.359
nii_volumes 0.31 ±0.01 0.30 ±0.01 -2.5% (noise) 0.977
nii_erode_msk 1.05 ±0.05 1.08 ±0.03 +2.3% (noise) 0.372
nii_apply_crop 0.74 ±0.03 0.72 ±0.03 -2.0% (noise) 0.719
nii_rescale_seg 0.84 ±0.03 0.86 ±0.02 +2.0% (noise) 0.218
poi_calc_centroids_nocrop 1.18 ±0.05 1.20 ±0.04 +1.8% (noise) 0.321
nii_map_labels 0.52 ±0.02 0.51 ±0.07 -1.8% (noise) 0.551
poi_resample_from_to 0.76 ±0.08 0.77 ±0.03 +1.8% (noise) 0.688
nii_unique 0.13 ±0.00 0.13 ±0.02 +1.5% (noise) 0.304
nii_load_img 1.56 ±0.05 1.58 ±0.05 +1.5% (noise) 0.411
nii_filter_connected_components 0.88 ±0.06 0.89 ±0.03 +1.5% (noise) 0.960
nii_extract_label 0.47 ±0.02 0.47 ±0.02 +1.4% (noise) 0.819
nii_pad_to 0.59 ±0.04 0.59 ±0.02 +1.2% (noise) 0.901
nii_get_array 0.02 ±0.00 0.02 ±0.00 -1.1% (noise) 0.525
nii_reorient 0.88 ±0.06 0.87 ±0.05 -1.0% (noise) 0.374
nii_load_seg 1.76 ±0.07 1.75 ±0.04 -0.8% (noise) 0.428
poi_reorient 0.46 ±0.05 0.46 ±0.02 -0.6% (noise) 0.458
poi_calc_centroids 0.96 ±0.03 0.96 ±0.04 +0.5% (noise) 0.895
nii_center_of_masses 0.22 ±0.01 0.22 ±0.01 -0.4% (noise) 0.478

mri_3d — shape (68, 52, 67)

Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_rescale_seg 3.18 ±0.04 3.27 ±0.04 +3.1% 0.028
nii_erode_msk 8.01 ±0.14 7.88 ±0.15 -1.7% 0.177
nii_dilate_msk 162.24 ±1.96 164.74 ±1.02 +1.5% 0.256
nii_fill_holes 5.52 ±0.08 5.47 ±0.07 -0.8% 0.777
poi_calc_poi_from_subreg_vert 12.09 ±0.51 11.99 ±0.28 -0.8% 0.332
… 31 more measurements
Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_save 9.53 ±0.16 9.56 ±0.11 +0.3% 0.995
nii_rescale 37.94 ±0.32 38.04 ±0.23 +0.3% 0.965
nii_load_img 8.89 ±0.13 8.87 ±0.07 -0.2% 0.490
nii_resample_from_to 40.45 ±0.27 40.49 ±0.19 +0.1% 0.568
poi_calc_centroids_nocrop 8.85 ±0.25 8.86 ±0.16 +0.1% 0.647
nii_filter_connected_components 4.83 ±0.19 4.83 ±0.08 +0.0% 0.389
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_compute_crop 0.35 ±0.01 0.38 ±0.04 +8.6% (noise) 0.131
poi_reorient 0.48 ±0.02 0.51 ±0.05 +7.1% (noise) 0.088
nii_pad_to 0.75 ±0.03 0.79 ±0.03 +5.6% (noise) 0.051
poi_map_labels 0.25 ±0.02 0.24 ±0.01 -5.4% (noise) 0.137
poi_local_to_global_arr 0.33 ±0.01 0.35 ±0.01 +4.8% (noise) 0.266
poi_to_global 0.28 ±0.02 0.29 ±0.01 +4.4% (noise) 0.050
nii_get_array 0.06 ±0.00 0.06 ±0.00 -4.3% (noise) 0.080
nii_set_dtype 0.57 ±0.01 0.59 ±0.02 +3.4% (noise) 0.109
nii_map_labels 1.09 ±0.04 1.12 ±0.05 +3.1% (noise) 0.264
nii_load_seg 2.92 ±0.09 3.01 ±0.11 +3.0% (noise) 0.092
nii_extract_label 0.50 ±0.02 0.48 ±0.02 -2.9% (noise) 0.709
nii_reorient 0.92 ±0.03 0.94 ±0.04 +2.5% (noise) 0.341
poi_load 2.32 ±0.09 2.37 ±0.11 +2.2% (noise) 0.860
nii_unique 0.67 ±0.02 0.68 ±0.02 +1.6% (noise) 0.632
poi_resample_from_to 0.80 ±0.02 0.79 ±0.02 -1.5% (noise) 0.361
nii_volumes 1.97 ±0.02 1.99 ±0.09 +1.2% (noise) 0.254
poi_calc_centroids 2.85 ±0.04 2.88 ±0.09 +1.1% (noise) 0.139
poi_rescale 0.30 ±0.02 0.30 ±0.02 -0.9% (noise) 0.580
nii_apply_crop 0.75 ±0.03 0.76 ±0.01 +0.7% (noise) 0.483
poi_save 0.61 ±0.03 0.60 ±0.04 -0.6% (noise) 0.605
nii_center_of_masses 1.99 ±0.00 2.00 ±0.02 +0.5% (noise) 0.047
nii_get_connected_components 2.30 ±0.07 2.30 ±0.05 -0.3% (noise) 0.599

mri_2d — shape (68, 52, 1)

Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_dilate_msk 19.68 ±0.10 19.96 ±0.20 +1.4% 0.012
nii_resample_from_to 7.72 ±0.18 7.77 ±0.19 +0.6% 0.242
nii_rescale 5.60 ±0.12 5.61 ±0.66 +0.1% 0.323
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% —
poi_map_labels 0.22 ±0.01 0.25 ±0.01 +13.6% (noise) 0.003
poi_save 0.52 ±0.01 0.59 ±0.04 +12.5% (noise) 0.009
poi_resample_from_to 0.74 ±0.03 0.82 ±0.02 +11.1% (noise) 0.003
poi_local_to_global_arr 0.31 ±0.01 0.34 ±0.01 +8.9% (noise) 0.003
poi_to_global 0.26 ±0.02 0.28 ±0.01 +7.8% (noise) 0.447
nii_map_labels 0.52 ±0.03 0.55 ±0.04 +5.3% (noise) 0.297
nii_compute_crop 0.15 ±0.01 0.16 ±0.01 +4.7% (noise) 0.270
nii_pad_to 0.59 ±0.04 0.62 ±0.02 +4.4% (noise) 0.803
nii_unique 0.13 ±0.01 0.13 ±0.01 -3.7% (noise) 0.716
poi_rescale 0.28 ±0.02 0.29 ±0.01 +3.7% (noise) 0.898
nii_reorient 0.88 ±0.03 0.91 ±0.04 +3.3% (noise) 0.378
nii_apply_crop 0.76 ±0.07 0.73 ±0.02 -3.1% (noise) 0.459
nii_set_dtype 0.44 ±0.02 0.42 ±0.01 -2.6% (noise) 0.241
poi_calc_centroids 1.19 ±0.03 1.22 ±0.07 +2.4% (noise) 0.219
nii_volumes 0.47 ±0.03 0.48 ±0.02 +2.1% (noise) 0.789
nii_load_img 1.57 ±0.04 1.60 ±0.12 +2.0% (noise) 0.117
nii_center_of_masses 0.42 ±0.02 0.43 ±0.03 +2.0% (noise) 0.247
poi_reorient 0.51 ±0.03 0.52 ±0.02 +2.0% (noise) 0.699
nii_fill_holes 1.15 ±0.02 1.18 ±0.02 +2.0% (noise) 0.093
nii_erode_msk 1.35 ±0.05 1.37 ±0.07 +1.8% (noise) 0.419
nii_extract_label 0.46 ±0.01 0.46 ±0.03 +1.6% (noise) 0.889
nii_filter_connected_components 0.89 ±0.04 0.91 ±0.03 +1.2% (noise) 0.666
nii_save 1.46 ±0.06 1.44 ±0.04 -1.2% (noise) 0.536
poi_load 2.03 ±0.11 2.05 ±0.08 +1.1% (noise) 0.403
nii_load_seg 1.79 ±0.07 1.78 ±0.08 -1.0% (noise) 0.817
nii_get_connected_components 0.66 ±0.05 0.66 ±0.02 +0.8% (noise) 0.918
nii_rescale_seg 0.83 ±0.02 0.83 ±0.02 -0.7% (noise) 0.668
nii_get_array 0.02 ±0.00 0.02 ±0.00 -0.5% (noise) 0.463
poi_calc_centroids_nocrop 1.53 ±0.03 1.53 ±0.03 -0.1% (noise) 0.991

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 b6e64a6 vs head b6e64a6 · 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
nii_rescale 6.17 ±0.00 6.07 ±0.00 -1.6% —
nii_resample_from_to 6.29 ±0.00 6.20 ±0.00 -1.6% —
poi_resample_from_to 5.25 ±0.00 5.18 ±0.00 -1.3% —
nii_reorient 5.88 ±0.00 5.81 ±0.00 -1.1% —
nii_load_img 3.56 ±0.00 3.52 ±0.00 -1.1% —
… 31 more measurements
Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_load_seg 5.97 ±0.00 5.91 ±0.00 -1.0% —
nii_rescale_seg 5.94 ±0.00 5.88 ±0.00 -1.0% —
nii_dilate_msk 5.90 ±0.00 5.86 ±0.00 -0.6% —
nii_erode_msk 5.91 ±0.00 5.88 ±0.00 -0.6% —
nii_set_dtype 5.21 ±0.00 5.18 ±0.00 -0.5% —
nii_extract_label 5.34 ±0.00 5.31 ±0.00 -0.5% —
nii_pad_to 5.39 ±0.00 5.37 ±0.00 -0.5% —
nii_map_labels 5.46 ±0.00 5.43 ±0.00 -0.5% —
nii_fill_holes 6.25 ±0.00 6.22 ±0.00 -0.5% —
nii_apply_crop 5.83 ±0.00 5.80 ±0.00 -0.5% —
poi_calc_centroids_nocrop 5.89 ±0.00 5.87 ±0.00 -0.5% —
poi_calc_centroids 6.02 ±0.00 6.00 ±0.00 -0.5% —
nii_get_connected_components 6.59 ±0.00 6.56 ±0.00 -0.4% —
nii_filter_connected_components 6.84 ±0.00 6.81 ±0.00 -0.4% —
poi_calc_poi_from_subreg_vert 7.08 ±0.00 7.05 ±0.00 -0.4% —
poi_to_global 3.08 ±0.00 3.08 ±0.00 -0.1% —
nii_center_of_masses 3.27 ±0.00 3.27 ±0.00 -0.1% —
nii_volumes 3.52 ±0.00 3.52 ±0.00 -0.1% —
nii_save 3.71 ±0.00 3.70 ±0.00 -0.1% —
poi_reorient 3.83 ±0.00 3.83 ±0.00 -0.1% —
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_save 1.40 ±0.00 1.39 ±0.00 -0.3% (noise) —
poi_load 1.61 ±0.00 1.61 ±0.00 -0.2% (noise) —
nii_get_array 1.65 ±0.00 1.64 ±0.00 -0.2% (noise) —
poi_map_labels 1.77 ±0.00 1.77 ±0.00 -0.2% (noise) —
poi_rescale 2.61 ±0.00 2.60 ±0.00 -0.1% (noise) —
nii_compute_crop 2.90 ±0.00 2.89 ±0.00 -0.1% (noise) —
poi_local_to_global_arr 2.96 ±0.00 2.95 ±0.00 -0.1% (noise) —
nii_unique 2.96 ±0.00 2.96 ±0.00 -0.1% (noise) —

ct_2d — shape (73, 47, 1)

Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_rescale 6.11 ±0.00 6.01 ±0.00 -1.6% —
nii_resample_from_to 6.23 ±0.00 6.13 ±0.00 -1.6% —
poi_resample_from_to 5.18 ±0.00 5.12 ±0.00 -1.3% —
nii_reorient 5.81 ±0.00 5.75 ±0.00 -1.1% —
nii_load_img 3.50 ±0.00 3.46 ±0.00 -1.1% —
… 30 more measurements
Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_load_seg 5.91 ±0.00 5.85 ±0.00 -1.1% —
nii_rescale_seg 5.88 ±0.00 5.82 ±0.00 -1.0% —
nii_dilate_msk 5.84 ±0.00 5.80 ±0.00 -0.6% —
nii_erode_msk 5.85 ±0.00 5.82 ±0.00 -0.6% —
nii_set_dtype 5.15 ±0.00 5.12 ±0.00 -0.5% —
nii_extract_label 5.27 ±0.00 5.25 ±0.00 -0.5% —
nii_pad_to 5.33 ±0.00 5.30 ±0.00 -0.5% —
nii_map_labels 5.40 ±0.00 5.37 ±0.00 -0.5% —
nii_fill_holes 6.19 ±0.00 6.16 ±0.00 -0.5% —
nii_apply_crop 5.77 ±0.00 5.74 ±0.00 -0.5% —
poi_calc_centroids_nocrop 5.89 ±0.00 5.87 ±0.00 -0.5% —
poi_calc_centroids 5.96 ±0.00 5.93 ±0.00 -0.5% —
nii_get_connected_components 6.52 ±0.00 6.50 ±0.00 -0.4% —
nii_filter_connected_components 6.77 ±0.00 6.75 ±0.00 -0.4% —
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_save 3.64 ±0.00 3.64 ±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_save 1.34 ±0.00 1.33 ±0.00 -0.3% (noise) —
poi_load 1.55 ±0.00 1.55 ±0.00 -0.3% (noise) —
nii_get_array 1.59 ±0.00 1.58 ±0.00 -0.2% (noise) —
poi_map_labels 1.71 ±0.00 1.71 ±0.00 -0.2% (noise) —
poi_rescale 2.54 ±0.00 2.54 ±0.00 -0.2% (noise) —
nii_compute_crop 2.84 ±0.00 2.83 ±0.00 -0.1% (noise) —
poi_local_to_global_arr 2.89 ±0.00 2.89 ±0.00 -0.1% (noise) —
nii_unique 2.90 ±0.00 2.89 ±0.00 -0.1% (noise) —

mri_3d — shape (68, 52, 67)

Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_rescale 6.11 ±0.00 6.01 ±0.00 -1.6% —
nii_resample_from_to 6.23 ±0.00 6.13 ±0.00 -1.6% —
poi_resample_from_to 5.18 ±0.00 5.12 ±0.00 -1.3% —
nii_reorient 5.81 ±0.00 5.75 ±0.00 -1.1% —
nii_load_img 3.56 ±0.00 3.52 ±0.00 -1.1% —
… 31 more measurements
Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_load_seg 5.91 ±0.00 5.85 ±0.00 -1.1% —
nii_rescale_seg 5.88 ±0.00 5.82 ±0.00 -1.0% —
nii_dilate_msk 5.84 ±0.00 5.80 ±0.00 -0.6% —
nii_erode_msk 5.85 ±0.00 5.82 ±0.00 -0.6% —
nii_set_dtype 5.21 ±0.00 5.18 ±0.00 -0.5% —
nii_extract_label 5.27 ±0.00 5.25 ±0.00 -0.5% —
nii_pad_to 5.33 ±0.00 5.30 ±0.00 -0.5% —
nii_map_labels 5.40 ±0.00 5.37 ±0.00 -0.5% —
nii_fill_holes 6.19 ±0.00 6.16 ±0.00 -0.5% —
nii_apply_crop 5.77 ±0.00 5.74 ±0.00 -0.5% —
poi_calc_centroids_nocrop 5.83 ±0.00 5.80 ±0.00 -0.5% —
poi_calc_centroids 5.96 ±0.00 5.93 ±0.00 -0.5% —
nii_get_connected_components 6.52 ±0.00 6.50 ±0.00 -0.4% —
nii_filter_connected_components 6.77 ±0.00 6.75 ±0.00 -0.4% —
poi_calc_poi_from_subreg_vert 7.08 ±0.00 7.05 ±0.00 -0.4% —
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_save 3.64 ±0.00 3.64 ±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_save 1.40 ±0.00 1.39 ±0.00 -0.3% (noise) —
poi_load 1.55 ±0.00 1.55 ±0.00 -0.3% (noise) —
nii_get_array 1.59 ±0.00 1.58 ±0.00 -0.2% (noise) —
poi_map_labels 1.71 ±0.00 1.71 ±0.00 -0.2% (noise) —
poi_rescale 2.54 ±0.00 2.54 ±0.00 -0.2% (noise) —
nii_compute_crop 2.84 ±0.00 2.83 ±0.00 -0.1% (noise) —
poi_local_to_global_arr 2.89 ±0.00 2.89 ±0.00 -0.1% (noise) —
nii_unique 2.90 ±0.00 2.89 ±0.00 -0.1% (noise) —

mri_2d — shape (68, 52, 1)

Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_rescale 6.11 ±0.00 6.01 ±0.00 -1.6% —
nii_resample_from_to 6.23 ±0.00 6.13 ±0.00 -1.6% —
poi_resample_from_to 5.18 ±0.00 5.12 ±0.00 -1.3% —
nii_reorient 5.81 ±0.00 5.75 ±0.00 -1.1% —
nii_load_img 3.56 ±0.00 3.52 ±0.00 -1.1% —
… 30 more measurements
Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_load_seg 5.91 ±0.00 5.85 ±0.00 -1.1% —
nii_rescale_seg 5.88 ±0.00 5.82 ±0.00 -1.0% —
nii_dilate_msk 5.84 ±0.00 5.80 ±0.00 -0.6% —
nii_erode_msk 5.85 ±0.00 5.82 ±0.00 -0.6% —
nii_set_dtype 5.21 ±0.00 5.18 ±0.00 -0.5% —
nii_extract_label 5.27 ±0.00 5.25 ±0.00 -0.5% —
nii_pad_to 5.33 ±0.00 5.30 ±0.00 -0.5% —
nii_map_labels 5.40 ±0.00 5.37 ±0.00 -0.5% —
nii_fill_holes 6.19 ±0.00 6.16 ±0.00 -0.5% —
nii_apply_crop 5.77 ±0.00 5.74 ±0.00 -0.5% —
poi_calc_centroids_nocrop 5.89 ±0.00 5.87 ±0.00 -0.5% —
poi_calc_centroids 5.96 ±0.00 5.93 ±0.00 -0.5% —
nii_get_connected_components 6.52 ±0.00 6.50 ±0.00 -0.4% —
nii_filter_connected_components 6.77 ±0.00 6.75 ±0.00 -0.4% —
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_save 3.64 ±0.00 3.64 ±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_save 1.40 ±0.00 1.39 ±0.00 -0.3% (noise) —
poi_load 1.55 ±0.00 1.55 ±0.00 -0.3% (noise) —
nii_get_array 1.59 ±0.00 1.58 ±0.00 -0.2% (noise) —
poi_map_labels 1.71 ±0.00 1.71 ±0.00 -0.2% (noise) —
poi_rescale 2.54 ±0.00 2.54 ±0.00 -0.2% (noise) —
nii_compute_crop 2.84 ±0.00 2.83 ±0.00 -0.1% (noise) —
poi_local_to_global_arr 2.89 ±0.00 2.89 ±0.00 -0.1% (noise) —
nii_unique 2.90 ±0.00 2.89 ±0.00 -0.1% (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant