autods_pet.roi.brain#
Brain reference ROI: cortical gray matter extraction and PET statistics.
- class autods_pet.roi.brain.BrainROI(brain_label=90, grey_matter_only=True, cortical_thickness_mm=5.0, stats=None)[source]#
Bases:
objectBrain reference ROI extraction and refinement.
When
grey_matter_onlyis True (default), the brain mask is refined to isolate cortical gray matter using a shell extraction: the mask is eroded bycortical_thickness_mmto obtain the white-matter core, then subtracted from the original to yield the cortical shell.- Parameters:
brain_label (
int(default:90)) – TotalSegmentator label for brain (default 90).grey_matter_only (
bool(default:True)) – If True, extract cortical gray matter shell. If False, use the full brain mask.cortical_thickness_mm (
float(default:5.0)) – Erosion radius used for the shell extraction (only whengrey_matter_onlyis True).stats (
list[str] |None(default:None)) – Statistics to compute (e.g.["median"]). Defaults to["median"].
- refine(whole_seg)[source]#
Refine TotalSegmentator brain label.
If
grey_matter_onlyis True, produces a cortical shell mask (original minus eroded). Otherwise returns the cleaned brain mask.
- 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, orNoneif the brain label is absent from the segmentation.- Return type:
- Raises:
ValueError – If whole_seg and pet have mismatched geometry.