-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
roundtrip hed -> rgb -> hed is broken #6104
Comments
Hello @cgebbe,
🤔 I wouldn't think so, since |
Thank you @cgebbe for reporting, I can reproduce! |
OK, it seems that the round trip breaking was expected: please see #5164 (comment) and it seems that you are right @cgebbe, |
@scikit-image/core, do we consider this is a bug or an expected behavior? Should we close? |
At this point, I would consider it expected behaviour, but we should say something about it in the docstring. So maybe relabel this issue from 'bug' to 'documentation?' My understanding is that there is no perfect solution, from what @crisluengo explained ("Every lab produces different colors for the same stains..."), also in this more recent thread: https://github.com/scikit-image/scikit-image/discussions/6065#discussioncomment-1708113 |
@cgebbe There are colors that cannot be represented in this HED "color space". HED represents the combination of three stains commonly used in microscopy: Hematoxylin (blue/purple), Eosin (pink) and DAB (brown). There is no way to combine these three stains to obtain, for example, green. So in your input random image, any greenish pixel, when converted to HED, will necessarily change color. Conversion from RGB to HED should be applied only to images of tissue stained with these stains. Conversion from HED to RGB can be used to simulate what such a stained tissue would look like. Don't use HED as a generic color space such as RGB, CMYK, Yxy, Lab, etc. |
I am going to close this as answered. It does not seem that new changes are necessary |
Description
It seems the roundtrip hed -> rgb -> hed has been broken recently:
Way to reproduce
Version information
Possible root cause
I believe that the root cause is the added
np.maximum
, see https://github.com/scikit-image/scikit-image/blame/main/skimage/color/colorconv.py#L1578Existing test
There already is a test for hed->rgb->hed conversion, namely https://github.com/scikit-image/scikit-image/blob/v0.19.x/skimage/color/tests/test_colorconv.py#L241 . However,
self.img_stains
only has float values until 0.3. We can make the test above pass by enforcing...The text was updated successfully, but these errors were encountered: