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

Add support for clim (contrast limits) #47

Merged
merged 8 commits into from
Dec 17, 2020
Merged

Add support for clim (contrast limits) #47

merged 8 commits into from
Dec 17, 2020

Conversation

almarklein
Copy link
Collaborator

No description provided.

@almarklein
Copy link
Collaborator Author

This is ready. There is still a minor issue that the full-res slice is not loaded when auto-reloading (in debug mode). But this bug was already present before this PR, and can fix it later.

@almarklein almarklein mentioned this pull request Dec 17, 2020
Closed
16 tasks
indices = [slice(None), slice(None), slice(None)]
indices[self._axis] = index
im = self._volume[tuple(indices)]
return (im.astype(np.float32) * (255 / im.max())).astype(np.uint8)
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand well, before having clim the contrast could vary as the slice changed, since the max of the slice was used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nicely spotted! Yes, it did. I think I originally meant to scale to the volume min/max, but accidentally used the im instead.



@app.callback(Output(slicer.clim.id, "data"), [Input("clim-slider", "value")])
def update_clim(value):
Copy link
Contributor

Choose a reason for hiding this comment

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

beautifully simple!

Copy link
Contributor

@emmanuelle emmanuelle left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@almarklein
Copy link
Collaborator Author

Thanks for the review!

@almarklein almarklein merged commit ab62aa4 into main Dec 17, 2020
@almarklein almarklein deleted the clim branch December 17, 2020 13:48
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.

2 participants