MotionScoreHRpQCT core CLI for dataset-first HR-pQCT motion grading
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file motionscorehrpqct-2.5.5.tar.gz.
File metadata
- Download URL: motionscorehrpqct-2.5.5.tar.gz
- Upload date:
- Size: 71.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67d243831bfa687b000ee758a62296dffdd45c515d00b23de1e1cea14608151b
|
|
| MD5 |
161b5eb4685c69c19b888e108700cdb8
|
|
| BLAKE2b-256 |
7cb8932d98029ca374fa181dd9810c6d969216baeb73cfcad6871e02a27bebbf
|
Provenance
The following attestation bundles were made for motionscorehrpqct-2.5.5.tar.gz:
Publisher:
publish-pypi.yml on wallematthias/MotionScoreHRpQCT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
motionscorehrpqct-2.5.5.tar.gz -
Subject digest:
67d243831bfa687b000ee758a62296dffdd45c515d00b23de1e1cea14608151b - Sigstore transparency entry: 1607906344
- Sigstore integration time:
-
Permalink:
wallematthias/MotionScoreHRpQCT@0eb6173aed16d623d73d03d70860483ec91ff25e -
Branch / Tag:
refs/tags/v2.5.5 - Owner: https://github.com/wallematthias
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0eb6173aed16d623d73d03d70860483ec91ff25e -
Trigger Event:
push
-
Statement type:
File details
Details for the file motionscorehrpqct-2.5.5-py3-none-any.whl.
File metadata
- Download URL: motionscorehrpqct-2.5.5-py3-none-any.whl
- Upload date:
- Size: 58.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1946c8cfde8928cc955c8bedca625cdf387e5ef6a35998e68fb152f70fb3eb16
|
|
| MD5 |
73762c48d3bf418b69e5125f0ee13899
|
|
| BLAKE2b-256 |
0f3f53db6bb29217b65d6323db69df0c521c5958b74cc7557841d445190c15e1
|
Provenance
The following attestation bundles were made for motionscorehrpqct-2.5.5-py3-none-any.whl:
Publisher:
publish-pypi.yml on wallematthias/MotionScoreHRpQCT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
motionscorehrpqct-2.5.5-py3-none-any.whl -
Subject digest:
1946c8cfde8928cc955c8bedca625cdf387e5ef6a35998e68fb152f70fb3eb16 - Sigstore transparency entry: 1607906515
- Sigstore integration time:
-
Permalink:
wallematthias/MotionScoreHRpQCT@0eb6173aed16d623d73d03d70860483ec91ff25e -
Branch / Tag:
refs/tags/v2.5.5 - Owner: https://github.com/wallematthias
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0eb6173aed16d623d73d03d70860483ec91ff25e -
Trigger Event:
push
-
Statement type: