How loli/medpy works
MedPy is a Python library and command-line toolkit for high-dimensional medical-image processing. A typical user loads an image and its spatial metadata, applies image or label operations, then evaluates results or saves them; the scripts also expose focused workflows such as binary resampling. The package additionally provides feature extraction, patch iteration, graph-cut segmentation, and image-similarity metrics. The README establishes the broad product scope, while the sampled source supports only a few specific implementation links, so uncertain cross-module wiring is omitted.
Main entry points: medpy_binary_resampling.py Binary resampling command · load.py Image loading · header.py Spatial metadata · image.py Image filters
Components 18
Image I/O
- Image loading
medpy/io/load.py - Spatial metadata
medpy/io/header.py - Image saving
medpy/io/save.py
Image Processing
- Image filters
medpy/filter/image.py - Binary filters
medpy/filter/binary.py - Label filters
medpy/filter/label.py - Smoothing and noise
medpy/filter/smoothing.py - Intensity standardization
medpy/filter/IntensityRangeStandardization.py
Analysis and Features
- Image features
medpy/features - Patch iteration
medpy/iterators/patchwise.py - Neighbour graphs
medpy/neighbours/knn.py - Image metrics
medpy/metric
Graph-Cut Segmentation
- Graph generation
medpy/graphcut/generate.py - Energy terms
medpy/graphcut/energy_voxel.py - Graph solver
medpy/graphcut/graph.py - Segmentation output
medpy/graphcut/write.py
Command-Line Tools
- Binary resampling command
bin/medpy_binary_resampling.py
Other components
- Python / CLI user
Connections 14
- Python / CLI user → Image loading: loads image
- Python / CLI user → Image filters: processes image
- Python / CLI user → Binary filters: processes mask
- Python / CLI user → Label filters: processes labels
- Python / CLI user → Smoothing and noise: smooths image
- Python / CLI user → Intensity standardization: standardizes intensities
- Python / CLI user → Image features: extracts features
- Python / CLI user → Patch iteration: iterates patches
- Python / CLI user → Neighbour graphs: builds neighbours
- Python / CLI user → Image metrics: evaluates results
- Python / CLI user → Graph generation: constructs segmentation graph
- Python / CLI user → Binary resampling command: runs command
- Binary resampling command → Image loading: loads input
- Binary resampling command → Spatial metadata: updates spacing