Skip to content

dicom: deterministic, collision-free XA/DSA export - #162

Open
robert-graf wants to merge 8 commits into
mainfrom
feature/xa-dsa-deterministic-export
Open

robert-graf wants to merge 8 commits into
mainfrom
feature/xa-dsa-deterministic-export

Conversation

@robert-graf

Copy link
Copy Markdown
Collaborator

Format choice (dicom_header_to_keys):

  • decide DSA / fluroscopy from ImageType + DerivationDescription, SeriesDescription only as fallback (subtracted "Durchleuchtung" runs were filed as fluroscopy)
  • DERIVED+PRIMARY without SUBTRACTION is DSA; missing PositionerMotion counts as static
  • substring test on DerivationDescription (the equality test never matched "SUBTRACTION;FRAME_SELECTION")
  • key frames (FRAME_SELECTION) get rec-keyframe
  • single-frame objects get their own ending: DSA-still / fluroscopy-still

Extraction (dicom_extract):

  • name resolution (conflict test, _inc_key, JSON reservation) runs under a lock; a series that is already being converted is not converted twice. Fixes truncated NIfTIs and lost series with n_cpu > 1
  • series are processed chronologically (original with IrradiationEventUID first, full run before key frame); with n_cpu > 1 the names are still claimed in that order, so the -a/-b suffix no longer depends on thread speed
  • ignore_keys_for_conflict (default SOPInstanceUID, ReferencedImageSequence): a series stored twice yields one file instead of a second one renamed -a
  • opt-in: skip_recomputed_xa_copies, xa_run_by_time / xa_run_tolerance_s (run entity numbered by acquisition time instead of the re-used SeriesNumber)

test_name_conflict gains ignore_keys. Tests in unit_tests/test_dicom_xa.py.

Format choice (dicom_header_to_keys):
- decide DSA / fluroscopy from ImageType + DerivationDescription, SeriesDescription
  only as fallback (subtracted "Durchleuchtung" runs were filed as fluroscopy)
- DERIVED+PRIMARY without SUBTRACTION is DSA; missing PositionerMotion counts as static
- substring test on DerivationDescription (the equality test never matched
  "SUBTRACTION;FRAME_SELECTION")
- key frames (FRAME_SELECTION) get rec-keyframe
- single-frame objects get their own ending: DSA-still / fluroscopy-still

Extraction (dicom_extract):
- name resolution (conflict test, _inc_key, JSON reservation) runs under a lock; a series
  that is already being converted is not converted twice. Fixes truncated NIfTIs and
  lost series with n_cpu > 1
- series are processed chronologically (original with IrradiationEventUID first, full
  run before key frame); with n_cpu > 1 the names are still claimed in that order, so
  the -a/-b suffix no longer depends on thread speed
- ignore_keys_for_conflict (default SOPInstanceUID, ReferencedImageSequence): a series
  stored twice yields one file instead of a second one renamed -a
- opt-in: skip_recomputed_xa_copies, xa_run_by_time / xa_run_tolerance_s (run entity
  numbered by acquisition time instead of the re-used SeriesNumber)

test_name_conflict gains ignore_keys. Tests in unit_tests/test_dicom_xa.py.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@robert-graf robert-graf self-assigned this Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Benchmark comparison

Speed (wall time per call)

baseline a5b4b8d vs head a5b4b8d · python 3.11.18 · 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_resample_from_to 24.13 ±0.59 25.35 ±0.67 +5.1% 0.029
nii_load_img 8.18 ±0.14 7.80 ±0.19 -4.6% 0.036
nii_fill_holes 3.24 ±0.07 3.09 ±0.12 -4.6% 0.044
nii_save 7.25 ±0.13 7.04 ±0.11 -3.0% 0.018
poi_calc_poi_from_subreg_vert 6.95 ±0.17 6.77 ±0.28 -2.6% 0.704
… 31 more measurements
Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_rescale 24.55 ±0.17 23.97 ±1.11 -2.3% 0.437
nii_dilate_msk 67.28 ±2.30 68.79 ±0.83 +2.2% 0.257
nii_erode_msk 3.85 ±0.13 3.89 ±0.16 +1.0% 0.476
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_get_array 0.03 ±0.00 0.02 ±0.00 -43.5% (noise) 0.002
nii_apply_crop 0.40 ±0.03 0.53 ±0.03 +32.8% (noise) 0.000
nii_set_dtype 0.35 ±0.07 0.26 ±0.02 -26.7% (noise) 0.058
nii_pad_to 0.42 ±0.03 0.53 ±0.03 +25.7% (noise) 0.000
poi_load 0.47 ±0.02 0.57 ±0.01 +22.9% (noise) 0.000
nii_reorient 0.54 ±0.08 0.43 ±0.03 -20.9% (noise) 0.012
poi_resample_from_to 0.34 ±0.03 0.39 ±0.05 +16.0% (noise) 0.083
nii_compute_crop 0.22 ±0.02 0.25 ±0.02 +15.0% (noise) 0.070
nii_load_seg 1.94 ±0.13 1.70 ±0.04 -12.1% (noise) 0.007
poi_map_labels 0.08 ±0.01 0.09 ±0.00 +10.4% (noise) 0.348
nii_extract_label 0.28 ±0.01 0.26 ±0.02 -9.9% (noise) 0.078
poi_rescale 0.11 ±0.01 0.10 ±0.01 -8.1% (noise) 0.241
nii_rescale_seg 1.93 ±0.04 1.78 ±0.01 -7.7% (noise) 0.001
poi_reorient 0.28 ±0.04 0.26 ±0.16 -6.7% (noise) 0.362
nii_map_labels 0.58 ±0.03 0.54 ±0.03 -6.4% (noise) 0.220
nii_volumes 1.14 ±0.01 1.08 ±0.03 -4.8% (noise) 0.007
nii_unique 0.48 ±0.01 0.50 ±0.01 +4.4% (noise) 0.038
poi_local_to_global_arr 0.15 ±0.02 0.15 ±0.02 -4.2% (noise) 0.786
poi_calc_centroids 1.44 ±0.05 1.50 ±0.03 +4.1% (noise) 0.123
nii_filter_connected_components 2.68 ±0.07 2.78 ±0.03 +3.6% (noise) 0.013
poi_calc_centroids_nocrop 2.84 ±0.09 2.92 ±0.26 +3.1% (noise) 0.378
nii_center_of_masses 1.05 ±0.01 1.04 ±0.03 -0.9% (noise) 0.240
nii_get_connected_components 1.42 ±0.06 1.43 ±0.06 +0.5% (noise) 0.520
poi_to_global 0.11 ±0.01 0.11 ±0.02 +0.4% (noise) 0.849
poi_save 0.27 ±0.03 0.27 ±0.05 +0.2% (noise) 0.319

ct_2d — shape (73, 47, 1)

Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_resample_from_to 4.88 ±0.30 4.48 ±0.15 -8.2% 0.019
nii_rescale 3.86 ±0.50 3.79 ±0.35 -1.9% 0.868
nii_dilate_msk 7.82 ±0.17 7.95 ±0.15 +1.7% 0.368
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_calc_centroids 0.62 ±0.01 0.78 ±0.09 +25.8% (noise) 0.010
nii_get_array 0.01 ±0.00 0.01 ±0.00 +20.6% (noise) 0.229
nii_map_labels 0.37 ±0.02 0.43 ±0.05 +16.6% (noise) 0.051
poi_rescale 0.17 ±0.07 0.20 ±0.01 +15.6% (noise) 0.849
nii_compute_crop 0.14 ±0.01 0.12 ±0.01 -15.0% (noise) 0.032
nii_pad_to 0.53 ±0.07 0.47 ±0.01 -11.7% (noise) 0.053
poi_load 0.59 ±0.02 0.65 ±0.03 +11.1% (noise) 0.002
nii_reorient 0.58 ±0.02 0.64 ±0.03 +10.7% (noise) 0.015
poi_reorient 0.31 ±0.01 0.35 ±0.02 +10.7% (noise) 0.007
nii_save 1.08 ±0.03 1.19 ±0.06 +10.5% (noise) 0.017
nii_apply_crop 0.58 ±0.04 0.62 ±0.09 +7.4% (noise) 0.640
poi_map_labels 0.16 ±0.01 0.18 ±0.03 +7.2% (noise) 0.225
nii_volumes 0.23 ±0.03 0.21 ±0.03 -7.0% (noise) 0.240
nii_rescale_seg 0.63 ±0.04 0.59 ±0.06 -6.3% (noise) 0.707
poi_local_to_global_arr 0.18 ±0.01 0.19 ±0.02 +6.2% (noise) 0.250
poi_resample_from_to 0.51 ±0.02 0.54 ±0.02 +5.5% (noise) 0.035
nii_filter_connected_components 0.62 ±0.03 0.65 ±0.04 +4.9% (noise) 0.049
nii_load_img 1.16 ±0.05 1.10 ±0.07 -4.7% (noise) 0.090
nii_center_of_masses 0.19 ±0.03 0.18 ±0.02 -4.3% (noise) 0.822
nii_unique 0.12 ±0.03 0.11 ±0.03 -4.1% (noise) 0.432
nii_get_connected_components 0.53 ±0.02 0.51 ±0.02 -3.1% (noise) 0.085
nii_extract_label 0.37 ±0.01 0.36 ±0.03 -2.9% (noise) 0.113
nii_fill_holes 0.64 ±0.04 0.62 ±0.04 -1.6% (noise) 0.238
nii_set_dtype 0.35 ±0.04 0.35 ±0.02 -1.4% (noise) 0.276
nii_erode_msk 0.73 ±0.06 0.73 ±0.02 +1.0% (noise) 0.774
poi_save 0.45 ±0.03 0.45 ±0.02 -0.7% (noise) 0.988
poi_to_global 0.19 ±0.02 0.19 ±0.01 -0.6% (noise) 0.876
nii_load_seg 1.28 ±0.04 1.28 ±0.09 +0.4% (noise) 0.485
poi_calc_centroids_nocrop 0.82 ±0.09 0.82 ±0.03 +0.3% (noise) 0.869

mri_3d — shape (68, 52, 67)

Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
poi_calc_poi_from_subreg_vert 6.12 ±0.13 6.51 ±0.06 +6.4% 0.003
nii_rescale 24.30 ±2.12 23.14 ±0.57 -4.7% 0.232
nii_filter_connected_components 3.14 ±0.15 3.01 ±0.06 -4.1% 0.041
nii_dilate_msk 88.06 ±0.56 84.61 ±0.95 -3.9% 0.000
nii_resample_from_to 24.19 ±0.63 23.52 ±0.75 -2.8% 0.146
… 31 more measurements
Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_erode_msk 5.05 ±0.04 4.92 ±0.14 -2.5% 0.342
nii_save 6.14 ±0.09 6.26 ±0.08 +1.9% 0.019
nii_load_img 6.49 ±0.17 6.42 ±0.07 -1.1% 0.841
nii_fill_holes 3.73 ±0.07 3.70 ±0.14 -0.8% 0.543
poi_calc_centroids_nocrop 6.00 ±0.17 5.96 ±0.11 -0.7% 0.548
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_map_labels 0.18 ±0.01 0.22 ±0.02 +22.9% (noise) 0.006
nii_set_dtype 0.39 ±0.02 0.47 ±0.04 +20.6% (noise) 0.005
nii_map_labels 0.83 ±0.03 0.69 ±0.03 -17.8% (noise) 0.000
nii_apply_crop 0.55 ±0.01 0.64 ±0.04 +16.2% (noise) 0.003
poi_resample_from_to 0.56 ±0.04 0.63 ±0.02 +13.3% (noise) 0.002
nii_extract_label 0.35 ±0.03 0.38 ±0.01 +11.0% (noise) 0.165
poi_to_global 0.25 ±0.01 0.22 ±0.02 -10.5% (noise) 0.110
poi_rescale 0.22 ±0.03 0.25 ±0.02 +10.5% (noise) 0.303
nii_pad_to 0.66 ±0.10 0.59 ±0.04 -10.1% (noise) 0.544
poi_load 1.16 ±0.02 1.26 ±0.02 +8.7% (noise) 0.000
nii_get_connected_components 1.59 ±0.23 1.45 ±0.06 -8.3% (noise) 0.153
poi_local_to_global_arr 0.19 ±0.01 0.18 ±0.01 -7.0% (noise) 0.008
nii_unique 0.53 ±0.01 0.49 ±0.01 -6.3% (noise) 0.002
poi_reorient 0.38 ±0.04 0.40 ±0.02 +5.4% (noise) 0.997
poi_calc_centroids 1.94 ±0.05 1.85 ±0.08 -4.6% (noise) 0.106
nii_reorient 0.66 ±0.12 0.69 ±0.07 +4.4% (noise) 0.945
nii_get_array 0.03 ±0.00 0.03 ±0.00 +4.3% (noise) 0.410
poi_save 0.51 ±0.03 0.53 ±0.02 +4.2% (noise) 0.668
nii_compute_crop 0.26 ±0.02 0.27 ±0.02 +3.8% (noise) 0.130
nii_center_of_masses 1.25 ±0.03 1.21 ±0.03 -2.8% (noise) 0.214
nii_rescale_seg 1.96 ±0.05 2.01 ±0.12 +2.4% (noise) 0.127
nii_volumes 1.23 ±0.02 1.23 ±0.02 +0.2% (noise) 0.755
nii_load_seg 2.00 ±0.35 1.99 ±0.05 -0.2% (noise) 0.345

mri_2d — shape (68, 52, 1)

Measurement baseline ms (median ±½·range) head ms (median ±½·range) Δ % p
nii_resample_from_to 4.87 ±0.12 4.52 ±0.09 -7.3% 0.001
nii_rescale 3.96 ±0.53 3.72 ±0.08 -5.9% 0.141
nii_dilate_msk 10.48 ±0.15 10.19 ±0.17 -2.8% 0.038
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_unique 0.12 ±0.01 0.10 ±0.01 -14.5% (noise) 0.213
nii_reorient 0.75 ±0.02 0.67 ±0.03 -10.7% (noise) 0.001
poi_to_global 0.22 ±0.03 0.20 ±0.02 -10.5% (noise) 0.706
nii_compute_crop 0.13 ±0.01 0.12 ±0.01 -8.8% (noise) 0.032
nii_map_labels 0.41 ±0.03 0.45 ±0.03 +8.1% (noise) 0.219
poi_resample_from_to 0.56 ±0.02 0.59 ±0.05 +6.8% (noise) 0.024
nii_center_of_masses 0.29 ±0.02 0.27 ±0.01 -5.4% (noise) 0.527
poi_load 1.07 ±0.02 1.13 ±0.03 +5.2% (noise) 0.007
nii_extract_label 0.40 ±0.11 0.38 ±0.04 -5.2% (noise) 0.259
nii_filter_connected_components 0.62 ±0.03 0.65 ±0.02 +5.2% (noise) 0.266
poi_reorient 0.37 ±0.03 0.36 ±0.02 -4.9% (noise) 0.606
nii_get_array 0.01 ±0.00 0.01 ±0.00 -4.9% (noise) 0.738
nii_pad_to 0.49 ±0.05 0.47 ±0.08 -4.5% (noise) 0.883
nii_set_dtype 0.39 ±0.04 0.37 ±0.08 -4.1% (noise) 0.703
nii_load_img 1.06 ±0.05 1.10 ±0.03 +3.6% (noise) 0.272
nii_save 1.23 ±0.06 1.27 ±0.07 +3.2% (noise) 0.232
poi_calc_centroids_nocrop 0.96 ±0.04 0.99 ±0.06 +2.8% (noise) 0.625
nii_fill_holes 0.72 ±0.04 0.70 ±0.04 -2.4% (noise) 0.567
poi_map_labels 0.19 ±0.02 0.18 ±0.01 -2.3% (noise) 0.715
poi_rescale 0.21 ±0.00 0.21 ±0.01 -2.0% (noise) 0.667
nii_get_connected_components 0.51 ±0.03 0.52 ±0.03 +1.9% (noise) 0.106
nii_rescale_seg 0.70 ±0.05 0.69 ±0.05 -1.7% (noise) 0.794
nii_erode_msk 0.84 ±0.08 0.82 ±0.05 -1.6% (noise) 0.963
poi_calc_centroids 0.79 ±0.03 0.80 ±0.02 +1.5% (noise) 0.862
poi_save 0.49 ±0.01 0.49 ±0.02 +1.3% (noise) 0.576
nii_apply_crop 0.53 ±0.02 0.53 ±0.04 -1.0% (noise) 0.982
poi_local_to_global_arr 0.18 ±0.01 0.18 ±0.01 -0.7% (noise) 0.742
nii_load_seg 1.24 ±0.07 1.23 ±0.08 -0.4% (noise) 0.796
nii_volumes 0.31 ±0.01 0.31 ±0.02 +0.1% (noise) 0.816

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 a5b4b8d vs head a5b4b8d · python 3.11.18 · 5 repeats + 1 warmup · sampler proc-status, isolation fork · measurement floor ≈ 0.78 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 12.61 ±0.00 12.68 ±0.00 +0.6% —
nii_rescale_seg 12.61 ±0.00 12.68 ±0.00 +0.6% 0.000
nii_resample_from_to 12.80 ±0.00 12.87 ±0.00 +0.5% 0.000
poi_map_labels 3.08 ±0.00 3.09 ±0.00 +0.4% —
poi_load 3.11 ±0.00 3.12 ±0.00 +0.4% —
… 31 more measurements
Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_pad_to 12.24 ±0.00 12.20 ±0.00 -0.3% —
poi_calc_centroids_nocrop 12.49 ±0.00 12.45 ±0.00 -0.3% —
nii_extract_label 12.18 ±0.00 12.15 ±0.00 -0.3% —
nii_load_img 5.13 ±0.00 5.14 ±0.00 +0.2% —
nii_set_dtype 12.18 ±0.00 12.15 ±0.00 -0.2% —
nii_reorient 12.30 ±0.00 12.27 ±0.00 -0.2% —
nii_map_labels 12.37 ±0.00 12.34 ±0.00 -0.2% —
nii_dilate_msk 12.37 ±0.00 12.34 ±0.00 -0.2% —
nii_erode_msk 12.45 ±0.00 12.42 ±0.00 -0.2% 0.000
nii_apply_crop 12.47 ±0.00 12.45 ±0.00 -0.2% —
nii_load_seg 12.58 ±0.00 12.55 ±0.00 -0.2% 0.000
poi_calc_centroids 12.68 ±0.00 12.65 ±0.00 -0.2% 0.000
nii_get_connected_components 13.99 ±0.00 13.96 ±0.00 -0.2% —
nii_filter_connected_components 14.18 ±0.00 14.15 ±0.00 -0.2% —
poi_resample_from_to 12.17 ±0.00 12.15 ±0.00 -0.2% 0.000
poi_calc_poi_from_subreg_vert 13.34 ±0.00 13.32 ±0.00 -0.2% 0.000
nii_compute_crop 4.58 ±0.00 4.59 ±0.00 +0.2% —
nii_fill_holes 12.78 ±0.00 12.80 ±0.00 +0.2% —
poi_rescale 5.29 ±0.00 5.30 ±0.00 +0.1% —
nii_unique 5.46 ±0.00 5.46 ±0.00 +0.1% —
nii_volumes 5.96 ±0.00 5.96 ±0.00 +0.1% —
nii_save 7.13 ±0.00 7.14 ±0.00 +0.1% 0.016
poi_local_to_global_arr 7.45 ±0.00 7.46 ±0.00 +0.1% 0.016
poi_to_global 7.52 ±0.00 7.52 ±0.00 +0.1% —
poi_reorient 8.08 ±0.00 8.09 ±0.00 +0.1% —
nii_center_of_masses 4.90 ±0.00 4.90 ±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 2.06 ±0.00 2.07 ±0.00 +0.6% (noise) 0.001
nii_get_array 2.96 ±0.00 2.96 ±0.00 +0.3% (noise) —

ct_2d — shape (73, 47, 1)

Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_rescale 12.61 ±0.00 12.68 ±0.00 +0.6% —
nii_rescale_seg 12.61 ±0.00 12.68 ±0.00 +0.6% —
nii_resample_from_to 12.80 ±0.00 12.87 ±0.00 +0.6% —
poi_map_labels 3.08 ±0.00 3.09 ±0.00 +0.4% —
poi_load 3.11 ±0.00 3.12 ±0.00 +0.4% —
… 30 more measurements
Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_pad_to 12.23 ±0.00 12.20 ±0.00 -0.3% 0.000
poi_calc_centroids_nocrop 12.55 ±0.00 12.51 ±0.00 -0.3% —
nii_compute_crop 4.58 ±0.00 4.59 ±0.00 +0.3% —
nii_center_of_masses 4.89 ±0.00 4.90 ±0.00 +0.2% —
nii_load_img 5.12 ±0.00 5.14 ±0.00 +0.2% —
poi_rescale 5.29 ±0.00 5.30 ±0.00 +0.2% 0.003
nii_unique 5.45 ±0.00 5.46 ±0.00 +0.2% —
nii_volumes 5.95 ±0.00 5.96 ±0.00 +0.2% 0.001
poi_resample_from_to 12.17 ±0.00 12.15 ±0.00 -0.2% —
nii_set_dtype 12.18 ±0.00 12.15 ±0.00 -0.2% —
nii_extract_label 12.18 ±0.03 12.15 ±0.00 -0.2% 0.261
nii_reorient 12.30 ±0.00 12.27 ±0.00 -0.2% —
nii_map_labels 12.36 ±0.00 12.34 ±0.00 -0.2% 0.000
nii_dilate_msk 12.36 ±0.00 12.34 ±0.00 -0.2% —
nii_erode_msk 12.44 ±0.00 12.42 ±0.00 -0.2% 0.000
nii_apply_crop 12.47 ±0.00 12.45 ±0.00 -0.2% —
nii_load_seg 12.58 ±0.00 12.55 ±0.00 -0.2% 0.000
poi_calc_centroids 12.68 ±0.00 12.65 ±0.03 -0.2% 0.030
nii_fill_holes 12.78 ±0.00 12.80 ±0.00 +0.2% —
nii_get_connected_components 13.99 ±0.00 13.96 ±0.00 -0.2% —
nii_filter_connected_components 14.18 ±0.00 14.15 ±0.00 -0.2% —
nii_save 7.12 ±0.00 7.14 ±0.00 +0.2% 0.001
poi_local_to_global_arr 7.45 ±0.00 7.46 ±0.00 +0.2% —
poi_to_global 7.51 ±0.00 7.52 ±0.00 +0.2% —
poi_reorient 8.07 ±0.00 8.09 ±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 2.06 ±0.00 2.07 ±0.00 +0.6% (noise) —
nii_get_array 2.95 ±0.00 2.96 ±0.00 +0.4% (noise) —

mri_3d — shape (68, 52, 67)

Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_rescale 12.61 ±0.00 12.68 ±0.00 +0.6% —
nii_rescale_seg 12.61 ±0.00 12.68 ±0.00 +0.6% —
nii_resample_from_to 12.79 ±0.00 12.87 ±0.00 +0.6% 0.000
poi_map_labels 3.08 ±0.00 3.09 ±0.00 +0.4% —
poi_load 3.11 ±0.00 3.12 ±0.00 +0.4% —
… 31 more measurements
Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_pad_to 12.23 ±0.00 12.20 ±0.00 -0.3% —
poi_calc_centroids_nocrop 12.48 ±0.00 12.45 ±0.00 -0.3% —
nii_compute_crop 4.58 ±0.00 4.59 ±0.00 +0.3% —
nii_center_of_masses 4.89 ±0.00 4.90 ±0.00 +0.2% —
nii_load_img 5.12 ±0.00 5.14 ±0.00 +0.2% —
poi_rescale 5.29 ±0.00 5.30 ±0.00 +0.2% —
nii_unique 5.45 ±0.00 5.46 ±0.00 +0.2% 0.001
nii_volumes 5.95 ±0.00 5.96 ±0.00 +0.2% —
poi_resample_from_to 12.17 ±0.00 12.15 ±0.00 -0.2% —
nii_extract_label 12.18 ±0.00 12.15 ±0.00 -0.2% 0.000
nii_set_dtype 12.24 ±0.00 12.21 ±0.00 -0.2% —
nii_reorient 12.30 ±0.00 12.27 ±0.00 -0.2% —
nii_map_labels 12.36 ±0.00 12.34 ±0.00 -0.2% 0.000
nii_dilate_msk 12.36 ±0.00 12.34 ±0.00 -0.2% —
nii_erode_msk 12.44 ±0.00 12.42 ±0.00 -0.2% 0.000
nii_apply_crop 12.47 ±0.00 12.45 ±0.00 -0.2% —
nii_load_seg 12.58 ±0.00 12.55 ±0.00 -0.2% —
poi_calc_centroids 12.68 ±0.00 12.65 ±0.00 -0.2% —
nii_fill_holes 12.78 ±0.00 12.80 ±0.00 +0.2% —
poi_calc_poi_from_subreg_vert 13.34 ±0.00 13.32 ±0.00 -0.2% —
nii_get_connected_components 13.99 ±0.00 13.96 ±0.00 -0.2% —
nii_filter_connected_components 14.18 ±0.00 14.15 ±0.00 -0.2% —
nii_save 7.12 ±0.00 7.14 ±0.00 +0.2% —
poi_local_to_global_arr 7.45 ±0.00 7.46 ±0.00 +0.2% —
poi_to_global 7.51 ±0.00 7.52 ±0.00 +0.2% 0.001
poi_reorient 8.07 ±0.00 8.09 ±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 2.12 ±0.00 2.13 ±0.00 +0.6% (noise) 0.001
nii_get_array 2.95 ±0.00 2.96 ±0.00 +0.4% (noise) —

mri_2d — shape (68, 52, 1)

Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_rescale 12.61 ±0.00 12.68 ±0.00 +0.6% —
nii_rescale_seg 12.61 ±0.00 12.68 ±0.00 +0.6% —
nii_resample_from_to 12.79 ±0.00 12.87 ±0.00 +0.6% 0.000
poi_map_labels 3.08 ±0.00 3.09 ±0.00 +0.4% —
poi_load 3.11 ±0.00 3.12 ±0.00 +0.4% —
… 30 more measurements
Measurement baseline MiB (median ±½·range) head MiB (median ±½·range) Δ % p
nii_pad_to 12.23 ±0.00 12.20 ±0.00 -0.3% —
poi_calc_centroids_nocrop 12.55 ±0.00 12.51 ±0.00 -0.3% —
nii_compute_crop 4.58 ±0.00 4.59 ±0.00 +0.3% —
nii_center_of_masses 4.89 ±0.00 4.90 ±0.00 +0.2% —
nii_load_img 5.12 ±0.00 5.14 ±0.00 +0.2% —
nii_unique 5.45 ±0.00 5.46 ±0.00 +0.2% 0.003
nii_volumes 5.95 ±0.00 5.96 ±0.00 +0.2% —
poi_reorient 8.07 ±0.00 8.09 ±0.00 +0.2% —
poi_resample_from_to 12.17 ±0.00 12.15 ±0.00 -0.2% 0.000
nii_extract_label 12.18 ±0.00 12.15 ±0.00 -0.2% —
nii_set_dtype 12.24 ±0.00 12.21 ±0.00 -0.2% —
nii_reorient 12.30 ±0.00 12.27 ±0.00 -0.2% 0.000
nii_map_labels 12.36 ±0.00 12.34 ±0.00 -0.2% —
nii_dilate_msk 12.36 ±0.00 12.34 ±0.00 -0.2% —
nii_erode_msk 12.44 ±0.00 12.42 ±0.00 -0.2% 0.000
nii_apply_crop 12.47 ±0.00 12.45 ±0.00 -0.2% 0.000
nii_load_seg 12.58 ±0.00 12.55 ±0.00 -0.2% 0.000
poi_calc_centroids 12.68 ±0.00 12.65 ±0.00 -0.2% —
nii_fill_holes 12.78 ±0.00 12.80 ±0.00 +0.2% 0.000
nii_get_connected_components 13.99 ±0.00 13.96 ±0.00 -0.2% —
nii_filter_connected_components 14.18 ±0.00 14.15 ±0.00 -0.2% —
nii_save 7.12 ±0.00 7.14 ±0.00 +0.2% —
poi_local_to_global_arr 7.45 ±0.00 7.46 ±0.00 +0.2% 0.003
poi_to_global 7.51 ±0.00 7.52 ±0.00 +0.2% 0.001
poi_rescale 5.29 ±0.00 5.30 ±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 2.12 ±0.00 2.13 ±0.00 +0.6% (noise) —
nii_get_array 2.95 ±0.00 2.96 ±0.00 +0.4% (noise) 0.003

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.

robert-graf and others added 3 commits November 18, 2026 18:02
…StepSequence in the name-conflict test

On a real Philips XA export, 28 series stored twice were still written twice (pixel
data byte-identical, only these two tags and SOPInstanceUID differed). The embedded icon
thumbnail and the performed-procedure-step reference differ per stored object like
SOPInstanceUID and ReferencedImageSequence do.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ic-export

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
SimpleITK 2.5.7 and 2.5.8 publish no cp39 wheels. The repo has no lockfile, so the 3.9
CI leg resolves fresh and picked 2.5.8, which makes `poetry install --with dev` fail with
"Unable to find installation candidates for simpleitk (2.5.8)". 2.5.6 is the last release
with cp39 wheels. >=3.10 is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@robert-graf

Copy link
Copy Markdown
Collaborator Author

This contains a merge with #160. Do this first.

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