scikit-image icon indicating copy to clipboard operation
scikit-image copied to clipboard

H&E and Residual, rather than HED

Open OswaldZhang opened this issue 1 year ago • 7 comments

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. https://github.com/scikit-image/scikit-image/issues/6333; https://github.com/scikit-image/scikit-image/issues/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!

OswaldZhang avatar Apr 14 '24 03:04 OswaldZhang

Hi @OswaldZhang,

After reading you and re-reading the old related issues, I'm sold, we should have an 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 https://github.com/scikit-image/scikit-image/issues/7334#issue-2169346557)? Or vice-versa?

mkcor avatar Apr 15 '24 16:04 mkcor

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.

OswaldZhang avatar Apr 29 '24 06:04 OswaldZhang

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.,

https://github.com/scikit-image/scikit-image/blob/a932dd1492cbb77e922ae83576babab7bd303cf7/skimage/color/colorconv.py#L1284

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.

mkcor avatar Apr 29 '24 13:04 mkcor

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.

GParolini avatar May 02 '24 21:05 GParolini

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

OswaldZhang avatar May 04 '24 06:05 OswaldZhang

Hello scikit-image core devs! There hasn't been any activity on this issue for more than 180 days. I have marked it as "dormant" to make it easy to find.

To our contributors, thank you for your contribution and apologies if this issue fell through the cracks! Hopefully this ping will help bring some fresh attention to the issue. If you need help, you can always reach out on our forum

If you think that this issue is no longer relevant, you may close it, or we may do it at some point (either way, it will be done manually).

github-actions[bot] avatar Nov 01 '24 02:11 github-actions[bot]

@bpavie fyi

mkcor avatar Apr 07 '25 13:04 mkcor