feat: add adaptive sampling, motion registration, MEDL, and e2e ADS configs - #316
Open
georgeyiasemis wants to merge 105 commits into
Open
feat: add adaptive sampling, motion registration, MEDL, and e2e ADS configs#316georgeyiasemis wants to merge 105 commits into
georgeyiasemis wants to merge 105 commits into
Conversation
Retain only configs matching validated paper checkpoints (12 ADS+recon, 14 ADS+recon+reg), add MEDL paper YAMLs, drop ablations/extras, and rename projects/e2e_ads_reg to e2e_ads_recon_reg. Ignore local weight artifacts under experiment subdirs. Co-authored-by: Cursor <cursoragent@cursor.com>
Document paper references, released configs, training/inference usage, and include method diagrams from the MIDL 2026 and arXiv:2411.18249 papers. Co-authored-by: Cursor <cursoragent@cursor.com>
Use the full paper titles as headings, drop the CPU/MPS aside, and tighten method/config/training sections. Co-authored-by: Cursor <cursoragent@cursor.com>
Use single-line overline titles and list-tables so docutils/GitHub render without malformed-table and underline errors. Co-authored-by: Cursor <cursoragent@cursor.com>
Use frame (MIDL ADS-Recon) and phase (arXiv recon+reg) in YAML stems and READMEs for paper unified vs frame-/phase-specific sampling, instead of the ambiguous dyn label. Co-authored-by: Cursor <cursoragent@cursor.com>
Those local prediction dumps are not part of the paper configs. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep weight/artifact ignore rules local-only; do not ship them on GitHub. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the previous masking behavior; float adaptive DC fill remains handled in the engines via 1 - sampling_mask.float(). Co-authored-by: Cursor <cursoragent@cursor.com>
Drop CWNorm/CWNConv* and sampler_cwn_conv wiring; adaptive samplers always use plain Conv2d/Conv3d. Co-authored-by: Cursor <cursoragent@cursor.com>
MaskFuncMode.DYNAMIC needs shape (T, H, W, complex). Keep spatial-only shapes only for the per-frame dynamic_mask init path. Co-authored-by: Cursor <cursoragent@cursor.com>
Add logging.log_interval (default 20) so short smokes can set it to 1 instead of waiting for the hard-coded 20-iteration log cadence. Co-authored-by: Cursor <cursoragent@cursor.com>
Bring in packaging/CI updates (direct-recon rename, meson wheels) so this branch merges cleanly back to main. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep full train/val configs with all accelerations, and ship one *_inference.yaml per experiment (active val-4x; other rates commented) plus a minimizer to regenerate them. Co-authored-by: Cursor <cursoragent@cursor.com>
Allow YAMLs without training/validation blocks, fix UNet AdaIN/norm kwargs and enum typing, and ignore local HF staging. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep branch features while adopting main ruff 0.16 cleanup. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #316 +/- ##
==========================================
- Coverage 84.71% 83.81% -0.91%
==========================================
Files 110 129 +19
Lines 10122 12350 +2228
==========================================
+ Hits 8575 10351 +1776
- Misses 1547 1999 +452 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Fix early return in normalize_masked_probabilities and clear Codacy kwargs/pylint noise so Codecov can recover the project threshold. Co-authored-by: Cursor <cursoragent@cursor.com>
Stop tracking the helper script and ignore it so it stays on disk without shipping in the branch. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the helper untracked locally without an ignore rule. Co-authored-by: Cursor <cursoragent@cursor.com>
Null engine_name is the default and only cluttered the configs. Co-authored-by: Cursor <cursoragent@cursor.com>
Log blue/red TensorBoard overlays (ACS/init vs newly acquired) and write full mask history to inference H5s. Co-authored-by: Cursor <cursoragent@cursor.com>
Emit logo/direct_logo_ascii.txt to stdout and log files before the clinical-use warning. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR brings end-to-end adaptive dynamic sampling (ADS) and optional motion registration into DIRECT, together with the paper experiment layouts for the MIDL 2026 e2e ADS works.
It wires learned sampling policies and registration models through the MRI training/inference stack, ships validated train + inference YAML pairs under
projects/e2e_ads_reconandprojects/e2e_ads_recon_reg, and hardens config/checkpoint loading so those projects (and Hub-style inference YAMLs) run cleanly on currentmain(including ruff 0.16).What's new
direct/nn/adaptive/): policies for 1D/2D and static/dynamic masks, rejection-sampling as a typed training path (RejectionSamplingError), and budgeting that works with static ACS on dynamic volumes.direct/registration/,direct/nn/registration/): VoxelMorph-style learned registration plus classical utilities (demons, optical flow, elastic deformation); joint or decoupled recon↔registration training.source_key/target_key) and displacement-field visualization for registration runs.projects/e2e_ads_recon— adaptive sampling + reconstruction (vSHARP / MEDL variants, frame/init2 configs).projects/e2e_ads_recon_reg— same family with registration (vSHARP / VarNet / LOUPE / fixed-mask variants, phase/frame and disjoint options).*_inference.yaml): one inference file per model with active val-4× masking and commented 6×/8× alternatives (no per-rate file explosion).What's changed
MRIModelEngine) call into adaptive sampling / registration when configured; writers can persist registration volumes and displacement fields.training/validationare optional so inference-only YAMLs are valid;logging.log_intervalcontrols TensorBoard/scalar flush cadence.RuntimeErroron missing keys; ModConvconv_out_bias/ AdaIN kwargs wiring aligned so paper weights load under current UNet construction.filter_arguments_by_signaturekeeps**kwargs-based model builders working when configs carry extraimage_*fields.mainruff cleanup without dropping the above behavior.User impact
training/validationblocks; use*_inference.yaml(or the minimizer) instead of maintaining many rate-specific files.registration_simulate_referencein transforms); without that, predict fails with a missingreference_imagekey.