Skip to content
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

Fix casting of location dtype in GridPatch #4635

Merged
merged 8 commits into from
Jul 6, 2022

Conversation

vale-salvatelli
Copy link
Contributor

@vale-salvatelli vale-salvatelli commented Jul 5, 2022

Fixes #4596

Locations dtype in GridPatch was erroneously always inferred from the image dtype. This led to wrong locations values when the image was casted to small integers (eg. pixels values span 0 -255, locations values can span 0 -5000). This behavior is now fixed, locations will always be casted to be regular int

deepsource-autofix bot and others added 3 commits July 5, 2022 14:22
* Move dictionary inserts to its definition

* [MONAI] code formatting

Signed-off-by: monai-bot <monai.miccai2019@gmail.com>

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: monai-bot <monai.miccai2019@gmail.com>
Signed-off-by: vale-salvatelli <vsalvatelli@microsoft.com>
Signed-off-by: vale-salvatelli <vsalvatelli@microsoft.com>
Signed-off-by: vale-salvatelli <vsalvatelli@microsoft.com>
vale-salvatelli and others added 2 commits July 5, 2022 15:29
Signed-off-by: vale-salvatelli <vsalvatelli@microsoft.com>
Signed-off-by: vale-salvatelli <vsalvatelli@microsoft.com>
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

Thanks, it looks good to me.

@wyli
Copy link
Contributor

wyli commented Jul 6, 2022

/black

monai-bot and others added 2 commits July 6, 2022 17:13
Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
@wyli wyli enabled auto-merge (squash) July 6, 2022 17:21
@wyli
Copy link
Contributor

wyli commented Jul 6, 2022

/build

1 similar comment
@wyli
Copy link
Contributor

wyli commented Jul 6, 2022

/build

@wyli wyli merged commit 4ddd2bc into Project-MONAI:dev Jul 6, 2022
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.

Wrong type casting in GridPatch produces wrong locations for patches
3 participants