autods_pet.roi.long_bones#

Long bones: diaphysis mask refinement and PET statistics.

class autods_pet.roi.long_bones.LongBonesROI(bones=None, diaphysis_keep_pct=60, stats=None)[source]#

Bases: object

Long bones diaphysis ROI extraction and refinement.

Parameters:
  • bones (list[tuple[str, int, float]] | None (default: None)) – (name, label, erosion_mm) tuples. Defaults to both femurs (5 mm) and both humeri (4 mm).

  • diaphysis_keep_pct (int (default: 60)) – Central percentage of each bone’s axial extent to keep.

  • stats (list[str] | None (default: None)) – Statistics to compute. Defaults to ["p95"].

refine(whole_seg)[source]#

Refine TotalSegmentator bone labels into diaphyseal marrow masks.

Pipeline per bone: extract label -> crop to central diaphysis -> erode cortex. The four masks are combined via logical union.

Parameters:

whole_seg (Image) – TotalSegmentator multilabel segmentation.

Returns:

Result with refined_mask and shrinkage populated. The shrinkage dict includes a per_bone sub-dict with per-bone volume details.

Return type:

ROIResult

extract(whole_seg, pet)[source]#

Refine mask and compute PET statistics in one call.

Parameters:
  • whole_seg (Image) – TotalSegmentator multilabel segmentation.

  • pet (Image) – PET SUV image (must share geometry with whole_seg).

Returns:

Result with refined_mask, shrinkage, and stats populated.

Return type:

ROIResult

Raises:

ValueError – If whole_seg and pet have mismatched geometry.