Skip to content

Fix intensity scaling range in MAISI VAE transform - #2084

Merged
Can-Zhao merged 1 commit into
Project-MONAI:mainfrom
Don-Yin:fix-maisi-vae-scale-range
Oct 20, 2026
Merged

Can-Zhao merged 1 commit into
Project-MONAI:mainfrom
Don-Yin:fix-maisi-vae-scale-range

Conversation

@Don-Yin

@Don-Yin Don-Yin commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

RandScaleIntensity multiplies by 1 + factor, so factors=(0.9, 1.1) in define_vae_transform scales images by 1.9-2.1x. I think (-0.1, 0.1) (0.9-1.1x) was the intent, which is also how the transform is used elsewhere in the tutorials, but please correct me if I've misread it.

I ran the transform on a public CT and MRI scan to check. With the current value, fat in CT lands roughly where bone normally sits, and soft tissue goes above 1.

Same CT and MRI slice with no scaling, x1.06 and x2.06

CT tissue values (grey: none, blue: proposed, red: current) and share of 64^3 patches with p99 above 1.2

As far as I can tell this doesn't break anything, since the VAE reconstructs the same scaled patch, and the released weights and reported results shouldn't be affected. It may cost a little reconstruction quality, but I haven't measured that. If the 2x range is intentional, I'm happy to turn this into a comment instead. I've also raised it in NVIDIA-Medtech/NV-Generate-CTMR#53.

Checks

  • Avoid including large-size files in the PR.
  • For security purposes, please check the contents and remove any sensitive info such as user names and private key.

RandScaleIntensityd scales by (1 + factor), so factors=(0.9, 1.1)
multiplied images by 1.9-2.1. Use (-0.1, 0.1) for a 0.9-1.1x range.

Signed-off-by: Don Yin <Don_Yin@outlook.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9a31b95b-1670-4efd-a6d1-9b5cfc9c8e59
📥 Commits

Reviewing files that changed from the base of the PR and between f7ca45c and 9763617.

📒 Files selected for processing: 1
  • generation/maisi/scripts/transforms.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

Training-time RandScaleIntensityd augmentation now uses factors from (-0.1, 0.1) instead of (0.9, 1.1). Other transform behavior is unchanged.

Changes

Intensity scaling augmentation

Layer / File(s) Summary
Update training intensity scaling
generation/maisi/scripts/transforms.py
RandScaleIntensityd now uses factors from (-0.1, 0.1) during training. Other transform behavior is unchanged.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: can-zhao

Merge Risk: ⚪ Minimal · up to 97636

No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: correcting the intensity scaling range in the MAISI VAE transform.
Description check Passed The description explains the issue, proposed fix, observed impact, validation, and relevant checks. It omits the template's issue reference, but the required technical content is present.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Can-Zhao

Copy link
Copy Markdown
Contributor

Thank you! This is very helpful!

@Can-Zhao
Can-Zhao merged commit d7c326e into Project-MONAI:main Oct 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants