Week 6: Seeing Red (Literally And Figuratively)
Seeing Red (Literally And Figuratively)
I realize I mentioned in last week’s post that that post would be relatively devoid of puns. After obtaining reader feedback, I’ve been informed that I was very wrong. I’m so deeply sorry for any inconvenience and/or emotional distress this may have caused.
This week, I hope to live up to that promise once and for all (please don’t look at the title please please pretty please I promise it’s normal and definitely not a reference of any sort).
Stain Deconvolution Results
Last week, I selected two patches (one normal patch and one exhibiting pen markings) to test stain deconvolution on. After running stain deconvolution, here were my results:
It’s important to note that the raw resulting hematoxylin and eosin channel images are actually black and white. They’re just colored post-stain deconvolution to improve appearance and make image features more visible and distinct.
Seeing Red (Literally and Figuratively)
Now, after obtaining these results, it was time for me to combine the separated hematoxylin and eosin stains to see whether I would be able to construct an image that preserved the original tissue data without displaying pen markings on the image. To do so, I relied upon scikit-learn’s rgb2hed and hed2rgb functions in the skimage.color module. Essentially, these two tools allow me to convert images from a RGB (red, green, and blue) color space to a HED (Hematoxylin, Eosin, and DAB) color space.
For reference, here’s my main code for stain deconvolution:
Starting with the normal patch, to combine the hematoxylin & eosin channel images, I used hed2rgb to convert ihc_hed (containing the separated stains) to RGB. Here’s the resulting image:
Now, let’s compare this to my original image to see how accurate this process was:
Awesome! I can safely call part 1 of this endeavor to combine my separated stains a success. Now, for the moment of truth: time to try this with my pen marking patch. After re-running my code for this new patch, here’s the resulting combined image:
Alas, this image was a bit too red for my liking. Here’s the original image of this patch for reference:
As I’m writing this, I’m contemplating potential theories for why this might be occurring. One that immediately jumps out at me is that when I run rgb2hed, it’s combining the hematoxylin and eosin channels as well as DAB (a derivative of benzene used in staining for histopathology images), an image of which is below:
During the next week, I’ll work to further my attempts at combining the separated stains: this time, focusing on trying to exclude DAB in my combined images to determine whether this solves this particularly colorful issue that I would use equally colorful words to describe my frustration with. Once I do so, I’ll (hopefully) finally have crossed the last hurdle in my ability to convert patches with pen markings to patches without pen markings. In the next few weeks, I’ll then be able to work to integrate this code into a fully-fledged pipeline that sources TCGA slides and efficiently removes pen markings from selected slides.
I sincerely hope you enjoyed this pun-free post. Back to our regularly scheduled programming next week!
- Cartoon: U/Iivmg5 (Reddit)