| name | sliding-window-inference-runner |
| description | Prototype scaffold for sliding-window volume inference interfaces. This skill
demonstrates window generation, batching, aggregation, and reporting, but it
does not provide production-ready checkpoint-to-model loading.
|
| version | 1.0.0 |
| author | Medical AI Skills Team |
| license | MIT |
| tags | ["inference","segmentation","sliding-window","scaffold","pytorch"] |
| maturity | scaffold |
| category | segmentation-ml |
| requires_extras | ["core","ml"] |
Sliding Window Inference Runner
Overview
This skill is a scaffold for experimenting with sliding-window inference interfaces on volumetric data. It is useful for testing data tiling, Gaussian weighting, aggregation, and CLI/report plumbing.
It is not a production-ready checkpoint-driven inference engine. External users should not treat its outputs as real model predictions.
Installation
pip install .[ml]
Dependencies:
- Python >= 3.10
- torch
- nibabel or SimpleITK for image I/O
Usage
python scripts/main.py --input IMAGE_PATH --model MODEL_PATH --output OUTPUT_PATH [OPTIONS]
Arguments
| Argument | Required | Description |
|---|
--input | Yes | Input image path |
--model | Yes | Placeholder checkpoint path used to infer scaffold metadata |
--output | Yes | Output segmentation path |
Options
| Option | Default | Description |
|---|
--window-size | 96 | Sliding window size |
--overlap | 0.25 | Window overlap ratio |
--batch-size | 1 | Batch size |
--device | cpu | Device to run the scaffold on |
--report | auto | Optional JSON report path |
--version | - | Show version and exit |
--help | - | Show help and exit |
Input Schema
Input is a 2D or 3D image plus a checkpoint-like file path. The current implementation does not reconstruct the original model architecture from the checkpoint.
Output Schema
{
"success": true,
"result": {
"output_path": "segmentation.nii.gz",
"report_path": "segmentation.json",
"maturity": "scaffold",
"warning": "Output was produced by a scaffold pipeline, not real checkpoint-driven inference."
},
"metadata": {
"timestamp": "2024-01-15T10:30:00Z",
"duration_ms": 500,
"version": "1.0.0"
}
}
Exit Codes
| Code | Meaning |
|---|
| 0 | Success |
| 1 | Validation error |
| 2 | Runtime error |
| 3 | Usage error |
Examples
python scripts/main.py --input image.npy --model dummy_model.pth --output scaffold_mask.npy
python scripts/main.py --input image.nii.gz --model dummy_model.pth --output scaffold_mask.nii.gz --report scaffold_report.json
References
Disclaimer
For research use only. This skill is scaffold-only and does not provide production-ready medical model inference.