Fix NLST keypoint warping coordinates - #2073
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe notebook updates keypoint coordinate normalization to use corner-aligned spatial extents and enables ChangesKeypoint warping
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The notebook change aligns keypoint coordinates with displacement sampling without leaving an identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: mei <hmeixx@gmail.com>
2733afb to
a815ea2
Compare
|
HI @hmeixx thanks for this fix, it looks good to me. |
Fixes #2021
Description
This PR fixes the keypoint coordinate normalization used when sampling the displacement field in
learn2reg_nlst_paired_lung_ct.ipynb.Previously, keypoint voxel coordinates were normalized using the image dimension:
This corresponds to
2 * x / dim - 1, which does not map voxel indices[0, dim - 1]to[-1, 1].The normalization is updated to use
(dim - 1) / 2, corresponding to:align_corners=Trueis also explicitly specified inF.grid_sampleso that the sampling convention is consistent with this normalization and with MONAIWarp.A small local
grid_samplecheck confirmed that the updated normalization maps voxel centers correctly.Checks
./figurefolder./runner.sh -t <path to .ipynb file>Local PEP 8/format checks passed with runner.sh. Notebook execution was skipped by the existing runner skip pattern.
Summary by CodeRabbit