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

H&E and Residual, rather than HED #7397

Open
OswaldZhang opened this issue Apr 14, 2024 · 5 comments
Open

H&E and Residual, rather than HED #7397

OswaldZhang opened this issue Apr 14, 2024 · 5 comments

Comments

@OswaldZhang
Copy link

OswaldZhang commented Apr 14, 2024

Description:

Hi guys, thanks for the awesome package! I'm gonna suggest a feature for rgb2hed function: https://scikit-image.org/docs/stable/auto_examples/color_exposure/plot_ihc_color_separation.html, in biology, compared with HED stained (D typically stands for DAB, which is used for immunochemistry staining), researchers always just stain hematoxylin and eosin. In this scenario, there are just 2 colors in the stain space. One can just separate them in QuPath or Fuji
image

However, in skimage, there is just one function, rgb2hed, which deconvolute the original image to the Hematoxylin Eosin DAB channel. But in this case, we only need a Residual channel rather than a DAB channel. This is a long debated question in biology background users and skimage maintainers e.g. #6333; #7334

Also, if we use the color vector calculated in QuPath (which is described by G. Landini [1] I think) and use hed2rgb for visualize, it seems the results are different as if we treat the third channel as Residual rather than DAB:
image
image
image

here is skimage output using QuPath estimated vector:
download-2

here is skimage output using QuPath rgb2hed function:
download-1

So I'm pretty sure there is a problem that rgb2hed, as its name suggested, treats Residual channels as DAB channels for H&E staining. And if we wanna plot the deconvoluted channel, there may be some problems on hed2rgb, for it will treat the Residual channel as DAB and cause artifacts.

As for a suggestion to empower skimage impact in biology, I strongly suggest adding rgb2her function, where r stands for Residual for H&E image, as there may be some computational pathology researchers may misuse the function to deconv their image, e.g. https://github.com/daviddaiweizhang/istar/blob/master/extract_features.py#L370

If needed, I can provide more background information on it. Thanks!

@mkcor mkcor changed the title H&E and Residual, rather tha HED H&E and Residual, rather than HED Apr 15, 2024
@mkcor
Copy link
Member

mkcor commented Apr 15, 2024

Hi @OswaldZhang,

After reading you and re-reading the old related issues, I'm sold, we should have and rgb2her (and, conversely, her2rgb) function, in order to handle H&E (Hematoxylin + Eosin) images. Would you be able to start a pull request with an implementation for rgb2her and, perhaps, collaborate with @GParolini (who posted #7334 (comment))? Or vice-versa?

@OswaldZhang
Copy link
Author

OswaldZhang commented Apr 29, 2024

Hi @mkcor,

Sorry for my late response. Sure, I can provide an implementation on rgb2her and her2rgb function. Since I'm new to skimage development, is there any format guidance for me (as well as the docs guidance)? If @GParolini is available, we would pretty much like to start the implementation or I just start it for now and see if @GParolini wants to join.

@mkcor
Copy link
Member

mkcor commented Apr 29, 2024

Hi @OswaldZhang,

Wonderful! I believe that @GParolini should be available in May.

Please follow these instructions to get started with contributing to scikit-image.

To write your rgb2her and her2rgb functions, you would edit the skimage/color/colorconv.py file. Follow the style and format used in the other conversion functions there, e.g.,

def lab2rgb(lab, illuminant="D65", observer="2", *, channel_axis=-1):

Then, you would add tests in skimage/color/tests/test_colorconv.py (following the style and format used in the other tests there).

Should you need any help, please poke us in the chat or in the developer forum.

@GParolini
Copy link
Contributor

Hi @OswaldZhang, I would be happy to work together on this issue. We can discuss in Zulip or in the developer forum how to proceed.

@OswaldZhang
Copy link
Author

Thanks for the kindly guidance @mkcor and glad to hear from you @GParolini. I've DM you through Zulip, let's kick it off!

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

No branches or pull requests

3 participants