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

Allow to overwrite mpp #128

Merged
merged 7 commits into from
Dec 30, 2022
Merged

Allow to overwrite mpp #128

merged 7 commits into from
Dec 30, 2022

Conversation

jonasteuwen
Copy link
Contributor

  • overwrite_mpp=(mpp_x, mpp_y) can now be added to the SlideImage and the TiledROISlideImageDataset constructors.

- `overwrite_mpp=(mpp_x, mpp_y)` can now be added to the `SlideImage` and the `TiledROISlideImageDataset` constructors.
@github-actions github-actions bot added the ci label Dec 27, 2022
edwin-de-jong
edwin-de-jong previously approved these changes Dec 29, 2022
Copy link
Collaborator

@edwin-de-jong edwin-de-jong left a comment

Choose a reason for hiding this comment

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

LGTM; some minor comments.

dlup/_image.py Outdated

if self._wsi.spacing is None:
raise UnsupportedSlideError(
f"{identifier} has not parsable spacing and not explicitly set in the `overwrite_mpp` parameter."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment not entirely grammatical.

mpp = np.array([mpp_y, mpp_x])
self._spacings = [tuple(mpp * downsample) for downsample in self.level_downsamples]
self._spacings = [cast(tuple[float, float], tuple(mpp * downsample)) for downsample in self.level_downsamples]
Copy link
Collaborator

Choose a reason for hiding this comment

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

self._spacings: I'd prefer to always add the unit of measurement in the name of any quantitative variable; e.g. self._spacings_mpp in this case. Can save a lot of headaches and difficult-to-spot bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, but in this case I don't see too much discrepancy. What other spacing would we have?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants