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

GridPatch returns inconsistent type location when padding #4597

Closed
vale-salvatelli opened this issue Jun 27, 2022 · 0 comments · Fixed by #4598
Closed

GridPatch returns inconsistent type location when padding #4597

vale-salvatelli opened this issue Jun 27, 2022 · 0 comments · Fixed by #4598

Comments

@vale-salvatelli
Copy link
Contributor

GridPatch adds patches of constant value and 0, 0 location when the number of required patches is bigger than the patches that can be extracted from the image. The patch location returned in this case should be a List [0, 0] ,to be consistent with the type of the otherwise returned types, while it currently is a List of Lists [[0], [0]].

The reason of this behavior can be seen in this line

start_location = convert_to_dst_type(src=np.zeros((len(self.patch_size), 1)), dst=array)[0]

The above line should be changed to np.zeros((len(self.patch_size)))

vale-salvatelli added a commit to vale-salvatelli/MONAI that referenced this issue Jun 27, 2022
wyli pushed a commit that referenced this issue Jun 29, 2022
* Fix the location type returned in GridPatch when padding

This PR fixes this issue #4597

* signing and fixing docstring

Signed-off-by: Valentina Salvatelli <[email protected]>
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 a pull request may close this issue.

1 participant