{
  "id": 382686,
  "title": "Question about image opacity/transparency",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/382686",
  "author_name": "Phil Lee",
  "post_date": "2023-01-31T18:35:52.719000",
  "votes": 2,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Hi, </p>\n<p>I'm afraid I started working on this too late. But I see the images (in the 512x512 png dataset) have quite different transparency. Some images are mostly \"white\", but some are mostly transparent. The view shouldn't be the reason, correct me if I'm wrong.</p>\n<p>I took a sampled look by machine_id, and found that different machines do generate different \"styles\", but some machines do give both types. So, have there been discussion about this?</p>\n<p>Thanks!</p>",
  "messages": [
    {
      "id": 2124036,
      "postDate": "2023-01-31T19:56:46.450Z",
      "content": "<p>Yes you have to invert (or not) them. <br>\nIn many dicom2png implementation you will find this lines of code:</p>\n<pre><code>if photometric_interpretation == 'MONOCHROME1':\n        img = 255 - img\n</code></pre>\n<p>This is way we invert them.</p>",
      "rawMarkdown": "Yes you have to invert (or not) them. \nIn many dicom2png implementation you will find this lines of code:\n\n```\nif photometric_interpretation == 'MONOCHROME1':\n        img = 255 - img\n```\nThis is way we invert them.",
      "votes": 1,
      "replies": [
        {
          "id": 2124097,
          "postDate": "2023-01-31T20:36:27.873Z",
          "content": "<p>Oh, I did see it in a code I'm learning. Thank you!</p>",
          "rawMarkdown": "Oh, I did see it in a code I'm learning. Thank you!",
          "votes": 1
        },
        {
          "id": 2124170,
          "postDate": "2023-01-31T21:20:22.247Z",
          "content": "<p>Sorry, I do have follow up question. I see the public generated image datasets such as this one: <a href=\"https://www.kaggle.com/datasets/theoviel/rsna-breast-cancer-1024-pngs\" target=\"_blank\">https://www.kaggle.com/datasets/theoviel/rsna-breast-cancer-1024-pngs</a></p>\n<p>The author did convert according to photometric_interpretation == 'MONOCHROME1' or not, so all images have a black background -- true. But even though, the transparence of the bodies (breasts) still look quite different. Some are mostly white, and some are the opposite, although all backgrounds are pure black. Why is that?</p>",
          "rawMarkdown": "Sorry, I do have follow up question. I see the public generated image datasets such as this one: https://www.kaggle.com/datasets/theoviel/rsna-breast-cancer-1024-pngs\n\nThe author did convert according to photometric_interpretation == 'MONOCHROME1' or not, so all images have a black background -- true. But even though, the transparence of the bodies (breasts) still look quite different. Some are mostly white, and some are the opposite, although all backgrounds are pure black. Why is that?",
          "replies": [
            {
              "id": 2124206,
              "postDate": "2023-01-31T21:40:54.383Z",
              "content": "<p>Look here: <a href=\"https://www.kaggle.com/code/davidbroberts/mammography-apply-windowing\" target=\"_blank\">https://www.kaggle.com/code/davidbroberts/mammography-apply-windowing</a></p>",
              "rawMarkdown": "Look here: https://www.kaggle.com/code/davidbroberts/mammography-apply-windowing"
            },
            {
              "id": 2124269,
              "postDate": "2023-01-31T22:25:15.977Z",
              "content": "<p>Thanks again!!</p>",
              "rawMarkdown": "Thanks again!!",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2123938,
      "postDate": "2023-01-31T18:35:52.720Z",
      "content": "<p>Hi, </p>\n<p>I'm afraid I started working on this too late. But I see the images (in the 512x512 png dataset) have quite different transparency. Some images are mostly \"white\", but some are mostly transparent. The view shouldn't be the reason, correct me if I'm wrong.</p>\n<p>I took a sampled look by machine_id, and found that different machines do generate different \"styles\", but some machines do give both types. So, have there been discussion about this?</p>\n<p>Thanks!</p>",
      "rawMarkdown": "Hi, \n\nI'm afraid I started working on this too late. But I see the images (in the 512x512 png dataset) have quite different transparency. Some images are mostly \"white\", but some are mostly transparent. The view shouldn't be the reason, correct me if I'm wrong.\n\nI took a sampled look by machine_id, and found that different machines do generate different \"styles\", but some machines do give both types. So, have there been discussion about this?\n\nThanks!",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 2124036,
      "author_name": "Remek Kinas",
      "author_url": "",
      "post_date": "2023-01-31T19:56:46.450000",
      "content": "<p>Yes you have to invert (or not) them. <br>\nIn many dicom2png implementation you will find this lines of code:</p>\n<pre><code>if photometric_interpretation == 'MONOCHROME1':\n        img = 255 - img\n</code></pre>\n<p>This is way we invert them.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2124097,
          "author_name": "Phil Lee",
          "author_url": "",
          "post_date": "2023-01-31T20:36:27.873000",
          "content": "<p>Oh, I did see it in a code I'm learning. Thank you!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2124170,
          "author_name": "Phil Lee",
          "author_url": "",
          "post_date": "2023-01-31T21:20:22.247000",
          "content": "<p>Sorry, I do have follow up question. I see the public generated image datasets such as this one: <a href=\"https://www.kaggle.com/datasets/theoviel/rsna-breast-cancer-1024-pngs\" target=\"_blank\">https://www.kaggle.com/datasets/theoviel/rsna-breast-cancer-1024-pngs</a></p>\n<p>The author did convert according to photometric_interpretation == 'MONOCHROME1' or not, so all images have a black background -- true. But even though, the transparence of the bodies (breasts) still look quite different. Some are mostly white, and some are the opposite, although all backgrounds are pure black. Why is that?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2124206,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-31T21:40:54.383000",
              "content": "<p>Look here: <a href=\"https://www.kaggle.com/code/davidbroberts/mammography-apply-windowing\" target=\"_blank\">https://www.kaggle.com/code/davidbroberts/mammography-apply-windowing</a></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2124269,
              "author_name": "Phil Lee",
              "author_url": "",
              "post_date": "2023-01-31T22:25:15.977000",
              "content": "<p>Thanks again!!</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2124036": "Yes you have to invert (or not) them. \nIn many dicom2png implementation you will find this lines of code:\n\n```\nif photometric_interpretation == 'MONOCHROME1':\n        img = 255 - img\n```\nThis is way we invert them.",
    "2123938": "Hi, \n\nI'm afraid I started working on this too late. But I see the images (in the 512x512 png dataset) have quite different transparency. Some images are mostly \"white\", but some are mostly transparent. The view shouldn't be the reason, correct me if I'm wrong.\n\nI took a sampled look by machine_id, and found that different machines do generate different \"styles\", but some machines do give both types. So, have there been discussion about this?\n\nThanks!"
  }
}