{
  "id": 109328,
  "title": "Window level and width on CT",
  "url": "/competitions/rsna-intracranial-hemorrhage-detection/discussion/109328",
  "author_name": "Alexandre Cadrin-Chênevert",
  "post_date": "2019-09-18T14:29:05.481000",
  "votes": 40,
  "comment_count": 15,
  "views": 0,
  "content": "<p>To all the great EDA/Visualization kernels contributors, and indirectly to all participants, I recommend some reading about window level and width when using CT data. Intracranial hemorrhages are better visualized with a brain window (level = 40, width = 80) than the default non normalized HU values.</p>\n\n<p>Here are quick summaries of the main concepts:\n<a href=\"https://www.slideshare.net/ganesahyogananthem/ct-numbers-window-width-and-window-level\">https://www.slideshare.net/ganesahyogananthem/ct-numbers-window-width-and-window-level</a>\n<a href=\"https://radiopaedia.org/articles/windowing-ct\">https://radiopaedia.org/articles/windowing-ct</a></p>",
  "messages": [
    {
      "id": 629224,
      "postDate": "2019-09-18T14:29:05.483Z",
      "content": "<p>To all the great EDA/Visualization kernels contributors, and indirectly to all participants, I recommend some reading about window level and width when using CT data. Intracranial hemorrhages are better visualized with a brain window (level = 40, width = 80) than the default non normalized HU values.</p>\n\n<p>Here are quick summaries of the main concepts:\n<a href=\"https://www.slideshare.net/ganesahyogananthem/ct-numbers-window-width-and-window-level\">https://www.slideshare.net/ganesahyogananthem/ct-numbers-window-width-and-window-level</a>\n<a href=\"https://radiopaedia.org/articles/windowing-ct\">https://radiopaedia.org/articles/windowing-ct</a></p>",
      "rawMarkdown": "To all the great EDA/Visualization kernels contributors, and indirectly to all participants, I recommend some reading about window level and width when using CT data. Intracranial hemorrhages are better visualized with a brain window (level = 40, width = 80) than the default non normalized HU values.\n\nHere are quick summaries of the main concepts:\nhttps://www.slideshare.net/ganesahyogananthem/ct-numbers-window-width-and-window-level\nhttps://radiopaedia.org/articles/windowing-ct",
      "votes": 40
    },
    {
      "id": 629582,
      "postDate": "2019-09-18T23:51:35.530Z",
      "content": "<p>I created a public notebook with a simple function for adjusting the window width and level, including values for “brain” and “subdural” windows, here:\n<a href=\"https://www.kaggle.com/wfwiggins203/eda-dicom-tags-windowing-head-cts\">https://www.kaggle.com/wfwiggins203/eda-dicom-tags-windowing-head-cts</a> \nI’ll try to update with more domain knowledge, details and EDA as the week goes on </p>",
      "rawMarkdown": "I created a public notebook with a simple function for adjusting the window width and level, including values for “brain” and “subdural” windows, here:\n[https://www.kaggle.com/wfwiggins203/eda-dicom-tags-windowing-head-cts](https://www.kaggle.com/wfwiggins203/eda-dicom-tags-windowing-head-cts) \nI’ll try to update with more domain knowledge, details and EDA as the week goes on ",
      "votes": 5
    },
    {
      "id": 629856,
      "postDate": "2019-09-19T10:09:37.250Z",
      "content": "<p>In parallel with Walter, I adapted an existing notebook to window the CT images 'correctly', and show windowed images from the different classes of hemorrhage.</p>\n\n<p><a href=\"https://www.kaggle.com/omission/eda-view-dicom-images-with-correct-windowing\">https://www.kaggle.com/omission/eda-view-dicom-images-with-correct-windowing</a></p>\n\n<p>Be careful: the raw values in the Dicom are <em>not</em> in Hounsfield Units: they need to be rescaled first.  All the values needed for rescaling (as well as suggested windows) are contained in the Dicom headers.</p>",
      "rawMarkdown": "In parallel with Walter, I adapted an existing notebook to window the CT images 'correctly', and show windowed images from the different classes of hemorrhage.\n\nhttps://www.kaggle.com/omission/eda-view-dicom-images-with-correct-windowing\n\nBe careful: the raw values in the Dicom are *not* in Hounsfield Units: they need to be rescaled first.  All the values needed for rescaling (as well as suggested windows) are contained in the Dicom headers.",
      "votes": 4,
      "replies": [
        {
          "id": 630261,
          "postDate": "2019-09-20T02:08:04.937Z",
          "content": "<p>Competition rules state we are not allowed to use DICOM metadata. \"Submission predictions must be based entirely on the pixel data in the provided datasets.\"</p>\n\n<p>If you are correct that HU cannot be inferred from pixel values then we have a real problem.</p>",
          "rawMarkdown": "Competition rules state we are not allowed to use DICOM metadata. \"Submission predictions must be based entirely on the pixel data in the provided datasets.\"\n\nIf you are correct that HU cannot be inferred from pixel values then we have a real problem.",
          "votes": 2
        },
        {
          "id": 630266,
          "postDate": "2019-09-20T02:22:52.210Z",
          "content": "<p>That is a good point. My understanding based on various answers from <a href=\"/philculliton\">@philculliton</a> is that we can use the metadata to <strong>preprocess</strong> the pixel data. But we can't directly use the metadata as a model input.</p>",
          "rawMarkdown": "That is a good point. My understanding based on various answers from @philculliton is that we can use the metadata to **preprocess** the pixel data. But we can't directly use the metadata as a model input.",
          "votes": 5
        },
        {
          "id": 630350,
          "postDate": "2019-09-20T05:44:13.107Z",
          "content": "<p>Just in case someone might be as cautious about the rules forbidding direct usage of metadata as I am, I've shared a windowing technique based on pixel data only in <a href=\"https://www.kaggle.com/samusram/discovering-windowing-on-our-own-no-metadata\">the kernel <em>Discovering Windowing (Make Brain Visible)</em></a></p>",
          "rawMarkdown": "Just in case someone might be as cautious about the rules forbidding direct usage of metadata as I am, I've shared a windowing technique based on pixel data only in [the kernel *Discovering Windowing (Make Brain Visible)*](https://www.kaggle.com/samusram/discovering-windowing-on-our-own-no-metadata)",
          "votes": 1
        },
        {
          "id": 630367,
          "postDate": "2019-09-20T06:09:08.263Z",
          "content": "<p>P.S. I've checked 100.000 randomly sampled training images, and <code>RescaleSlope</code> was always equal to 1. I believe, it's reasonable to assume that pixel data are in Hounsfield units, and there's no need of intensity rescaling. </p>",
          "rawMarkdown": "P.S. I've checked 100.000 randomly sampled training images, and `RescaleSlope` was always equal to 1. I believe, it's reasonable to assume that pixel data are in Hounsfield units, and there's no need of intensity rescaling. "
        },
        {
          "id": 630565,
          "postDate": "2019-09-20T12:00:24.453Z",
          "content": "<p>By extension of this logic, you wouldn’t be able to use any other DICOM metadata to help you preprocess the data, including <code>Patient ID</code>, which would be absurd.</p>\n\n<p>I agree with <a href=\"/alexandrecc\">@alexandrecc</a>. I think the intent was to keep people from using DICOM metadata, particularly <code>Patient ID</code>, as input. After all, they explicitly stated that there is <em>intentional overlap between patients included in the Training and Stage 1 Test datasets</em>. Using metadata for predictions would, thus, make it easy to cheat and overfit to specific patients.</p>",
          "rawMarkdown": "By extension of this logic, you wouldn’t be able to use any other DICOM metadata to help you preprocess the data, including `Patient ID`, which would be absurd.\n\nI agree with @alexandrecc. I think the intent was to keep people from using DICOM metadata, particularly `Patient ID`, as input. After all, they explicitly stated that there is _intentional overlap between patients included in the Training and Stage 1 Test datasets_. Using metadata for predictions would, thus, make it easy to cheat and overfit to specific patients.",
          "votes": 1
        }
      ]
    },
    {
      "id": 629632,
      "postDate": "2019-09-19T02:14:14.797Z",
      "content": "<p>It is going to be interesting to see what is the best window for this competition. Although the brain window (level = 40, width = 80) is best for us radiologists, it may make it difficult for the neural network to distinguish blood from calcifications.</p>",
      "rawMarkdown": "It is going to be interesting to see what is the best window for this competition. Although the brain window (level = 40, width = 80) is best for us radiologists, it may make it difficult for the neural network to distinguish blood from calcifications.",
      "votes": 4
    },
    {
      "id": 629356,
      "postDate": "2019-09-18T17:09:45.970Z",
      "content": "<p>Very important concept indeed. I remember seeing a paper that described a way to let the model tune WC and WW as parameters the same way all the weights are corrected via backprop. I have an impression that a simple 1x1 Conv as the first layer would do that. Tell me why I'm wrong.😂 </p>",
      "rawMarkdown": "Very important concept indeed. I remember seeing a paper that described a way to let the model tune WC and WW as parameters the same way all the weights are corrected via backprop. I have an impression that a simple 1x1 Conv as the first layer would do that. Tell me why I'm wrong.😂 ",
      "votes": 1,
      "replies": [
        {
          "id": 629377,
          "postDate": "2019-09-18T17:48:09.130Z",
          "content": "<p>It wasn't really for the modeling side but mostly for the data visualization side. My own radiologist eyes were hurted by all these visualization kernels with non-normalized images simply showing nothing related to hemorrhages!</p>\n\n<p>For model training, I agree it's definitely an unproven benefit since it's the task of backprop to properly balance weights. But the low-level filters are always the hardest to train ... </p>",
          "rawMarkdown": "It wasn't really for the modeling side but mostly for the data visualization side. My own radiologist eyes were hurted by all these visualization kernels with non-normalized images simply showing nothing related to hemorrhages!\n\nFor model training, I agree it's definitely an unproven benefit since it's the task of backprop to properly balance weights. But the low-level filters are always the hardest to train ... \n\n",
          "votes": 8
        },
        {
          "id": 629394,
          "postDate": "2019-09-18T18:17:50.733Z",
          "content": "<p>😂 Ok. Got it. I agree.</p>",
          "rawMarkdown": "😂 Ok. Got it. I agree.",
          "votes": 1
        }
      ]
    },
    {
      "id": 659479,
      "postDate": "2019-10-27T18:34:02.493Z",
      "content": "<p>Thank you for this post. I think setting of the right ct windows is crucial in this task. </p>",
      "rawMarkdown": "Thank you for this post. I think setting of the right ct windows is crucial in this task. "
    },
    {
      "id": 637797,
      "postDate": "2019-10-01T09:07:55.933Z",
      "content": "<p>Thank you for sharing! Do you think it is important to focus on windowing the dicom images, aren't we loosing information that maybe would be important to the CNN? Why not just center the image and maybe find the edge of the brain (its bone)? After, we feed our cnn only the pixels inside that border? </p>",
      "rawMarkdown": "Thank you for sharing! Do you think it is important to focus on windowing the dicom images, aren't we loosing information that maybe would be important to the CNN? Why not just center the image and maybe find the edge of the brain (its bone)? After, we feed our cnn only the pixels inside that border? "
    },
    {
      "id": 629516,
      "postDate": "2019-09-18T21:34:49.067Z",
      "rawMarkdown": "",
      "votes": 2,
      "isDeleted": true,
      "replies": [
        {
          "id": 630207,
          "postDate": "2019-09-19T22:43:01.537Z",
          "rawMarkdown": "",
          "votes": 2,
          "isDeleted": true
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 629582,
      "author_name": "Walter Wiggins",
      "author_url": "",
      "post_date": "2019-09-18T23:51:35.530000",
      "content": "<p>I created a public notebook with a simple function for adjusting the window width and level, including values for “brain” and “subdural” windows, here:\n<a href=\"https://www.kaggle.com/wfwiggins203/eda-dicom-tags-windowing-head-cts\">https://www.kaggle.com/wfwiggins203/eda-dicom-tags-windowing-head-cts</a> \nI’ll try to update with more domain knowledge, details and EDA as the week goes on </p>",
      "votes": 5,
      "replies": []
    },
    {
      "id": 629856,
      "author_name": "Richard McKinley",
      "author_url": "",
      "post_date": "2019-09-19T10:09:37.250000",
      "content": "<p>In parallel with Walter, I adapted an existing notebook to window the CT images 'correctly', and show windowed images from the different classes of hemorrhage.</p>\n\n<p><a href=\"https://www.kaggle.com/omission/eda-view-dicom-images-with-correct-windowing\">https://www.kaggle.com/omission/eda-view-dicom-images-with-correct-windowing</a></p>\n\n<p>Be careful: the raw values in the Dicom are <em>not</em> in Hounsfield Units: they need to be rescaled first.  All the values needed for rescaling (as well as suggested windows) are contained in the Dicom headers.</p>",
      "votes": 4,
      "replies": [
        {
          "id": 630261,
          "author_name": "ldawes",
          "author_url": "",
          "post_date": "2019-09-20T02:08:04.937000",
          "content": "<p>Competition rules state we are not allowed to use DICOM metadata. \"Submission predictions must be based entirely on the pixel data in the provided datasets.\"</p>\n\n<p>If you are correct that HU cannot be inferred from pixel values then we have a real problem.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 630266,
          "author_name": "Alexandre Cadrin-Chênevert",
          "author_url": "",
          "post_date": "2019-09-20T02:22:52.210000",
          "content": "<p>That is a good point. My understanding based on various answers from <a href=\"/philculliton\">@philculliton</a> is that we can use the metadata to <strong>preprocess</strong> the pixel data. But we can't directly use the metadata as a model input.</p>",
          "votes": 5,
          "replies": []
        },
        {
          "id": 630350,
          "author_name": "Raman",
          "author_url": "",
          "post_date": "2019-09-20T05:44:13.107000",
          "content": "<p>Just in case someone might be as cautious about the rules forbidding direct usage of metadata as I am, I've shared a windowing technique based on pixel data only in <a href=\"https://www.kaggle.com/samusram/discovering-windowing-on-our-own-no-metadata\">the kernel <em>Discovering Windowing (Make Brain Visible)</em></a></p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 630367,
          "author_name": "Raman",
          "author_url": "",
          "post_date": "2019-09-20T06:09:08.263000",
          "content": "<p>P.S. I've checked 100.000 randomly sampled training images, and <code>RescaleSlope</code> was always equal to 1. I believe, it's reasonable to assume that pixel data are in Hounsfield units, and there's no need of intensity rescaling. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 630565,
          "author_name": "Walter Wiggins",
          "author_url": "",
          "post_date": "2019-09-20T12:00:24.453000",
          "content": "<p>By extension of this logic, you wouldn’t be able to use any other DICOM metadata to help you preprocess the data, including <code>Patient ID</code>, which would be absurd.</p>\n\n<p>I agree with <a href=\"/alexandrecc\">@alexandrecc</a>. I think the intent was to keep people from using DICOM metadata, particularly <code>Patient ID</code>, as input. After all, they explicitly stated that there is <em>intentional overlap between patients included in the Training and Stage 1 Test datasets</em>. Using metadata for predictions would, thus, make it easy to cheat and overfit to specific patients.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 629632,
      "author_name": "Amil Gentili",
      "author_url": "",
      "post_date": "2019-09-19T02:14:14.797000",
      "content": "<p>It is going to be interesting to see what is the best window for this competition. Although the brain window (level = 40, width = 80) is best for us radiologists, it may make it difficult for the neural network to distinguish blood from calcifications.</p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 629356,
      "author_name": "FelipeKitamura, MD, PhD",
      "author_url": "",
      "post_date": "2019-09-18T17:09:45.970000",
      "content": "<p>Very important concept indeed. I remember seeing a paper that described a way to let the model tune WC and WW as parameters the same way all the weights are corrected via backprop. I have an impression that a simple 1x1 Conv as the first layer would do that. Tell me why I'm wrong.😂 </p>",
      "votes": 1,
      "replies": [
        {
          "id": 629377,
          "author_name": "Alexandre Cadrin-Chênevert",
          "author_url": "",
          "post_date": "2019-09-18T17:48:09.130000",
          "content": "<p>It wasn't really for the modeling side but mostly for the data visualization side. My own radiologist eyes were hurted by all these visualization kernels with non-normalized images simply showing nothing related to hemorrhages!</p>\n\n<p>For model training, I agree it's definitely an unproven benefit since it's the task of backprop to properly balance weights. But the low-level filters are always the hardest to train ... </p>",
          "votes": 8,
          "replies": []
        },
        {
          "id": 629394,
          "author_name": "FelipeKitamura, MD, PhD",
          "author_url": "",
          "post_date": "2019-09-18T18:17:50.733000",
          "content": "<p>😂 Ok. Got it. I agree.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 659479,
      "author_name": "Antonin",
      "author_url": "",
      "post_date": "2019-10-27T18:34:02.493000",
      "content": "<p>Thank you for this post. I think setting of the right ct windows is crucial in this task. </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 637797,
      "author_name": "AmelNozieres",
      "author_url": "",
      "post_date": "2019-10-01T09:07:55.933000",
      "content": "<p>Thank you for sharing! Do you think it is important to focus on windowing the dicom images, aren't we loosing information that maybe would be important to the CNN? Why not just center the image and maybe find the edge of the brain (its bone)? After, we feed our cnn only the pixels inside that border? </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 629516,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-09-18T21:34:49.067000",
      "content": "",
      "votes": 2,
      "replies": [
        {
          "id": 630207,
          "author_name": "",
          "author_url": "",
          "post_date": "2019-09-19T22:43:01.537000",
          "content": "",
          "votes": 2,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "629224": "To all the great EDA/Visualization kernels contributors, and indirectly to all participants, I recommend some reading about window level and width when using CT data. Intracranial hemorrhages are better visualized with a brain window (level = 40, width = 80) than the default non normalized HU values.\n\nHere are quick summaries of the main concepts:\nhttps://www.slideshare.net/ganesahyogananthem/ct-numbers-window-width-and-window-level\nhttps://radiopaedia.org/articles/windowing-ct",
    "629582": "I created a public notebook with a simple function for adjusting the window width and level, including values for “brain” and “subdural” windows, here:\n[https://www.kaggle.com/wfwiggins203/eda-dicom-tags-windowing-head-cts](https://www.kaggle.com/wfwiggins203/eda-dicom-tags-windowing-head-cts) \nI’ll try to update with more domain knowledge, details and EDA as the week goes on ",
    "629856": "In parallel with Walter, I adapted an existing notebook to window the CT images 'correctly', and show windowed images from the different classes of hemorrhage.\n\nhttps://www.kaggle.com/omission/eda-view-dicom-images-with-correct-windowing\n\nBe careful: the raw values in the Dicom are *not* in Hounsfield Units: they need to be rescaled first.  All the values needed for rescaling (as well as suggested windows) are contained in the Dicom headers.",
    "629632": "It is going to be interesting to see what is the best window for this competition. Although the brain window (level = 40, width = 80) is best for us radiologists, it may make it difficult for the neural network to distinguish blood from calcifications.",
    "629356": "Very important concept indeed. I remember seeing a paper that described a way to let the model tune WC and WW as parameters the same way all the weights are corrected via backprop. I have an impression that a simple 1x1 Conv as the first layer would do that. Tell me why I'm wrong.😂 ",
    "659479": "Thank you for this post. I think setting of the right ct windows is crucial in this task. ",
    "637797": "Thank you for sharing! Do you think it is important to focus on windowing the dicom images, aren't we loosing information that maybe would be important to the CNN? Why not just center the image and maybe find the edge of the brain (its bone)? After, we feed our cnn only the pixels inside that border? ",
    "629516": ""
  }
}