MotionScoreHRpQCT
Motion scoring for HR-pQCT scans using deep convolutional neural networks.
This refactor provides a dataset-first pipeline with BIDS-style derivatives and review-state persistence for direct Slicer integration.
Related repositories:
- Core pipeline (this repo): https://github.com/wallematthias/MotionScoreHRpQCT
- Slicer extension: https://github.com/wallematthias/SlicerMotionScoreHRpQCT
What Changed In v2
- Legacy CLI commands
gradeandconfirmare removed. - New dataset-driven commands:
discover,predict,review-init,review-apply,explain,export. - Default output structure is now:
<dataset_root>/derivatives/MotionScore/
index.tsv
dataset_description.json
<mirrored-source-path-or-flat-aim-name>/
predictions/predictions.tsv
preview/<scan_id>_preview.png
preview/<scan_id>_slice_profile.png
review/review.tsv
review/review.json
review/review_audit.tsv
explain/<scan_id>_gradcam.mha
- AIM reading now uses
aimio-py. - Python baseline is now
>=3.10. - Output path mapping:
- Flat input (
*.AIMdirectly in dataset root): outputs are grouped under folder named after each AIM file stem. - Structured input (nested folders): outputs mirror the source folder structure under
MotionScore.
- Flat input (
- Raw-vs-mask identification:
- Primary: AIM header processing log (ISQ-origin markers indicate raw images).
- Fallback: filename-based heuristics when header signal is unavailable.
Installation
conda create -n motionscore python=3.10 -y
conda activate motionscore
# Clone
# git clone <repo-url>
# cd MotionScoreHRpQCT
# Install CLI + torch inference backend
pip install -e ".[torch]"
Models
Use a model registry rooted at --model-root (default ~/.motionscore/MotionScore/models).
Each registered profile points to a directory containing torch checkpoints:
DNN_0.pt,DNN_1.pt, ... (ensemble members)model_registry.jsonat the model root
Model weights are distributed as public GitHub release assets. The download command reads the public model catalog, downloads the selected bundle, verifies the checksum when present, and registers the extracted checkpoints locally.
motionscore model-download --model-id base-v1
motionscore model-list
By default model bundles are resolved from the public model catalog attached to the latest GitHub release, and GitHub release asset download counts are the central usage metric.
CLI Usage
For most users, day-to-day grading and review should be done in the Slicer app. In this core CLI, the two most useful workflows are batch prediction and retraining.
1) Predict a folder of scans
motionscore predict /path/to/dataset --model-id base-v1
Default output root:
/path/to/dataset/derivatives/MotionScore
Review confidence policy is configured separately with motionscore review-init --confidence-threshold ....
2) Retrain from reviewed data
motionscore train-prepare /path/to/dataset/derivatives/MotionScore \
--output /path/to/dataset/derivatives/MotionScore/training/train_manifest.tsv \
--slice-count 8 \
--seed 13 \
--cv-folds 10 \
--min-auto-confidence 0.70 \
--include-auto-without-manual
motionscore train \
--manifest /path/to/dataset/derivatives/MotionScore/training/train_manifest.tsv \
--model-root ~/.motionscore/MotionScore/models \
--init-model-id base-v1 \
--early-stopping-patience 10 \
--seed 13 \
--output-model-dir ~/.motionscore/MotionScore/models/knee-v1
Training writes:
training_metrics.jsontraining_plot_live.png(updated every epoch)training_plot.png(final summary plot)training_plot_model_<n>.png(per-ensemble-model curves)
CLI Reference
For all advanced/headless commands (discover, review-*, export, explain, model-*), see:
Use With 3D Slicer
For day-to-day grading and retraining, use the Slicer app:
This repository provides the core CLI/pipeline used by that extension.
Citation
If you use this software, please cite:
Walle, M., Eggemann, D., Atkins, P.R., Kendall, J.J., Stock, K., Müller, R. and Collins, C.J., 2023. Motion grading of high-resolution quantitative computed tomography supported by deep convolutional neural networks. Bone, 166, p.116607. https://doi.org/10.1016/j.bone.2022.116607
Metadata
Release files for motionscorehrpqct 2.5.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| motionscorehrpqct-2.5.10.tar.gz | 73.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| motionscorehrpqct-2.5.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 132.7 kB
Release files / motionscorehrpqct-2.5.10.tar.gz
| Download URL | motionscorehrpqct-2.5.10.tar.gz |
|---|---|
| Size | 73.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea32c7d7338a9fd6aebb7669b2e2949a826a81054586e54d5bae956fd6fca3d0
|
|
BLAKE2b-256 checksum How to use checksums |
e907448a52da18960c6a5baecd8da0dd5456c80450631229bfc23618428fda2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.
Transparency logRelease files / motionscorehrpqct-2.5.10-py3-none-any.whl
| Download URL | motionscorehrpqct-2.5.10-py3-none-any.whl |
|---|---|
| Size | 59.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b3432bef90d3fa8c851bbcdefb8a160abbe9221f6a4d517c1a31d51416bdb39
|
|
BLAKE2b-256 checksum How to use checksums |
e2839ee56f8d105dba3c9488d449571b5d5a9d0a98e8478116586c2b97d5cbe4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.
Transparency log