-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
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. |
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautifully simple!
There was a problem hiding this 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!
Thanks for the review! |
No description provided.