{
  "id": 254030,
  "title": "Notebook to export all series planes",
  "url": "/competitions/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/254030",
  "author_name": "David Roberts",
  "post_date": "2021-07-19T20:36:53.070000",
  "votes": 8,
  "comment_count": 13,
  "views": 0,
  "content": "<p>I exported all the series image planes into the train_labels.csv file. I thought others might find it useful. You can add this to your notebook, or just D/L the CSV output and load it.</p>\n<p>I found that none of the series in the dataset are all in the same plane. I see a lot of notebooks that don't take this into consideration .. it seems important to me.</p>\n<p><a href=\"https://www.kaggle.com/davidbroberts/rsna-brain-tumor-image-planes\" target=\"_blank\">https://www.kaggle.com/davidbroberts/rsna-brain-tumor-image-planes</a></p>",
  "messages": [
    {
      "id": 1393717,
      "postDate": "2021-07-19T20:36:53.070Z",
      "content": "<p>I exported all the series image planes into the train_labels.csv file. I thought others might find it useful. You can add this to your notebook, or just D/L the CSV output and load it.</p>\n<p>I found that none of the series in the dataset are all in the same plane. I see a lot of notebooks that don't take this into consideration .. it seems important to me.</p>\n<p><a href=\"https://www.kaggle.com/davidbroberts/rsna-brain-tumor-image-planes\" target=\"_blank\">https://www.kaggle.com/davidbroberts/rsna-brain-tumor-image-planes</a></p>",
      "rawMarkdown": "I exported all the series image planes into the train_labels.csv file. I thought others might find it useful. You can add this to your notebook, or just D/L the CSV output and load it.\n\nI found that none of the series in the dataset are all in the same plane. I see a lot of notebooks that don't take this into consideration .. it seems important to me.\n\nhttps://www.kaggle.com/davidbroberts/rsna-brain-tumor-image-planes",
      "votes": 7
    },
    {
      "id": 1393998,
      "postDate": "2021-07-20T05:12:01.080Z",
      "content": "<p>Perhaps using \"apply_voi_lut\" may improve the detection accuracy. Thanks!</p>",
      "rawMarkdown": "Perhaps using \"apply_voi_lut\" may improve the detection accuracy. Thanks!\n",
      "votes": 1,
      "replies": [
        {
          "id": 1394611,
          "postDate": "2021-07-20T13:14:47.317Z",
          "content": "<p>There aren't any VOI LUTs, or VOI LUT functions in these images. I checked.</p>",
          "rawMarkdown": "There aren't any VOI LUTs, or VOI LUT functions in these images. I checked."
        }
      ]
    },
    {
      "id": 1393776,
      "postDate": "2021-07-19T22:38:26.827Z",
      "content": "<p>When I try to train on the same data with the same conditions, I don't have enough data. Oh boy.</p>",
      "rawMarkdown": "When I try to train on the same data with the same conditions, I don't have enough data. Oh boy.",
      "votes": 1,
      "replies": [
        {
          "id": 1393821,
          "postDate": "2021-07-20T00:07:16.523Z",
          "content": "<p>I thought that too. I'm not sure rotating/flipping is the answer though. Maybe make some width/level adjusted images to beef up the dataset ? </p>\n<p>Like in this notebook -&gt; <a href=\"https://www.kaggle.com/davidbroberts/adjusting-contrast-on-mr-images\" target=\"_blank\">https://www.kaggle.com/davidbroberts/adjusting-contrast-on-mr-images</a></p>",
          "rawMarkdown": "I thought that too. I'm not sure rotating/flipping is the answer though. Maybe make some width/level adjusted images to beef up the dataset ? \n\nLike in this notebook -> https://www.kaggle.com/davidbroberts/adjusting-contrast-on-mr-images",
          "votes": 1
        }
      ]
    },
    {
      "id": 1393736,
      "postDate": "2021-07-19T21:20:48.390Z",
      "content": "<p>Do you think It Is possibile to rotate the Image in order to get the same plane?</p>",
      "rawMarkdown": "Do you think It Is possibile to rotate the Image in order to get the same plane?",
      "votes": 1,
      "replies": [
        {
          "id": 1393772,
          "postDate": "2021-07-19T22:35:39.483Z",
          "content": "<p>It is possible to reform the images, but the quality won't be good when it's done from images that are already reconstructed. It would be reasonable to do multiplanar reformations if we had the raw data these images were created from</p>\n<p>I'm sure someone will (or already has) done it, but the result will be the loss of diagnostic information.</p>",
          "rawMarkdown": "It is possible to reform the images, but the quality won't be good when it's done from images that are already reconstructed. It would be reasonable to do multiplanar reformations if we had the raw data these images were created from\n\nI'm sure someone will (or already has) done it, but the result will be the loss of diagnostic information.",
          "votes": 1
        },
        {
          "id": 1394063,
          "postDate": "2021-07-20T06:34:28.883Z",
          "content": "<p>Thank you very much for the explanation</p>",
          "rawMarkdown": "Thank you very much for the explanation"
        }
      ]
    },
    {
      "id": 1393754,
      "postDate": "2021-07-19T22:06:08.650Z",
      "rawMarkdown": "",
      "votes": 1,
      "isDeleted": true,
      "replies": [
        {
          "id": 1393768,
          "postDate": "2021-07-19T22:30:51.047Z",
          "content": "<p>I'm not sure I understand what you mean. That shows that study 00811 has axial planes in all four series. But, you won't be comparing series to other series in the same study, you'll be comparing series from different studies.</p>\n<p>If you do something like this ..</p>\n<pre><code>df = labels_df.loc[(labels_df['plane_FLAIR'] == 'Axial') \n    &amp; (labels_df['plane_T2w'] == 'Axial') \n    &amp; (labels_df['plane_T1w'] == 'Axial') \n    &amp; (labels_df['plane_T1wCE'] == 'Axial')]\ndf.shape\n</code></pre>\n<p>You can see that only about half (317 of 585) the studies in the dataset have all Axial plane series.</p>",
          "rawMarkdown": "I'm not sure I understand what you mean. That shows that study 00811 has axial planes in all four series. But, you won't be comparing series to other series in the same study, you'll be comparing series from different studies.\n\nIf you do something like this ..\n\n```\ndf = labels_df.loc[(labels_df['plane_FLAIR'] == 'Axial') \n    & (labels_df['plane_T2w'] == 'Axial') \n    & (labels_df['plane_T1w'] == 'Axial') \n    & (labels_df['plane_T1wCE'] == 'Axial')]\ndf.shape\n```\n\nYou can see that only about half (317 of 585) the studies in the dataset have all Axial plane series."
        },
        {
          "id": 1393791,
          "postDate": "2021-07-19T23:03:22.993Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 1393812,
          "postDate": "2021-07-19T23:42:05.580Z",
          "content": "<p>I should have worded that better. What I should have said is .. \"The series planes are not consistent across studies. That is, if you're comparing T1w in study A to T1w in study B .. you may be comparing an Axial image to a Coronal.</p>\n<p>The series all contain the entire anatomy. If you want to turn them into 3D images, it's possible to do from a single series. It will be lossy though.</p>\n<p>You can stack co-planar series together like <a href=\"https://www.kaggle.com/ihelon\" target=\"_blank\">@ihelon</a> did in his awesome notebook -&gt; <a href=\"https://www.kaggle.com/ihelon/brain-tumor-eda-with-animations-and-modeling\" target=\"_blank\">https://www.kaggle.com/ihelon/brain-tumor-eda-with-animations-and-modeling</a></p>\n<p>In fact you can do interesting things with the CE series by inverting its colors and overlaying it onto the non-contrast series of the same plane and segmenting out the vessels. Similar to digital subtraction in angiography.</p>",
          "rawMarkdown": "I should have worded that better. What I should have said is .. \"The series planes are not consistent across studies. That is, if you're comparing T1w in study A to T1w in study B .. you may be comparing an Axial image to a Coronal.\n\nThe series all contain the entire anatomy. If you want to turn them into 3D images, it's possible to do from a single series. It will be lossy though.\n\nYou can stack co-planar series together like @ihelon did in his awesome notebook -> https://www.kaggle.com/ihelon/brain-tumor-eda-with-animations-and-modeling\n\nIn fact you can do interesting things with the CE series by inverting its colors and overlaying it onto the non-contrast series of the same plane and segmenting out the vessels. Similar to digital subtraction in angiography.",
          "votes": 1
        },
        {
          "id": 1393820,
          "postDate": "2021-07-20T00:07:12.740Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 1394969,
          "postDate": "2021-07-20T18:58:02.700Z",
          "content": "<p><a href=\"https://www.kaggle.com/weka511\" target=\"_blank\">@weka511</a>, Based off our discussion, I made a notebook that shows how to display reference lines on MR images. This might help you with reconstruction -&gt; <a href=\"https://www.kaggle.com/davidbroberts/mr-reference-lines\" target=\"_blank\">https://www.kaggle.com/davidbroberts/mr-reference-lines</a></p>",
          "rawMarkdown": "@weka511, Based off our discussion, I made a notebook that shows how to display reference lines on MR images. This might help you with reconstruction -> https://www.kaggle.com/davidbroberts/mr-reference-lines"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1393998,
      "author_name": "relu",
      "author_url": "",
      "post_date": "2021-07-20T05:12:01.080000",
      "content": "<p>Perhaps using \"apply_voi_lut\" may improve the detection accuracy. Thanks!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1394611,
          "author_name": "David Roberts",
          "author_url": "",
          "post_date": "2021-07-20T13:14:47.317000",
          "content": "<p>There aren't any VOI LUTs, or VOI LUT functions in these images. I checked.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1393776,
      "author_name": "relu",
      "author_url": "",
      "post_date": "2021-07-19T22:38:26.827000",
      "content": "<p>When I try to train on the same data with the same conditions, I don't have enough data. Oh boy.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1393821,
          "author_name": "David Roberts",
          "author_url": "",
          "post_date": "2021-07-20T00:07:16.523000",
          "content": "<p>I thought that too. I'm not sure rotating/flipping is the answer though. Maybe make some width/level adjusted images to beef up the dataset ? </p>\n<p>Like in this notebook -&gt; <a href=\"https://www.kaggle.com/davidbroberts/adjusting-contrast-on-mr-images\" target=\"_blank\">https://www.kaggle.com/davidbroberts/adjusting-contrast-on-mr-images</a></p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1393736,
      "author_name": "LucaMTB",
      "author_url": "",
      "post_date": "2021-07-19T21:20:48.390000",
      "content": "<p>Do you think It Is possibile to rotate the Image in order to get the same plane?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1393772,
          "author_name": "David Roberts",
          "author_url": "",
          "post_date": "2021-07-19T22:35:39.483000",
          "content": "<p>It is possible to reform the images, but the quality won't be good when it's done from images that are already reconstructed. It would be reasonable to do multiplanar reformations if we had the raw data these images were created from</p>\n<p>I'm sure someone will (or already has) done it, but the result will be the loss of diagnostic information.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1394063,
          "author_name": "LucaMTB",
          "author_url": "",
          "post_date": "2021-07-20T06:34:28.883000",
          "content": "<p>Thank you very much for the explanation</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1393754,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-07-19T22:06:08.650000",
      "content": "",
      "votes": 1,
      "replies": [
        {
          "id": 1393768,
          "author_name": "David Roberts",
          "author_url": "",
          "post_date": "2021-07-19T22:30:51.047000",
          "content": "<p>I'm not sure I understand what you mean. That shows that study 00811 has axial planes in all four series. But, you won't be comparing series to other series in the same study, you'll be comparing series from different studies.</p>\n<p>If you do something like this ..</p>\n<pre><code>df = labels_df.loc[(labels_df['plane_FLAIR'] == 'Axial') \n    &amp; (labels_df['plane_T2w'] == 'Axial') \n    &amp; (labels_df['plane_T1w'] == 'Axial') \n    &amp; (labels_df['plane_T1wCE'] == 'Axial')]\ndf.shape\n</code></pre>\n<p>You can see that only about half (317 of 585) the studies in the dataset have all Axial plane series.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1393791,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-07-19T23:03:22.993000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1393812,
          "author_name": "David Roberts",
          "author_url": "",
          "post_date": "2021-07-19T23:42:05.580000",
          "content": "<p>I should have worded that better. What I should have said is .. \"The series planes are not consistent across studies. That is, if you're comparing T1w in study A to T1w in study B .. you may be comparing an Axial image to a Coronal.</p>\n<p>The series all contain the entire anatomy. If you want to turn them into 3D images, it's possible to do from a single series. It will be lossy though.</p>\n<p>You can stack co-planar series together like <a href=\"https://www.kaggle.com/ihelon\" target=\"_blank\">@ihelon</a> did in his awesome notebook -&gt; <a href=\"https://www.kaggle.com/ihelon/brain-tumor-eda-with-animations-and-modeling\" target=\"_blank\">https://www.kaggle.com/ihelon/brain-tumor-eda-with-animations-and-modeling</a></p>\n<p>In fact you can do interesting things with the CE series by inverting its colors and overlaying it onto the non-contrast series of the same plane and segmenting out the vessels. Similar to digital subtraction in angiography.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1393820,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-07-20T00:07:12.740000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1394969,
          "author_name": "David Roberts",
          "author_url": "",
          "post_date": "2021-07-20T18:58:02.700000",
          "content": "<p><a href=\"https://www.kaggle.com/weka511\" target=\"_blank\">@weka511</a>, Based off our discussion, I made a notebook that shows how to display reference lines on MR images. This might help you with reconstruction -&gt; <a href=\"https://www.kaggle.com/davidbroberts/mr-reference-lines\" target=\"_blank\">https://www.kaggle.com/davidbroberts/mr-reference-lines</a></p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1393717": "I exported all the series image planes into the train_labels.csv file. I thought others might find it useful. You can add this to your notebook, or just D/L the CSV output and load it.\n\nI found that none of the series in the dataset are all in the same plane. I see a lot of notebooks that don't take this into consideration .. it seems important to me.\n\nhttps://www.kaggle.com/davidbroberts/rsna-brain-tumor-image-planes",
    "1393998": "Perhaps using \"apply_voi_lut\" may improve the detection accuracy. Thanks!\n",
    "1393776": "When I try to train on the same data with the same conditions, I don't have enough data. Oh boy.",
    "1393736": "Do you think It Is possibile to rotate the Image in order to get the same plane?",
    "1393754": ""
  }
}