Skip to content

Fix casting of location dtype in GridPatch #4635

Merged
wyli merged 8 commits intoProject-MONAI:devfrom
vale-salvatelli:patch-2
Jul 6, 2022
Merged

Fix casting of location dtype in GridPatch #4635
wyli merged 8 commits intoProject-MONAI:devfrom
vale-salvatelli:patch-2

Conversation

@vale-salvatelli
Copy link
Copy Markdown
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 <[email protected]>

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: monai-bot <[email protected]>
Signed-off-by: vale-salvatelli <[email protected]>
Signed-off-by: vale-salvatelli <[email protected]>
Copy link
Copy Markdown
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
Copy Markdown
Contributor

wyli commented Jul 6, 2022

/black

@wyli wyli enabled auto-merge (squash) July 6, 2022 17:21
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Jul 6, 2022

/build

1 similar comment
@wyli
Copy link
Copy Markdown
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