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:
objectLong 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_maskandshrinkagepopulated. Theshrinkagedict includes aper_bonesub-dict with per-bone volume details.- Return type:
- 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, andstatspopulated.- Return type:
- Raises:
ValueError – If whole_seg and pet have mismatched geometry.