-
Notifications
You must be signed in to change notification settings - Fork 39
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 docs on advanced contrast limits widget #542
base: main
Are you sure you want to change the base?
Conversation
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.
I made some suggestions to elaborate a few of the details a bit more.
|
||
To avoid such issues, you can reset the contrast limits by clicking the | ||
"auto-contrast: once" button, or, if that fails, right-clicking on the contrast | ||
limits to do manual adjustment, including directly editing the numbers shown or |
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.
We can leave this, but looking at the code and testing a bit with:
data = np.array([[10, 15], [20 ,25]], dtype=np.uint8)
I think that once
and reset
do exactly the same thing.
I was expecting once
to use the data range, but it uses dtype range.
once
and continuous
should get tooltips -- i'll add that to an existing issue with contrast limits in napari/napari
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.
Ok , nvm, confusingly, once and reset do the same thing for the case of unit8 but not the others, where once will only reset contrast limits and not their range.
Co-authored-by: Peter Sobolewski <[email protected]>
Co-authored-by: Peter Sobolewski <[email protected]>
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.
thanks @melissawm !!
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.
Overall, these are great changes! The animation is super useful and I think the explanation of the advanced contrast limits works great. Two more things I could see being useful to add (could be in a separate PR):
- Explanation of once/continuous buttons. Continuous in particular has a lot of use that is not immediately obvious.
- Explanation of gamma, since that is the last main way to change the visualization of the cmaps.
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.
Fabulous animation. I'm just checking that you intend for it to be slowed down. I think it being slowed down helps the user see the actions being made, but I also wouldn't want people to think napari is laggy. I am in favour of keeping it the way it currently is.
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.
Yeah - I made two versions, and remembered that we got feedback the other day about GIFs/animations being too quick for the user to see what was happening. Happy to redo if we think this is too much, though!
the image data that will get mapped to the color defined by 0 in the colormap, | ||
meaning that in most cases any value under the smaller contrast limit will appear as black. On | ||
the other hand, the larger contrast limit corresponds to the value of the image | ||
data that will get mapped to the color defined by 1 in the colormap. For example, for an image using the `gray` colormap, all values larger than this value will appear as white. |
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.
data that will get mapped to the color defined by 1 in the colormap. For example, for an image using the `gray` colormap, all values larger than this value will appear as white. | |
data that will get mapped to the color defined by 1 in the colormap; for an image using the `gray` colormap, all values larger than this value will appear as white. Note that the values set in the contrast limits do not change the underlying values of the image, only the visualization of the colormap. |
meaning that in most cases any value under the smaller contrast limit will appear as black. On | ||
the other hand, the larger contrast limit corresponds to the value of the image |
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.
meaning that in most cases any value under the smaller contrast limit will appear as black. On | |
the other hand, the larger contrast limit corresponds to the value of the image | |
meaning that in most cases any value under the lower contrast limit will appear as black. On | |
the other hand, the upper contrast limit corresponds to the value of the image |
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.
Is it worth using lower/upper language isntead of smaller/larger (there's a few other places this is relevant)? I suppose it's equivalent language, but I do find that perhaps for arrays with signed values lower/upper is more intuitive when I explain to others (because while -2 is smaller than -0.1, the magnitude is larger)
@@ -395,19 +395,54 @@ Because the contrast limits are defined by two values, the corresponding slider | |||
has two handles: one adjusts the smaller value, and one adjusts the larger | |||
value. | |||
|
|||
As of right now, adjusting the contrast limits has no effect for `rgb` data. | |||
For RGB images, adjusting the contrast limits adjusts the black point and white point of the image. |
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.
Should these lines be moved to above the L375 code cell? on the webpage it feels a bit caught out between the image and the admonition
References and relevant issues
Closes #535
Description
Borrows some word from the discussion on #533, and adds a small video to showcase and document the advanced contrast limits widget.