<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hi Koundinya,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">It looks like this is not a trivial question, because the conversion between the two spaces is nonlinear. See the code here:</div><div id="bloop_customfont" style="margin:0px"><a href="https://github.com/scikit-image/scikit-image/blob/master/skimage/color/colorconv.py#L1437">https://github.com/scikit-image/scikit-image/blob/master/skimage/color/colorconv.py#L1437</a></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">I originally thought that it would be possible to convert each channel separately, but the `exp` call makes this either difficult or impossible (I haven't yet decided which, but I wasn't able to get it to work in a short amount of time).</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Here's my initial attempt, which was a complete failure, for the record:</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px"><div id="bloop_customfont" style="margin:0px">In [1]: from skimage import data</div><div id="bloop_customfont" style="margin:0px">In [2]: from skimage.color import rgb2hed</div><div id="bloop_customfont" style="margin:0px">In [3]: from skimage.color import hed2rgb</div><div id="bloop_customfont" style="margin:0px">In [4]: import matplotlib.pyplot as plt</div><div id="bloop_customfont" style="margin:0px">In [5]: ihc_rgb = data.immunohistochemistry()</div><div id="bloop_customfont" style="margin:0px">In [6]: ihc_hed = rgb2hed(ihc_rgb)</div><div id="bloop_customfont" style="margin:0px">In [8]: import numpy as np</div><div id="bloop_customfont" style="margin:0px">In [9]: h, e, d = np.transpose(ihc_hed, (2, 0, 1))</div><div id="bloop_customfont" style="margin:0px">In [10]: empty = np.zeros_like(h)</div><div id="bloop_customfont" style="margin:0px">In [11]: h_rgb = hed2rgb(np.dstack((h, empty, empty)))</div><div id="bloop_customfont" style="margin:0px">In [12]: e_rgb = hed2rgb(np.dstack((empty, e, empty)))</div><div id="bloop_customfont" style="margin:0px">In [13]: d_rgb = hed2rgb(np.dstack((empty, empty, d)))</div><div id="bloop_customfont" style="margin:0px">In [14]: fig, axes = plt.subplots(2, 2, figsize=(6, 7), sharex=True,</div><div id="bloop_customfont" style="margin:0px">    ...:                          sharey=True,</div><div id="bloop_customfont" style="margin:0px">    ...:                          subplot_kw={'adjustable': 'box-forced'})</div><div id="bloop_customfont" style="margin:0px">In [15]: axes[0, 0].imshow(ihc_rgb); axes[0, 0].set_title('Original image')</div><div id="bloop_customfont" style="margin:0px">Out[15]: <matplotlib.text.Text at 0x121357438></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">In [16]: axes[0, 1].imshow(h_rgb); axes[0, 1].set_title('Hematoxylin')</div><div id="bloop_customfont" style="margin:0px">Out[16]: <matplotlib.text.Text at 0x121371c18></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">In [17]: axes[1, 0].imshow(e_rgb); axes[1, 0].set_title('Eosin')</div><div id="bloop_customfont" style="margin:0px">Out[17]: <matplotlib.text.Text at 0x1210684e0></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">In [18]: axes[1, 1].imshow(d_rgb); axes[1, 1].set_title('DAB')</div><div id="bloop_customfont" style="margin:0px">Out[18]: <matplotlib.text.Text at 0x1219315f8></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">In [19]: for ax in axes.ravel():</div><div id="bloop_customfont" style="margin:0px">    ...:     ax.axis('off')</div></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Result:</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px"><img src="cid:924AE08B-E469-465E-AF4A-A4824B38D8DE"></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Maybe someone else in the list has some ideas?</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Juan.</div> <div class="airmail_ext_on" style="color:black"><br>From: <span style="color:black">Koundinya Desiraju</span> <a href="mailto:drkoundinyadesiraju@gmail.com"><drkoundinyadesiraju@gmail.com></a><br>Reply: <span style="color:black"><a href="mailto:scikit-image@googlegroups.com">scikit-image@googlegroups.com</a></span> <a href="mailto:scikit-image@googlegroups.com"><scikit-image@googlegroups.com></a><br>Date: <span style="color:black">23 August 2016 at 3:40:09 PM</span><br>To: <span style="color:black">scikit-image</span> <a href="mailto:scikit-image@googlegroups.com"><scikit-image@googlegroups.com></a><br>Subject: <span style="color:black"> IHC Image color deconvolution <br></span></div><br> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>


<title></title>


<div dir="ltr">In this tutorial,
<a href="http://scikit-image.org/docs/dev/auto_examples/color_exposure/plot_ihc_color_separation.html#sphx-glr-auto-examples-color-exposure-plot-ihc-color-separation-py">http://scikit-image.org/docs/dev/auto_examples/color_exposure/plot_ihc_color_separation.html#sphx-glr-auto-examples-color-exposure-plot-ihc-color-separation-py</a>
<div><br></div>
<div>After color deconvolution the haematoxylin and DAB channels
were plotted in grayscale but I want to show them in respective
colors. For example, I want to show DAB channel in brown. Can
anyone kindly post How to do that?
<div><br></div>
<div>Thanks,</div>
<div>Koundinya</div>
</div>
</div>
--<br>
You received this message because you are subscribed to the Google
Groups "scikit-image" group.<br>
To unsubscribe from this group and stop receiving emails from it,
send an email to <a href="mailto:scikit-image+unsubscribe@googlegroups.com">scikit-image+unsubscribe@googlegroups.com</a>.<br>

To post to this group, send email to <a href="mailto:scikit-image@googlegroups.com">scikit-image@googlegroups.com</a>.<br>

To view this discussion on the web, visit <a href="https://groups.google.com/d/msgid/scikit-image/74882dde-6af5-4cb8-a02d-debd5e2e1678%40googlegroups.com?utm_medium=email&utm_source=footer">
https://groups.google.com/d/msgid/scikit-image/74882dde-6af5-4cb8-a02d-debd5e2e1678%40googlegroups.com</a>.<br>

For more options, visit <a href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br>


</div></div></span></blockquote></body></html>