{
  "id": 333704,
  "title": "Understanding the Different Tissue Stains",
  "url": "/competitions/hubmap-organ-segmentation/discussion/333704",
  "author_name": "",
  "post_date": "2022-06-27T19:25:55.241805400Z",
  "votes": 40,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I wanted to create a post to improve understanding of the various staining techniques and what they look like. I'd like to ask that if anyone can help me improve this post that they post in the comments and I will do my best to incorporate the feedback.</p>\n<p>This is what we know from the data page:</p>\n<blockquote>\n  <p><strong><em>\"</em></strong> <em>Expect roughly 550 images in the hidden test set. All HPA images are 3000 x 3000 pixels with a tissue area within the image around 2500 x 2500 pixels. The HuBMAP images range in size from 4500x4500 down to 160x160 pixels. HPA samples were stained with antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin. HuBMAP images were prepared using Periodic acid-Schiff (PAS)/hematoxylin and eosin (H&amp;E) stains. All images used have at least one FTU. All tissue data used in this competition is from healthy donors that pathologists identified as pathologically unremarkable tissue.</em> <strong><em>\"</em></strong></p>\n</blockquote>\n<hr>\n<p><strong>We summarize the salient details as:</strong></p>\n<ul>\n<li>Dataset Image Distribution<ul>\n<li>351 images in the train dataset<ul>\n<li>All training images are HPA </li></ul></li>\n<li>~550 images in test dataset<ul>\n<li>Public test images are HPA or HuBMAP</li>\n<li>Private test images are all HuBMAP</li></ul></li></ul></li>\n<li>Image Sizes By Source<ul>\n<li>HPA<ul>\n<li>All images regardless of the respective organ are 3000x3000 pixels <em>(tissue area of ~2500x2500)</em></li>\n<li>All images regardless of the respective organ have a tissue slice thickness of 4µm</li>\n<li>All images regardless of the respective organ have a pixel size of 0.4µm</li></ul></li>\n<li>HuBMAP<ul>\n<li>All images regardless are between 4500x4500 to 160x160 pixels (unknown if impacted by the respective organ)</li>\n<li>Image tissue slice thickness is dependent upon the respective organ:<ul>\n<li>10µm for kidney</li>\n<li>8µm for large intestine</li>\n<li>4µm for spleen</li>\n<li>5µm for lung</li>\n<li>5µm for prostate</li></ul></li>\n<li>Image pixel size is dependent upon the respective organ:<ul>\n<li>0.5000µm for kidney</li>\n<li>0.2290µm for large intestine</li>\n<li>0.4945µm for spleen</li>\n<li>0.7562µm for lung</li>\n<li>6.2630µm for prostate  </li></ul></li></ul></li></ul></li>\n<li>Tissue Staining By Source***<ul>\n<li>HPA<ul>\n<li>Antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin</li></ul></li>\n<li>HuBMAP<ul>\n<li>Prepared using Periodic acid-Schiff (PAS)/hematoxylin OR eosin (H&amp;E) stains (one or the other for a given image… not both --&gt; <a href=\"https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/333705\" target=\"_blank\"><strong>reference answer from host clarifying this here</strong></a></li></ul></li></ul></li>\n</ul>\n<hr>\n<p><br></p>\n<p>This discussion is primarily about tissue staining. Let's look at the three types of tissue staining (from 2 data sources) and understand what they look like, stain for, and how we can create a model to understand both.</p>\n<p><br></p>\n<hr>\n<p><br></p>\n<p>Let's begin with the HPA data which is described as <strong><em>\"Antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin\"</em></strong>. Let's break this down term-by-term and then visualize it.</p>\n<ul>\n<li><strong>Antibodies <a href=\"https://www.livescience.com/antibodies.html\" target=\"_blank\"><strong><em>[reference – livescience.com]</em></strong></a></strong><ul>\n<li>Antibodies are specialized, Y-shaped proteins that bind like a lock-and-key to the body's foreign invaders — whether they are viruses(opens in new tab), bacteria, fungi or parasites. They are the \"search\" battalion of the immune system's search-and-destroy system, tasked with finding an enemy and marking it for destruction.</li>\n<li>\"They're released from the cell and they go out and hunt,\" said Dr. Warner Greene, the director of the Center for HIV Cure Research at the Gladstone Institutes in San Francisco.</li>\n<li>When antibodies find their target, they bind to it, which then triggers a cascade of actions that vanquish the invader. Antibodies are part of the so-called \"adaptive\" immune system, the arm of the immune system that learns to recognize and eliminate specific pathogens, Greene said. </li></ul></li>\n<li><strong>3,3'-diaminobenzidine (DAB) <a href=\"https://www.abcam.com/kits/dab-staining\" target=\"_blank\"><strong><em>[reference – abcam.com]</em></strong></a></strong><ul>\n<li>DAB (3,3′-Diaminobenzidine) is a derivative of benzene. It is most often used in immunohistochemical (IHC) staining as a chromogen (a substance which can be readily converted into a dye or other coloured compound). It is also used in in-situ hybridization (ISH) and sometimes in dot blots and in western blotting.</li>\n<li>In DAB staining, DAB is oxidized by hydrogen peroxide in a reaction typically catalyzed by horseradish peroxidase (HRP). The oxidized DAB forms a <strong>BROWN precipitate</strong>, at the location of the HRP, which can be visualized using light microscopy.</li>\n<li><img src=\"https://i.ibb.co/w0khHzm/immunohisto1.png\" alt=\"dab\"></li></ul></li>\n<li><strong>Counterstained with Hematoxylin <a href=\"https://www.abcam.com/kits/dab-staining\" target=\"_blank\"><strong><em>[reference – abcam.com]</em></strong></a></strong><ul>\n<li>Immunohistochemical staining using chromogens often benefits from having a counterstain applied that enhances the contrast and facilitates the observation of histological features. </li>\n<li>The most <strong>common type of counterstain</strong> used for FFPE samples is <strong>hematoxylin</strong> that **stains cellular cytoplasm with a *<em>PALE-BLUISH colour</em>*, and **stains cell nuclei in a <strong>DARK-BLUISH nuance</strong>. </li>\n<li><em>Other counterstaining information removed for brevity/clarity</em></li></ul></li>\n</ul>\n<p><br></p>\n<hr>\n<p>Let's put all this together now and spell out what it means. </p>\n<ol>\n<li>HPA images are stained with <strong>DAB</strong> resulting in a <strong>BROWN</strong> colour near sites of enzymatic activity.</li>\n<li>HPA images are also stained (counterstained) with <strong>HEMATOXYLIN</strong> resulting in a LIGHT-BLUE colour in the <strong>CYTOPLASM</strong> (a gelatinous liquid that fills the inside of a cell – so cells are mostly coloured light blue) and <strong>DARK-BLUE</strong> colour in the <strong>CELL NUCLEI</strong> (while the cell is light-blue, the nucleus/nuclei will be dark blue)</li>\n</ol>\n<p>Here is an example showing a 400x400x3 pixel crop from the first example in the training dataset:</p>\n<p><img src=\"https://i.ibb.co/TgWTPBD/tmp.png\" alt=\"dab\"></p>\n<p><br></p>\n<hr>\n<p><br></p>\n<p>Next we move to the HuBMAP data which is described as <strong><em>\"Prepared using Periodic acid-Schiff (PAS)/hematoxylin and eosin (H&amp;E) stains\"</em></strong>. Let's break this down term-by-term and then visualize it.</p>\n<ul>\n<li><strong>Periodic Acid-Schiff (PAS) Stain <a href=\"https://laboratorytests.org/periodic-acid-schiff-pas-stain/\" target=\"_blank\"><strong><em>[reference – laboratorytests.com]</em></strong></a></strong><ul>\n<li>The Periodic Acid-Schiff (PAS) Stain is widely used technique in histopathology for the demonstration of carbohydrates and carbohydrate rich compounds in tissues. </li>\n<li>PAS stain demonstrates polysaccharides, mucin, glycogen, certain glycoproteins and glycolipids, basement membrane and certain fungus in tissues.</li>\n<li>PAS stains result in <strong>MAGENTA to RED</strong> colour for <strong>PAS positive material</strong></li>\n<li>PAS stains result in <strong>BLUE</strong> colour for <strong>cell nuclei</strong></li>\n<li>~<img src=\"https://i.ibb.co/9p7sw9X/PAS-staining.jpg\" alt=\"pas-stain\"></li></ul></li>\n<li><strong>Hematoxylin and Eosin (H&amp;E) Stains <a href=\"https://www.livescience.com/antibodies.html\" target=\"_blank\"><strong><em>[reference – livescience.com]</em></strong></a></strong><ul>\n<li>The H&amp;E staining procedure is the principal stain in histology in part because it can be done quickly, is not expensive, and stains tissues in such a way that a considerable amount of microscopic anatomy is revealed, and can be used to diagnose a wide range of histopathologic conditions. </li>\n<li>H&amp;E is the combination of two histological stains: <strong>hematoxylin (used in HPA as well)</strong> and eosin. </li>\n<li>The <strong>Hematoxylin</strong> stains <strong>cell nuclei a DARK-BLUE</strong></li>\n<li>The <strong>Eosin</strong> stains the <strong>extracellular matrix and cytoplasm PINK</strong></li>\n<li>Other structures take on different shades, hues, and combinations of the previously mentioned colours.</li>\n<li><img src=\"https://i.ibb.co/31Tyb2F/Retina-high-mag.jpg\" alt=\"he\"></li></ul></li>\n</ul>\n<p><br></p>\n<hr>\n<p>Let's put all this together now and spell out what it means. </p>\n<ol>\n<li>Some HuBMAP images are stained using <strong>PAS</strong> resulting in a <strong>MAGENTA/RED</strong> colour for <strong>carbohydrate-rich compounds in tissues</strong> (complex sugars) as well as <strong>DARK-BLUE</strong> colour for <strong>CELL NUCLEI</strong></li>\n<li>Some HuBMAP images are stained using <strong>H&amp;E</strong> resulting in a <strong>PINK</strong> colour for the cytoplasm as well as <strong>BLUE</strong> colour for <strong>CELL NUCLEI</strong></li>\n</ol>\n<p><br></p>\n<hr>\n<p><br><br></p>\n<p>To wrap it all up:</p>\n<ul>\n<li>We can see that in general, regardless of imaging type, <strong>CELL NUCELI</strong> are almost always stained <strong>DARK-BLUE</strong>.</li>\n<li>We can see that cellular <strong>CYTOPLASM</strong> is stained either <strong>PINK</strong> or <strong>LIGHT-BLUE</strong> (These are both high brightness, low contrast colours and if converted to grayscale they may look similar?).</li>\n<li>We can see that areas of <strong>HIGH-ENZYMATIC ACTIVITY</strong> are stained <strong>BROWN</strong> while areas containing <strong>CARBOHYDRATES</strong> are stained <strong>MAGENTA/RED</strong> </li>\n</ul>\n<p>I'm not 100% sure how to use this information yet… however, we can see similarities across the staining methods as well as noticeable differences.</p>\n<hr>\n<p>Let me know what you think and hope this helps a bit. Please let me know if I need to make any corrections or if you'd like anything added. 😊</p>",
  "messages": [
    {
      "id": "1835505",
      "postDate": "06/27/2022 19:25:55",
      "content": "<p>I wanted to create a post to improve understanding of the various staining techniques and what they look like. I'd like to ask that if anyone can help me improve this post that they post in the comments and I will do my best to incorporate the feedback.</p>\n<p>This is what we know from the data page:</p>\n<blockquote>\n  <p><strong><em>\"</em></strong> <em>Expect roughly 550 images in the hidden test set. All HPA images are 3000 x 3000 pixels with a tissue area within the image around 2500 x 2500 pixels. The HuBMAP images range in size from 4500x4500 down to 160x160 pixels. HPA samples were stained with antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin. HuBMAP images were prepared using Periodic acid-Schiff (PAS)/hematoxylin and eosin (H&amp;E) stains. All images used have at least one FTU. All tissue data used in this competition is from healthy donors that pathologists identified as pathologically unremarkable tissue.</em> <strong><em>\"</em></strong></p>\n</blockquote>\n<hr>\n<p><strong>We summarize the salient details as:</strong></p>\n<ul>\n<li>Dataset Image Distribution<ul>\n<li>351 images in the train dataset<ul>\n<li>All training images are HPA </li></ul></li>\n<li>~550 images in test dataset<ul>\n<li>Public test images are HPA or HuBMAP</li>\n<li>Private test images are all HuBMAP</li></ul></li></ul></li>\n<li>Image Sizes By Source<ul>\n<li>HPA<ul>\n<li>All images regardless of the respective organ are 3000x3000 pixels <em>(tissue area of ~2500x2500)</em></li>\n<li>All images regardless of the respective organ have a tissue slice thickness of 4µm</li>\n<li>All images regardless of the respective organ have a pixel size of 0.4µm</li></ul></li>\n<li>HuBMAP<ul>\n<li>All images regardless are between 4500x4500 to 160x160 pixels (unknown if impacted by the respective organ)</li>\n<li>Image tissue slice thickness is dependent upon the respective organ:<ul>\n<li>10µm for kidney</li>\n<li>8µm for large intestine</li>\n<li>4µm for spleen</li>\n<li>5µm for lung</li>\n<li>5µm for prostate</li></ul></li>\n<li>Image pixel size is dependent upon the respective organ:<ul>\n<li>0.5000µm for kidney</li>\n<li>0.2290µm for large intestine</li>\n<li>0.4945µm for spleen</li>\n<li>0.7562µm for lung</li>\n<li>6.2630µm for prostate  </li></ul></li></ul></li></ul></li>\n<li>Tissue Staining By Source***<ul>\n<li>HPA<ul>\n<li>Antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin</li></ul></li>\n<li>HuBMAP<ul>\n<li>Prepared using Periodic acid-Schiff (PAS)/hematoxylin OR eosin (H&amp;E) stains (one or the other for a given image… not both --&gt; <a href=\"https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/333705\" target=\"_blank\"><strong>reference answer from host clarifying this here</strong></a></li></ul></li></ul></li>\n</ul>\n<hr>\n<p><br></p>\n<p>This discussion is primarily about tissue staining. Let's look at the three types of tissue staining (from 2 data sources) and understand what they look like, stain for, and how we can create a model to understand both.</p>\n<p><br></p>\n<hr>\n<p><br></p>\n<p>Let's begin with the HPA data which is described as <strong><em>\"Antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin\"</em></strong>. Let's break this down term-by-term and then visualize it.</p>\n<ul>\n<li><strong>Antibodies <a href=\"https://www.livescience.com/antibodies.html\" target=\"_blank\"><strong><em>[reference – livescience.com]</em></strong></a></strong><ul>\n<li>Antibodies are specialized, Y-shaped proteins that bind like a lock-and-key to the body's foreign invaders — whether they are viruses(opens in new tab), bacteria, fungi or parasites. They are the \"search\" battalion of the immune system's search-and-destroy system, tasked with finding an enemy and marking it for destruction.</li>\n<li>\"They're released from the cell and they go out and hunt,\" said Dr. Warner Greene, the director of the Center for HIV Cure Research at the Gladstone Institutes in San Francisco.</li>\n<li>When antibodies find their target, they bind to it, which then triggers a cascade of actions that vanquish the invader. Antibodies are part of the so-called \"adaptive\" immune system, the arm of the immune system that learns to recognize and eliminate specific pathogens, Greene said. </li></ul></li>\n<li><strong>3,3'-diaminobenzidine (DAB) <a href=\"https://www.abcam.com/kits/dab-staining\" target=\"_blank\"><strong><em>[reference – abcam.com]</em></strong></a></strong><ul>\n<li>DAB (3,3′-Diaminobenzidine) is a derivative of benzene. It is most often used in immunohistochemical (IHC) staining as a chromogen (a substance which can be readily converted into a dye or other coloured compound). It is also used in in-situ hybridization (ISH) and sometimes in dot blots and in western blotting.</li>\n<li>In DAB staining, DAB is oxidized by hydrogen peroxide in a reaction typically catalyzed by horseradish peroxidase (HRP). The oxidized DAB forms a <strong>BROWN precipitate</strong>, at the location of the HRP, which can be visualized using light microscopy.</li>\n<li><img src=\"https://i.ibb.co/w0khHzm/immunohisto1.png\" alt=\"dab\"></li></ul></li>\n<li><strong>Counterstained with Hematoxylin <a href=\"https://www.abcam.com/kits/dab-staining\" target=\"_blank\"><strong><em>[reference – abcam.com]</em></strong></a></strong><ul>\n<li>Immunohistochemical staining using chromogens often benefits from having a counterstain applied that enhances the contrast and facilitates the observation of histological features. </li>\n<li>The most <strong>common type of counterstain</strong> used for FFPE samples is <strong>hematoxylin</strong> that **stains cellular cytoplasm with a *<em>PALE-BLUISH colour</em>*, and **stains cell nuclei in a <strong>DARK-BLUISH nuance</strong>. </li>\n<li><em>Other counterstaining information removed for brevity/clarity</em></li></ul></li>\n</ul>\n<p><br></p>\n<hr>\n<p>Let's put all this together now and spell out what it means. </p>\n<ol>\n<li>HPA images are stained with <strong>DAB</strong> resulting in a <strong>BROWN</strong> colour near sites of enzymatic activity.</li>\n<li>HPA images are also stained (counterstained) with <strong>HEMATOXYLIN</strong> resulting in a LIGHT-BLUE colour in the <strong>CYTOPLASM</strong> (a gelatinous liquid that fills the inside of a cell – so cells are mostly coloured light blue) and <strong>DARK-BLUE</strong> colour in the <strong>CELL NUCLEI</strong> (while the cell is light-blue, the nucleus/nuclei will be dark blue)</li>\n</ol>\n<p>Here is an example showing a 400x400x3 pixel crop from the first example in the training dataset:</p>\n<p><img src=\"https://i.ibb.co/TgWTPBD/tmp.png\" alt=\"dab\"></p>\n<p><br></p>\n<hr>\n<p><br></p>\n<p>Next we move to the HuBMAP data which is described as <strong><em>\"Prepared using Periodic acid-Schiff (PAS)/hematoxylin and eosin (H&amp;E) stains\"</em></strong>. Let's break this down term-by-term and then visualize it.</p>\n<ul>\n<li><strong>Periodic Acid-Schiff (PAS) Stain <a href=\"https://laboratorytests.org/periodic-acid-schiff-pas-stain/\" target=\"_blank\"><strong><em>[reference – laboratorytests.com]</em></strong></a></strong><ul>\n<li>The Periodic Acid-Schiff (PAS) Stain is widely used technique in histopathology for the demonstration of carbohydrates and carbohydrate rich compounds in tissues. </li>\n<li>PAS stain demonstrates polysaccharides, mucin, glycogen, certain glycoproteins and glycolipids, basement membrane and certain fungus in tissues.</li>\n<li>PAS stains result in <strong>MAGENTA to RED</strong> colour for <strong>PAS positive material</strong></li>\n<li>PAS stains result in <strong>BLUE</strong> colour for <strong>cell nuclei</strong></li>\n<li>~<img src=\"https://i.ibb.co/9p7sw9X/PAS-staining.jpg\" alt=\"pas-stain\"></li></ul></li>\n<li><strong>Hematoxylin and Eosin (H&amp;E) Stains <a href=\"https://www.livescience.com/antibodies.html\" target=\"_blank\"><strong><em>[reference – livescience.com]</em></strong></a></strong><ul>\n<li>The H&amp;E staining procedure is the principal stain in histology in part because it can be done quickly, is not expensive, and stains tissues in such a way that a considerable amount of microscopic anatomy is revealed, and can be used to diagnose a wide range of histopathologic conditions. </li>\n<li>H&amp;E is the combination of two histological stains: <strong>hematoxylin (used in HPA as well)</strong> and eosin. </li>\n<li>The <strong>Hematoxylin</strong> stains <strong>cell nuclei a DARK-BLUE</strong></li>\n<li>The <strong>Eosin</strong> stains the <strong>extracellular matrix and cytoplasm PINK</strong></li>\n<li>Other structures take on different shades, hues, and combinations of the previously mentioned colours.</li>\n<li><img src=\"https://i.ibb.co/31Tyb2F/Retina-high-mag.jpg\" alt=\"he\"></li></ul></li>\n</ul>\n<p><br></p>\n<hr>\n<p>Let's put all this together now and spell out what it means. </p>\n<ol>\n<li>Some HuBMAP images are stained using <strong>PAS</strong> resulting in a <strong>MAGENTA/RED</strong> colour for <strong>carbohydrate-rich compounds in tissues</strong> (complex sugars) as well as <strong>DARK-BLUE</strong> colour for <strong>CELL NUCLEI</strong></li>\n<li>Some HuBMAP images are stained using <strong>H&amp;E</strong> resulting in a <strong>PINK</strong> colour for the cytoplasm as well as <strong>BLUE</strong> colour for <strong>CELL NUCLEI</strong></li>\n</ol>\n<p><br></p>\n<hr>\n<p><br><br></p>\n<p>To wrap it all up:</p>\n<ul>\n<li>We can see that in general, regardless of imaging type, <strong>CELL NUCELI</strong> are almost always stained <strong>DARK-BLUE</strong>.</li>\n<li>We can see that cellular <strong>CYTOPLASM</strong> is stained either <strong>PINK</strong> or <strong>LIGHT-BLUE</strong> (These are both high brightness, low contrast colours and if converted to grayscale they may look similar?).</li>\n<li>We can see that areas of <strong>HIGH-ENZYMATIC ACTIVITY</strong> are stained <strong>BROWN</strong> while areas containing <strong>CARBOHYDRATES</strong> are stained <strong>MAGENTA/RED</strong> </li>\n</ul>\n<p>I'm not 100% sure how to use this information yet… however, we can see similarities across the staining methods as well as noticeable differences.</p>\n<hr>\n<p>Let me know what you think and hope this helps a bit. Please let me know if I need to make any corrections or if you'd like anything added. 😊</p>",
      "rawMarkdown": "I wanted to create a post to improve understanding of the various staining techniques and what they look like. I'd like to ask that if anyone can help me improve this post that they post in the comments and I will do my best to incorporate the feedback.\n\nThis is what we know from the data page:\n\n> ***\"*** *Expect roughly 550 images in the hidden test set. All HPA images are 3000 x 3000 pixels with a tissue area within the image around 2500 x 2500 pixels. The HuBMAP images range in size from 4500x4500 down to 160x160 pixels. HPA samples were stained with antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin. HuBMAP images were prepared using Periodic acid-Schiff (PAS)/hematoxylin and eosin (H&E) stains. All images used have at least one FTU. All tissue data used in this competition is from healthy donors that pathologists identified as pathologically unremarkable tissue.* ***\"***\n\n---\n\n**We summarize the salient details as:**\n\n* Dataset Image Distribution\n    * 351 images in the train dataset\n        * All training images are HPA \n    * ~550 images in test dataset\n        * Public test images are HPA or HuBMAP\n        * Private test images are all HuBMAP\n* Image Sizes By Source\n    * HPA\n        * All images regardless of the respective organ are 3000x3000 pixels *(tissue area of ~2500x2500)*\n        * All images regardless of the respective organ have a tissue slice thickness of 4µm\n        * All images regardless of the respective organ have a pixel size of 0.4µm\n    * HuBMAP\n        * All images regardless are between 4500x4500 to 160x160 pixels (unknown if impacted by the respective organ)\n        * Image tissue slice thickness is dependent upon the respective organ:\n            * 10µm for kidney\n            * 8µm for large intestine\n            * 4µm for spleen\n            * 5µm for lung\n            * 5µm for prostate\n        * Image pixel size is dependent upon the respective organ:\n            * 0.5000µm for kidney\n            * 0.2290µm for large intestine\n            * 0.4945µm for spleen\n            * 0.7562µm for lung\n            * 6.2630µm for prostate  \n* Tissue Staining By Source***\n    * HPA\n         * Antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin\n    * HuBMAP\n         * Prepared using Periodic acid-Schiff (PAS)/hematoxylin OR eosin (H&E) stains (one or the other for a given image... not both --> [**reference answer from host clarifying this here**](https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/333705)\n\n---\n\n<br>\n\nThis discussion is primarily about tissue staining. Let's look at the three types of tissue staining (from 2 data sources) and understand what they look like, stain for, and how we can create a model to understand both.\n\n<br>\n\n---\n\n<br>\n\nLet's begin with the HPA data which is described as ***\"Antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin\"***. Let's break this down term-by-term and then visualize it.\n* **Antibodies [***[reference – livescience.com]***](https://www.livescience.com/antibodies.html)**\n   * Antibodies are specialized, Y-shaped proteins that bind like a lock-and-key to the body's foreign invaders — whether they are viruses(opens in new tab), bacteria, fungi or parasites. They are the \"search\" battalion of the immune system's search-and-destroy system, tasked with finding an enemy and marking it for destruction.\n    * \"They're released from the cell and they go out and hunt,\" said Dr. Warner Greene, the director of the Center for HIV Cure Research at the Gladstone Institutes in San Francisco.\n    * When antibodies find their target, they bind to it, which then triggers a cascade of actions that vanquish the invader. Antibodies are part of the so-called \"adaptive\" immune system, the arm of the immune system that learns to recognize and eliminate specific pathogens, Greene said. \n* **3,3'-diaminobenzidine (DAB) [***[reference – abcam.com]***](https://www.abcam.com/kits/dab-staining)**\n    * DAB (3,3′-Diaminobenzidine) is a derivative of benzene. It is most often used in immunohistochemical (IHC) staining as a chromogen (a substance which can be readily converted into a dye or other coloured compound). It is also used in in-situ hybridization (ISH) and sometimes in dot blots and in western blotting.\n    * In DAB staining, DAB is oxidized by hydrogen peroxide in a reaction typically catalyzed by horseradish peroxidase (HRP). The oxidized DAB forms a **BROWN precipitate**, at the location of the HRP, which can be visualized using light microscopy.\n    * ![dab](https://i.ibb.co/w0khHzm/immunohisto1.png)\n* **Counterstained with Hematoxylin [***[reference – abcam.com]***](https://www.abcam.com/kits/dab-staining)**\n    * Immunohistochemical staining using chromogens often benefits from having a counterstain applied that enhances the contrast and facilitates the observation of histological features. \n    * The most **common type of counterstain** used for FFPE samples is **hematoxylin** that **stains cellular cytoplasm with a **PALE-BLUISH colour**, and **stains cell nuclei in a **DARK-BLUISH nuance**. \n    * *Other counterstaining information removed for brevity/clarity*\n\n<br>\n\n---\n\nLet's put all this together now and spell out what it means. \n\n1. HPA images are stained with **DAB** resulting in a **BROWN** colour near sites of enzymatic activity.\n2. HPA images are also stained (counterstained) with **HEMATOXYLIN** resulting in a LIGHT-BLUE colour in the **CYTOPLASM** (a gelatinous liquid that fills the inside of a cell – so cells are mostly coloured light blue) and **DARK-BLUE** colour in the **CELL NUCLEI** (while the cell is light-blue, the nucleus/nuclei will be dark blue)\n\nHere is an example showing a 400x400x3 pixel crop from the first example in the training dataset:\n\n![dab](https://i.ibb.co/TgWTPBD/tmp.png)\n\n<br>\n\n---\n\n<br>\n\nNext we move to the HuBMAP data which is described as ***\"Prepared using Periodic acid-Schiff (PAS)/hematoxylin and eosin (H&E) stains\"***. Let's break this down term-by-term and then visualize it.\n* **Periodic Acid-Schiff (PAS) Stain [***[reference – laboratorytests.com]***](https://laboratorytests.org/periodic-acid-schiff-pas-stain/)**\n    * The Periodic Acid-Schiff (PAS) Stain is widely used technique in histopathology for the demonstration of carbohydrates and carbohydrate rich compounds in tissues. \n    * PAS stain demonstrates polysaccharides, mucin, glycogen, certain glycoproteins and glycolipids, basement membrane and certain fungus in tissues.\n    * PAS stains result in **MAGENTA to RED** colour for **PAS positive material**\n    * PAS stains result in **BLUE** colour for **cell nuclei**\n    * ~![pas-stain](https://i.ibb.co/9p7sw9X/PAS-staining.jpg)\n* **Hematoxylin and Eosin (H&E) Stains [***[reference – livescience.com]***](https://www.livescience.com/antibodies.html)**\n    * The H&E staining procedure is the principal stain in histology in part because it can be done quickly, is not expensive, and stains tissues in such a way that a considerable amount of microscopic anatomy is revealed, and can be used to diagnose a wide range of histopathologic conditions. \n    * H&E is the combination of two histological stains: **hematoxylin (used in HPA as well)** and eosin. \n    * The **Hematoxylin** stains **cell nuclei a DARK-BLUE**\n    * The **Eosin** stains the **extracellular matrix and cytoplasm PINK**\n    * Other structures take on different shades, hues, and combinations of the previously mentioned colours.\n    * ![he](https://i.ibb.co/31Tyb2F/Retina-high-mag.jpg)\n\n<br>\n\n---\n\nLet's put all this together now and spell out what it means. \n\n1. Some HuBMAP images are stained using **PAS** resulting in a **MAGENTA/RED** colour for **carbohydrate-rich compounds in tissues** (complex sugars) as well as **DARK-BLUE** colour for **CELL NUCLEI**\n2. Some HuBMAP images are stained using **H&E** resulting in a **PINK** colour for the cytoplasm as well as **BLUE** colour for **CELL NUCLEI**\n\n<br>\n\n---\n\n<br><br>\n\nTo wrap it all up:\n* We can see that in general, regardless of imaging type, **CELL NUCELI** are almost always stained **DARK-BLUE**.\n* We can see that cellular **CYTOPLASM** is stained either **PINK** or **LIGHT-BLUE** (These are both high brightness, low contrast colours and if converted to grayscale they may look similar?).\n* We can see that areas of **HIGH-ENZYMATIC ACTIVITY** are stained **BROWN** while areas containing **CARBOHYDRATES** are stained **MAGENTA/RED** \n\nI'm not 100% sure how to use this information yet... however, we can see similarities across the staining methods as well as noticeable differences.\n\n---\n\nLet me know what you think and hope this helps a bit. Please let me know if I need to make any corrections or if you'd like anything added. 😊",
      "votes": null
    },
    {
      "id": "1851783",
      "postDate": "07/11/2022 14:31:40",
      "content": "<p>Thanks for digging into this topic. I think it will be important to play with color transforms in order to simulate those stains.</p>",
      "rawMarkdown": "Thanks for digging into this topic. I think it will be important to play with color transforms in order to simulate those stains.",
      "votes": null
    },
    {
      "id": "1851868",
      "postDate": "07/11/2022 15:34:05",
      "content": "<p>Absolutely. Stain agnostic modelling would be hugely beneficial… not just in this competition but in the industry in general.</p>",
      "rawMarkdown": "Absolutely. Stain agnostic modelling would be hugely beneficial... not just in this competition but in the industry in general.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1851783,
      "author_name": "gunesevitan",
      "author_url": "",
      "post_date": "07/11/2022 14:31:40",
      "content": "<p>Thanks for digging into this topic. I think it will be important to play with color transforms in order to simulate those stains.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1851868,
          "author_name": "dschettler8845",
          "author_url": "",
          "post_date": "07/11/2022 15:34:05",
          "content": "<p>Absolutely. Stain agnostic modelling would be hugely beneficial… not just in this competition but in the industry in general.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1835505": "I wanted to create a post to improve understanding of the various staining techniques and what they look like. I'd like to ask that if anyone can help me improve this post that they post in the comments and I will do my best to incorporate the feedback.\n\nThis is what we know from the data page:\n\n> ***\"*** *Expect roughly 550 images in the hidden test set. All HPA images are 3000 x 3000 pixels with a tissue area within the image around 2500 x 2500 pixels. The HuBMAP images range in size from 4500x4500 down to 160x160 pixels. HPA samples were stained with antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin. HuBMAP images were prepared using Periodic acid-Schiff (PAS)/hematoxylin and eosin (H&E) stains. All images used have at least one FTU. All tissue data used in this competition is from healthy donors that pathologists identified as pathologically unremarkable tissue.* ***\"***\n\n---\n\n**We summarize the salient details as:**\n\n* Dataset Image Distribution\n    * 351 images in the train dataset\n        * All training images are HPA \n    * ~550 images in test dataset\n        * Public test images are HPA or HuBMAP\n        * Private test images are all HuBMAP\n* Image Sizes By Source\n    * HPA\n        * All images regardless of the respective organ are 3000x3000 pixels *(tissue area of ~2500x2500)*\n        * All images regardless of the respective organ have a tissue slice thickness of 4µm\n        * All images regardless of the respective organ have a pixel size of 0.4µm\n    * HuBMAP\n        * All images regardless are between 4500x4500 to 160x160 pixels (unknown if impacted by the respective organ)\n        * Image tissue slice thickness is dependent upon the respective organ:\n            * 10µm for kidney\n            * 8µm for large intestine\n            * 4µm for spleen\n            * 5µm for lung\n            * 5µm for prostate\n        * Image pixel size is dependent upon the respective organ:\n            * 0.5000µm for kidney\n            * 0.2290µm for large intestine\n            * 0.4945µm for spleen\n            * 0.7562µm for lung\n            * 6.2630µm for prostate  \n* Tissue Staining By Source***\n    * HPA\n         * Antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin\n    * HuBMAP\n         * Prepared using Periodic acid-Schiff (PAS)/hematoxylin OR eosin (H&E) stains (one or the other for a given image... not both --> [**reference answer from host clarifying this here**](https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/333705)\n\n---\n\n<br>\n\nThis discussion is primarily about tissue staining. Let's look at the three types of tissue staining (from 2 data sources) and understand what they look like, stain for, and how we can create a model to understand both.\n\n<br>\n\n---\n\n<br>\n\nLet's begin with the HPA data which is described as ***\"Antibodies visualized with 3,3'-diaminobenzidine (DAB) and counterstained with hematoxylin\"***. Let's break this down term-by-term and then visualize it.\n* **Antibodies [***[reference – livescience.com]***](https://www.livescience.com/antibodies.html)**\n   * Antibodies are specialized, Y-shaped proteins that bind like a lock-and-key to the body's foreign invaders — whether they are viruses(opens in new tab), bacteria, fungi or parasites. They are the \"search\" battalion of the immune system's search-and-destroy system, tasked with finding an enemy and marking it for destruction.\n    * \"They're released from the cell and they go out and hunt,\" said Dr. Warner Greene, the director of the Center for HIV Cure Research at the Gladstone Institutes in San Francisco.\n    * When antibodies find their target, they bind to it, which then triggers a cascade of actions that vanquish the invader. Antibodies are part of the so-called \"adaptive\" immune system, the arm of the immune system that learns to recognize and eliminate specific pathogens, Greene said. \n* **3,3'-diaminobenzidine (DAB) [***[reference – abcam.com]***](https://www.abcam.com/kits/dab-staining)**\n    * DAB (3,3′-Diaminobenzidine) is a derivative of benzene. It is most often used in immunohistochemical (IHC) staining as a chromogen (a substance which can be readily converted into a dye or other coloured compound). It is also used in in-situ hybridization (ISH) and sometimes in dot blots and in western blotting.\n    * In DAB staining, DAB is oxidized by hydrogen peroxide in a reaction typically catalyzed by horseradish peroxidase (HRP). The oxidized DAB forms a **BROWN precipitate**, at the location of the HRP, which can be visualized using light microscopy.\n    * ![dab](https://i.ibb.co/w0khHzm/immunohisto1.png)\n* **Counterstained with Hematoxylin [***[reference – abcam.com]***](https://www.abcam.com/kits/dab-staining)**\n    * Immunohistochemical staining using chromogens often benefits from having a counterstain applied that enhances the contrast and facilitates the observation of histological features. \n    * The most **common type of counterstain** used for FFPE samples is **hematoxylin** that **stains cellular cytoplasm with a **PALE-BLUISH colour**, and **stains cell nuclei in a **DARK-BLUISH nuance**. \n    * *Other counterstaining information removed for brevity/clarity*\n\n<br>\n\n---\n\nLet's put all this together now and spell out what it means. \n\n1. HPA images are stained with **DAB** resulting in a **BROWN** colour near sites of enzymatic activity.\n2. HPA images are also stained (counterstained) with **HEMATOXYLIN** resulting in a LIGHT-BLUE colour in the **CYTOPLASM** (a gelatinous liquid that fills the inside of a cell – so cells are mostly coloured light blue) and **DARK-BLUE** colour in the **CELL NUCLEI** (while the cell is light-blue, the nucleus/nuclei will be dark blue)\n\nHere is an example showing a 400x400x3 pixel crop from the first example in the training dataset:\n\n![dab](https://i.ibb.co/TgWTPBD/tmp.png)\n\n<br>\n\n---\n\n<br>\n\nNext we move to the HuBMAP data which is described as ***\"Prepared using Periodic acid-Schiff (PAS)/hematoxylin and eosin (H&E) stains\"***. Let's break this down term-by-term and then visualize it.\n* **Periodic Acid-Schiff (PAS) Stain [***[reference – laboratorytests.com]***](https://laboratorytests.org/periodic-acid-schiff-pas-stain/)**\n    * The Periodic Acid-Schiff (PAS) Stain is widely used technique in histopathology for the demonstration of carbohydrates and carbohydrate rich compounds in tissues. \n    * PAS stain demonstrates polysaccharides, mucin, glycogen, certain glycoproteins and glycolipids, basement membrane and certain fungus in tissues.\n    * PAS stains result in **MAGENTA to RED** colour for **PAS positive material**\n    * PAS stains result in **BLUE** colour for **cell nuclei**\n    * ~![pas-stain](https://i.ibb.co/9p7sw9X/PAS-staining.jpg)\n* **Hematoxylin and Eosin (H&E) Stains [***[reference – livescience.com]***](https://www.livescience.com/antibodies.html)**\n    * The H&E staining procedure is the principal stain in histology in part because it can be done quickly, is not expensive, and stains tissues in such a way that a considerable amount of microscopic anatomy is revealed, and can be used to diagnose a wide range of histopathologic conditions. \n    * H&E is the combination of two histological stains: **hematoxylin (used in HPA as well)** and eosin. \n    * The **Hematoxylin** stains **cell nuclei a DARK-BLUE**\n    * The **Eosin** stains the **extracellular matrix and cytoplasm PINK**\n    * Other structures take on different shades, hues, and combinations of the previously mentioned colours.\n    * ![he](https://i.ibb.co/31Tyb2F/Retina-high-mag.jpg)\n\n<br>\n\n---\n\nLet's put all this together now and spell out what it means. \n\n1. Some HuBMAP images are stained using **PAS** resulting in a **MAGENTA/RED** colour for **carbohydrate-rich compounds in tissues** (complex sugars) as well as **DARK-BLUE** colour for **CELL NUCLEI**\n2. Some HuBMAP images are stained using **H&E** resulting in a **PINK** colour for the cytoplasm as well as **BLUE** colour for **CELL NUCLEI**\n\n<br>\n\n---\n\n<br><br>\n\nTo wrap it all up:\n* We can see that in general, regardless of imaging type, **CELL NUCELI** are almost always stained **DARK-BLUE**.\n* We can see that cellular **CYTOPLASM** is stained either **PINK** or **LIGHT-BLUE** (These are both high brightness, low contrast colours and if converted to grayscale they may look similar?).\n* We can see that areas of **HIGH-ENZYMATIC ACTIVITY** are stained **BROWN** while areas containing **CARBOHYDRATES** are stained **MAGENTA/RED** \n\nI'm not 100% sure how to use this information yet... however, we can see similarities across the staining methods as well as noticeable differences.\n\n---\n\nLet me know what you think and hope this helps a bit. Please let me know if I need to make any corrections or if you'd like anything added. 😊",
    "1851783": "Thanks for digging into this topic. I think it will be important to play with color transforms in order to simulate those stains.",
    "1851868": "Absolutely. Stain agnostic modelling would be hugely beneficial... not just in this competition but in the industry in general."
  },
  "source": "meta"
}