Skip to main content

voidspace

Spacing-aware voidspace analysis for HR-pQCT segmentations.

voidspace is a standalone logic package. It does not segment bone, register scans, create common regions, or resample images. It expects inputs that are already in the image space to analyze.

The command line interface reads common SimpleITK image formats and Scanco AIM masks. AIM masks are read in native scaling, interpreted as foreground where nonzero, and written back as native binary AIM masks using the input geometry.

Workflows

  • Cross-sectional: pass a segmented bone image.
  • Masked/common-region: pass a segmented bone image and a mask. If both a periosteal contour and a common region are needed, combine them before calling voidspace.
  • Registered: pass an already registered segmentation and optional registered mask.
  • Dynamic change: pass already aligned baseline and follow-up voidspace masks.

When no periosteal mask is supplied, the segmentation-only workflow estimates the analysis domain from the closed segmentation by excluding background connected to the image border. Supplying an explicit mask remains preferred when that contour is available.

Algorithm

The algorithm follows the original IPL voidspace concept:

  1. Remove tiny disconnected bone components.
  2. Close segmented bone to fill normal trabecular spacing.
  3. Invert the closed bone region to candidate marrow void.
  4. Erode candidate void away from trabecular surfaces.
  5. Remove tiny candidate void components.
  6. Keep all surviving voids and large voids above a physical volume threshold.

Unlike the IPL scripts, morphology uses a spacing-aware spherical or ellipsoidal footprint. The default XtremeCT II settings are:

  • closing radius: 0.738 mm
  • boundary erosion radius: 0.366 mm
  • minimum large-void volume: 16.5 mm3
  • bone and void speckle cleanup: 6 voxels

The original IPL code used 72560 or 72660 voxels as scanner-specific large void thresholds in different script/paper contexts. This package treats 16.5 mm3 as the default source of truth and converts it from the supplied image spacing.

CLI

voidspace run-case \
  --segmentation seg.AIM \
  --mask analysis_domain.AIM \
  --output-dir voidspace-out
voidspace compare \
  --baseline-void baseline_voidspace_large_mask.AIM \
  --followup-void followup_voidspace_large_mask.AIM \
  --mask analysis_domain.AIM \
  --output-dir voidspace-change

--mask is optional for both commands. Use --force to overwrite existing outputs.

Python

from voidspace import VoidspaceParameters, run_case

result = run_case(
    segmentation_path="seg.AIM",
    mask_path="analysis_domain.AIM",
    output_dir="voidspace-out",
    parameters=VoidspaceParameters.xtremectii_defaults(),
)
print(result.metrics.volume_mm3)
from voidspace import compare

result = compare(
    baseline_void_path="baseline_voidspace_large_mask.AIM",
    followup_void_path="followup_voidspace_large_mask.AIM",
    mask_path="analysis_domain.AIM",
    output_dir="voidspace-change",
)
print(result.metrics.net_change_volume_mm3)

Citation

For cross-sectional voidspace analysis, cite:

Whittier DE, Burt LA, Boyd SK. A new approach for quantifying localized bone loss by measuring void spaces. Bone. 2021 Feb;143:115785. doi: 10.1016/j.bone.2020.115785. Epub 2020 Dec 2. PMID: 33278655.

For dynamic voidspace analysis, cite:

Whittier DE, Walle M, Atkins PR, Collins CJ, Zumstein MA, Christen P, Lippuner K, Müller R. Structural alterations during fracture healing lead to void spaces developing in surrounding bone microarchitecture. Journal of Bone and Mineral Research. 2025 Jun;40(6):791-798. doi: 10.1093/jbmr/zjaf046.

Metadata

Release files for voidspace 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for voidspace 0.1.0
File Size Uploaded
voidspace-0.1.0.tar.gz 15.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for voidspace 0.1.0
File Interpreter ABI Platform
voidspace-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / voidspace-0.1.0.tar.gz

Download URL voidspace-0.1.0.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9df2c7121c58f4e5c82f3bbff236d23a8ad59612938a7d40575d26459e2db7f0
BLAKE2b-256 checksum
How to use checksums
6523088f47f3a66eb5a3809d4a686d818d25be9aefbd627f0ff160d03ad86cf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / voidspace-0.1.0-py3-none-any.whl

Download URL voidspace-0.1.0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a64b716767af18392031bbe272e9d958d1e1a528e3430bcbc66f0dd460eb0b8
BLAKE2b-256 checksum
How to use checksums
95f74a65db637a741b2b16b1b13dc52eb95d04ad92ecf788f45626d0fa5838c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page