Skip to content

Fix(2d_segmentation): Restore the predicted value of seg image to the range of 0~225 before saving it #1951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

Reqwey
Copy link
Contributor

@Reqwey Reqwey commented Mar 9, 2025

Description

To fix the problem that evaluation output images are all black because post_trans scale their pixel values to 0~1.

Checks

  • Avoid including large-size files in the PR.
  • Clean up long text outputs from code cells in the notebook.
  • For security purposes, please check the contents and remove any sensitive info such as user names and private key.
  • Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the ./figure folder
  • Notebook runs automatically ./runner.sh -t <path to .ipynb file>

@ericspod ericspod requested review from Nic-Ma and KumoLiu March 13, 2025 12:47
@ericspod
Copy link
Member

Thanks for the contribution @Reqwey! You can actually set a scaling factor for SaveImage with the scale parameter. Setting scale to 255 should do the same as what you have here, so I'd suggest modifying your PR to do that. This is a bug in the tutorial either way so thanks for spotting it. Please also look at the instructions for resolving the DCO with a remedial commit.

@ericspod ericspod self-requested a review March 13, 2025 12:51
… range of 0~225 before saving it

Signed-off-by: Rekawiia Lin <[email protected]>
@Reqwey
Copy link
Contributor Author

Reqwey commented Mar 13, 2025

Thanks for the contribution @Reqwey! You can actually set a scaling factor for SaveImage with the scale parameter. Setting scale to 255 should do the same as what you have here, so I'd suggest modifying your PR to do that. This is a bug in the tutorial either way so thanks for spotting it. Please also look at the instructions for resolving the DCO with a remedial commit.

Thanks for your guidance! Done:

  • SaveImage(scale=255) (PR updated)
  • DCO remedial commit

It's my pleasure to be able to make contributions to this extraordinary project!

Copy link
Contributor

@KumoLiu KumoLiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, LGTM.

@KumoLiu KumoLiu enabled auto-merge (squash) March 19, 2025 06:52
@KumoLiu KumoLiu merged commit 77015e8 into Project-MONAI:main Mar 19, 2025
6 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.

3 participants