scikit-image / scikit-image

Image processing in Python
https://scikit-image.org
Other
6.07k stars 2.22k forks source link

Image color deconvolution tutorial #4532

Closed asmagen closed 4 years ago

asmagen commented 4 years ago

I have followed the image deconvolution tutorial here and got the following outputs for which I'm not sure how to proceed to save an image file with only the color intensities corresponding to the DAB only. The goal in my analysis is to identify positive marker pixels so I used the non-deconvoluted image as input to an pixel classifier ML module, but the accuracy is poor probably because of the Hematoxylin intensities which I would like to remove or reduce. How is that possible?

Screen Shot 2020-03-26 at 11 09 01 AM Screen Shot 2020-03-26 at 11 11 20 AM
soupault commented 4 years ago

@asmagen this is a skimage development tracker. For general questions on the library use, please, consider posting to https://forum.image.sc/tag/scikit-image.

Above said, in the example you referred to, ihc_hed[:, :, 2] is the image you are looking for. You can save it, for example, using skimage - skimage.io.imsave('test.png', ihc_hed[:, :, 2]) or matplotlib - plt.imsave('test.png', ihc_hed[:, :, 2], cmap=plt.cm.gray).

asmagen commented 4 years ago

How do I get the common representation of grayscale 0-255 without saving and loading again?