How mohammedsunoqrot/pyautoref works
pyAutoRef is a research-use Python package for dual-reference fat-and-muscle normalization of prostate T2-weighted MRI. A caller supplies a SimpleITK image or supported image path; the exported autoref function preprocesses the image, detects and refines reference-tissue regions (with a fallback when detection fails), normalizes intensities, and optionally saves the result. The graph follows the sampled orchestrator and modules; utility functions are grouped by responsibility because utils.py is only partially excerpted.
Main entry points: autoref.py AutoRef pipeline · __init__.py Public API · pre_processing.py Image preprocessing · object_detection.py YOLO detection
Components 13
Package entry
- Public API
src/pyAutoRef/__init__.py - AutoRef pipeline
src/pyAutoRef/autoref.py
Image preparation
- Image preprocessing
src/pyAutoRef/pre_processing.py - Image and DICOM I/O
src/pyAutoRef/utils.py
Detection and refinement
- YOLO detection
src/pyAutoRef/object_detection.py - YOLO ONNX model
src/pyAutoRef/model.onnx - Inference helpers
src/pyAutoRef/utils.py - Detection refinement
src/pyAutoRef/post_processing.py - Mask and intensity helpers
src/pyAutoRef/utils.py - No-detection fallback
src/pyAutoRef/utils.py
Normalization and output
- Intensity normalization
src/pyAutoRef/normalization.py - Output image writer
src/pyAutoRef/utils.py
Other components
- Image caller
Connections 13
- Image caller → Public API: calls
README.md - Public API → AutoRef pipeline: exports
src/pyAutoRef/__init__.py - AutoRef pipeline → Image preprocessing: preprocesses
src/pyAutoRef/autoref.py - Image preprocessing → Image and DICOM I/O: reads and prepares
src/pyAutoRef/pre_processing.py - AutoRef pipeline → YOLO detection: detects objects
src/pyAutoRef/autoref.py - AutoRef pipeline → YOLO ONNX model: locates model
src/pyAutoRef/autoref.py - YOLO detection → Inference helpers: runs inference
src/pyAutoRef/object_detection.py - AutoRef pipeline → Detection refinement: refines predictions
src/pyAutoRef/autoref.py - Detection refinement → Mask and intensity helpers: extracts masks
src/pyAutoRef/post_processing.py - AutoRef pipeline → No-detection fallback: gets fallback intensities
src/pyAutoRef/autoref.py - AutoRef pipeline → Intensity normalization: normalizes image
src/pyAutoRef/autoref.py - AutoRef pipeline → Output image writer: optionally saves
src/pyAutoRef/autoref.py - AutoRef pipeline → Image caller: returns image
README.md