{
  "id": 185742,
  "title": "PE Training Dataset 512x512 JPEG",
  "url": "/competitions/rsna-str-pulmonary-embolism-detection/discussion/185742",
  "author_name": "Tim Yee",
  "post_date": "2020-09-22T00:20:01.564000",
  "votes": 25,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Making the pre-processed Pulmonary Embolism Training dataset available here. I followed the pre-processing procedure provided by <a href=\"https://www.kaggle.com/vaillant\" target=\"_blank\">@vaillant</a> - <a href=\"https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182930\" target=\"_blank\">original discussion here</a>.</p>\n<p><a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-0\" target=\"_blank\">Fold 0 Batch 0</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-1\" target=\"_blank\">Fold 0 Batch 1</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-2\" target=\"_blank\">Fold 0 Batch 2</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-3\" target=\"_blank\">Fold 0 Batch 3</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-4\" target=\"_blank\">Fold 0 Batch 4</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-5\" target=\"_blank\">Fold 0 Batch 5</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-6\" target=\"_blank\">Fold 0 Batch 6</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-7\" target=\"_blank\">Fold 0 Batch 7</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-8\" target=\"_blank\">Fold 0 Batch 8</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-9\" target=\"_blank\">Fold 0 Batch 9</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-10\" target=\"_blank\">Fold 0 Batch 10</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-11\" target=\"_blank\">Fold 0 Batch 11</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-12\" target=\"_blank\">Fold 0 Batch 12</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-13\" target=\"_blank\">Fold 0 Batch 13</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-14\" target=\"_blank\">Fold 0 Batch 14</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-15\" target=\"_blank\">Fold 0 Batch 15</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-16\" target=\"_blank\">Fold 0 Batch 16</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-17\" target=\"_blank\">Fold 0 Batch 17</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-18\" target=\"_blank\">Fold 0 Batch 18</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-19\" target=\"_blank\">Fold 0 Batch 19</a></p>\n<p><a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-0\" target=\"_blank\">Fold 1 Batch 0</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-1\" target=\"_blank\">Fold 1 Batch 1</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-2\" target=\"_blank\">Fold 1 Batch 2</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-3\" target=\"_blank\">Fold 1 Batch 3</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-4\" target=\"_blank\">Fold 1 Batch 4</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-5\" target=\"_blank\">Fold 1 Batch 5</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-6\" target=\"_blank\">Fold 1 Batch 6</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-7\" target=\"_blank\">Fold 1 Batch 7</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-8\" target=\"_blank\">Fold 1 Batch 8</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-9\" target=\"_blank\">Fold 1 Batch 9</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-10\" target=\"_blank\">Fold 1 Batch 10</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-11\" target=\"_blank\">Fold 1 Batch 11</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-12\" target=\"_blank\">Fold 1 Batch 12</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-13\" target=\"_blank\">Fold 1 Batch 13</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-14\" target=\"_blank\">Fold 1 Batch 14</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-15\" target=\"_blank\">Fold 1 Batch 15</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-16\" target=\"_blank\">Fold 1 Batch 16</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-17\" target=\"_blank\">Fold 1 Batch 17</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-18\" target=\"_blank\">Fold 1 Batch 18</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-19\" target=\"_blank\">Fold 1 Batch 19</a></p>\n<p>Currently, the training data is broken into 2 folds - 20 batches per fold. Each batch contains up to 45K images. Batches 19 for each fold contain slightly less than 45k images.</p>\n<h3>Bonus</h3>\n<p>How to create <a href=\"https://www.kaggle.com/teeyee314/pulmonary-embolism-create-tfrecords\" target=\"_blank\">TFRecords</a> with Pulmonary Embolism data</p>",
  "messages": [
    {
      "id": 1021531,
      "postDate": "2020-09-22T00:20:01.563Z",
      "content": "<p>Making the pre-processed Pulmonary Embolism Training dataset available here. I followed the pre-processing procedure provided by <a href=\"https://www.kaggle.com/vaillant\" target=\"_blank\">@vaillant</a> - <a href=\"https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182930\" target=\"_blank\">original discussion here</a>.</p>\n<p><a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-0\" target=\"_blank\">Fold 0 Batch 0</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-1\" target=\"_blank\">Fold 0 Batch 1</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-2\" target=\"_blank\">Fold 0 Batch 2</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-3\" target=\"_blank\">Fold 0 Batch 3</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-4\" target=\"_blank\">Fold 0 Batch 4</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-5\" target=\"_blank\">Fold 0 Batch 5</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-6\" target=\"_blank\">Fold 0 Batch 6</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-7\" target=\"_blank\">Fold 0 Batch 7</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-8\" target=\"_blank\">Fold 0 Batch 8</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-9\" target=\"_blank\">Fold 0 Batch 9</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-10\" target=\"_blank\">Fold 0 Batch 10</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-11\" target=\"_blank\">Fold 0 Batch 11</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-12\" target=\"_blank\">Fold 0 Batch 12</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-13\" target=\"_blank\">Fold 0 Batch 13</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-14\" target=\"_blank\">Fold 0 Batch 14</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-15\" target=\"_blank\">Fold 0 Batch 15</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-16\" target=\"_blank\">Fold 0 Batch 16</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-17\" target=\"_blank\">Fold 0 Batch 17</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-18\" target=\"_blank\">Fold 0 Batch 18</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-19\" target=\"_blank\">Fold 0 Batch 19</a></p>\n<p><a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-0\" target=\"_blank\">Fold 1 Batch 0</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-1\" target=\"_blank\">Fold 1 Batch 1</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-2\" target=\"_blank\">Fold 1 Batch 2</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-3\" target=\"_blank\">Fold 1 Batch 3</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-4\" target=\"_blank\">Fold 1 Batch 4</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-5\" target=\"_blank\">Fold 1 Batch 5</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-6\" target=\"_blank\">Fold 1 Batch 6</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-7\" target=\"_blank\">Fold 1 Batch 7</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-8\" target=\"_blank\">Fold 1 Batch 8</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-9\" target=\"_blank\">Fold 1 Batch 9</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-10\" target=\"_blank\">Fold 1 Batch 10</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-11\" target=\"_blank\">Fold 1 Batch 11</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-12\" target=\"_blank\">Fold 1 Batch 12</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-13\" target=\"_blank\">Fold 1 Batch 13</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-14\" target=\"_blank\">Fold 1 Batch 14</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-15\" target=\"_blank\">Fold 1 Batch 15</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-16\" target=\"_blank\">Fold 1 Batch 16</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-17\" target=\"_blank\">Fold 1 Batch 17</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-18\" target=\"_blank\">Fold 1 Batch 18</a><br>\n<a href=\"https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-19\" target=\"_blank\">Fold 1 Batch 19</a></p>\n<p>Currently, the training data is broken into 2 folds - 20 batches per fold. Each batch contains up to 45K images. Batches 19 for each fold contain slightly less than 45k images.</p>\n<h3>Bonus</h3>\n<p>How to create <a href=\"https://www.kaggle.com/teeyee314/pulmonary-embolism-create-tfrecords\" target=\"_blank\">TFRecords</a> with Pulmonary Embolism data</p>",
      "rawMarkdown": "Making the pre-processed Pulmonary Embolism Training dataset available here. I followed the pre-processing procedure provided by @vaillant - [original discussion here](https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182930).\n\n[Fold 0 Batch 0](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-0)\n[Fold 0 Batch 1](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-1)\n[Fold 0 Batch 2](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-2)\n[Fold 0 Batch 3](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-3)\n[Fold 0 Batch 4](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-4)\n[Fold 0 Batch 5](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-5)\n[Fold 0 Batch 6](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-6)\n[Fold 0 Batch 7](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-7)\n[Fold 0 Batch 8](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-8)\n[Fold 0 Batch 9](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-9)\n[Fold 0 Batch 10](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-10)\n[Fold 0 Batch 11](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-11)\n[Fold 0 Batch 12](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-12)\n[Fold 0 Batch 13](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-13)\n[Fold 0 Batch 14](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-14)\n[Fold 0 Batch 15](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-15)\n[Fold 0 Batch 16](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-16)\n[Fold 0 Batch 17](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-17)\n[Fold 0 Batch 18](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-18)\n[Fold 0 Batch 19](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-19)\n\n[Fold 1 Batch 0](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-0)\n[Fold 1 Batch 1](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-1)\n[Fold 1 Batch 2](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-2)\n[Fold 1 Batch 3](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-3)\n[Fold 1 Batch 4](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-4)\n[Fold 1 Batch 5](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-5)\n[Fold 1 Batch 6](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-6)\n[Fold 1 Batch 7](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-7)\n[Fold 1 Batch 8](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-8)\n[Fold 1 Batch 9](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-9)\n[Fold 1 Batch 10](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-10)\n[Fold 1 Batch 11](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-11)\n[Fold 1 Batch 12](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-12)\n[Fold 1 Batch 13](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-13)\n[Fold 1 Batch 14](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-14)\n[Fold 1 Batch 15](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-15)\n[Fold 1 Batch 16](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-16)\n[Fold 1 Batch 17](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-17)\n[Fold 1 Batch 18](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-18)\n[Fold 1 Batch 19](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-19)\n\n\nCurrently, the training data is broken into 2 folds - 20 batches per fold. Each batch contains up to 45K images. Batches 19 for each fold contain slightly less than 45k images.\n\n### Bonus\n\nHow to create [TFRecords](https://www.kaggle.com/teeyee314/pulmonary-embolism-create-tfrecords) with Pulmonary Embolism data",
      "votes": 25
    },
    {
      "id": 1031975,
      "postDate": "2020-09-29T20:20:27.790Z",
      "content": "<p><a href=\"https://www.kaggle.com/teeyee314\" target=\"_blank\">@teeyee314</a> thank you for the helpful data.<br>\nIt seems that the images looks blue and channel order is different from original one (created by convert_to_jpeg_for_kaggle.py).<br>\ndid you changed the order?</p>",
      "rawMarkdown": "@teeyee314 thank you for the helpful data.\nIt seems that the images looks blue and channel order is different from original one (created by convert_to_jpeg_for_kaggle.py).\ndid you changed the order?\n",
      "votes": 1,
      "replies": [
        {
          "id": 1032007,
          "postDate": "2020-09-29T21:04:41.473Z",
          "content": "<p>You can just swap the channels using </p>\n<pre><code>img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)\n</code></pre>\n<p>I just follow the channel specification discussed <a href=\"https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182930\" target=\"_blank\">here</a></p>\n<pre><code>Note that these images are single channel. I have provided them in 3-channel RGB format. Each channel is a different window.\n\n- RED channel / LUNG window / level=-600, width=1500\n- GREEN channel / PE window / level=100, width=700\n- BLUE channel / MEDIASTINAL window / level=40, width=400\n\nPlease remember that cv2.imread by default loads images in BGR so if you are using that function make sure you're not confusing the red and blue channels. The PE specific and mediastinal windows will be most useful for evaluating whether there is blood clot. However, the lung window can show abnormalities in the lungs which may be suggestive of a clot, so I included it as well. Feel free to experiment with any single window or combination of windows.\n</code></pre>\n<p>I used the following code:</p>\n<pre><code>def stack_windows(path):\n    img = get_img(path)\n    img_lung = window(img, WL=-600, WW=1500)\n    img_mediastinal = window(img, WL=40, WW=400)\n    img_pe_specific = window(img, WL=100, WW=700)\n    return np.dstack([img_lung, img_pe_specific, img_mediastinal])\n</code></pre>\n<p>whereas Ian used:</p>\n<pre><code>image_lung = np.expand_dims(window(image, WL=-600, WW=1500), axis=3)\nimage_mediastinal = np.expand_dims(window(image, WL=40, WW=400), axis=3)\nimage_pe_specific = np.expand_dims(window(image, WL=100, WW=700), axis=3)\nimage = np.concatenate([image_mediastinal, image_pe_specific, image_lung], axis=3)\n</code></pre>",
          "rawMarkdown": "You can just swap the channels using \n```\nimg = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)\n```\n\nI just follow the channel specification discussed [here](https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182930)\n\n```\nNote that these images are single channel. I have provided them in 3-channel RGB format. Each channel is a different window.\n\n- RED channel / LUNG window / level=-600, width=1500\n- GREEN channel / PE window / level=100, width=700\n- BLUE channel / MEDIASTINAL window / level=40, width=400\n\nPlease remember that cv2.imread by default loads images in BGR so if you are using that function make sure you're not confusing the red and blue channels. The PE specific and mediastinal windows will be most useful for evaluating whether there is blood clot. However, the lung window can show abnormalities in the lungs which may be suggestive of a clot, so I included it as well. Feel free to experiment with any single window or combination of windows.\n```\n\nI used the following code:\n\n```\ndef stack_windows(path):\n    img = get_img(path)\n    img_lung = window(img, WL=-600, WW=1500)\n    img_mediastinal = window(img, WL=40, WW=400)\n    img_pe_specific = window(img, WL=100, WW=700)\n    return np.dstack([img_lung, img_pe_specific, img_mediastinal])\n```\n\nwhereas Ian used:\n\n```\nimage_lung = np.expand_dims(window(image, WL=-600, WW=1500), axis=3)\nimage_mediastinal = np.expand_dims(window(image, WL=40, WW=400), axis=3)\nimage_pe_specific = np.expand_dims(window(image, WL=100, WW=700), axis=3)\nimage = np.concatenate([image_mediastinal, image_pe_specific, image_lung], axis=3)\n```",
          "votes": 1
        },
        {
          "id": 1032923,
          "postDate": "2020-09-30T14:13:23.693Z",
          "content": "<p>Thank you for quick reply. I got it.</p>",
          "rawMarkdown": "Thank you for quick reply. I got it."
        }
      ]
    },
    {
      "id": 1031135,
      "postDate": "2020-09-29T09:06:23.753Z",
      "content": "<p>good job ! good</p>",
      "rawMarkdown": "good job ! good",
      "votes": -5
    },
    {
      "id": 1058095,
      "postDate": "2020-10-23T10:34:26.203Z",
      "content": "<p><a href=\"https://www.kaggle.com/teeyee314\" target=\"_blank\">@teeyee314</a> many thanks for this. Would have take me a week to figure out how to generate this. I wonder if you've tried training with it. I have a memory leak issue when trying to run through the lot. Check out my <a href=\"https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/192786\" target=\"_blank\">kernel</a> describing it. It's not specific to your data of course, but thought you might have faced a similar issue.</p>",
      "rawMarkdown": "@teeyee314 many thanks for this. Would have take me a week to figure out how to generate this. I wonder if you've tried training with it. I have a memory leak issue when trying to run through the lot. Check out my [kernel](https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/192786) describing it. It's not specific to your data of course, but thought you might have faced a similar issue."
    },
    {
      "id": 1054073,
      "postDate": "2020-10-19T16:30:08.280Z",
      "content": "<p>HI  <a href=\"https://www.kaggle.com/teeyee314\" target=\"_blank\">@teeyee314</a> !</p>\n<p>thank you for the  data; will help with the training..</p>\n<p>to confirm the image name of the file is the SOPInstanceUID?  wanted to see how to map each image  to the train csv…</p>",
      "rawMarkdown": "HI  @teeyee314 !\n\nthank you for the  data; will help with the training..\n\nto confirm the image name of the file is the SOPInstanceUID?  wanted to see how to map each image  to the train csv...\n\n"
    },
    {
      "id": 1043312,
      "postDate": "2020-10-08T21:52:13.410Z",
      "content": "<p>Thank you for sharing and additional bonus 👍</p>",
      "rawMarkdown": "Thank you for sharing and additional bonus 👍"
    },
    {
      "id": 1030857,
      "postDate": "2020-09-29T03:52:41.560Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/teeyee314\" target=\"_blank\">@teeyee314</a> ,<br>\nThank you for this data. <br>\nCan you provide some insights on how you are training using these separate datasets..</p>",
      "rawMarkdown": "Hi @teeyee314 ,\nThank you for this data. \nCan you provide some insights on how you are training using these separate datasets..\n\n",
      "replies": [
        {
          "id": 1032009,
          "postDate": "2020-09-29T21:06:23.547Z",
          "content": "<p>I don't haven't gotten a reliable training/inferencing script up yet. I also don't have much time to devote to modeling for this competition anyways.</p>",
          "rawMarkdown": "I don't haven't gotten a reliable training/inferencing script up yet. I also don't have much time to devote to modeling for this competition anyways.",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1031975,
      "author_name": "yama",
      "author_url": "",
      "post_date": "2020-09-29T20:20:27.790000",
      "content": "<p><a href=\"https://www.kaggle.com/teeyee314\" target=\"_blank\">@teeyee314</a> thank you for the helpful data.<br>\nIt seems that the images looks blue and channel order is different from original one (created by convert_to_jpeg_for_kaggle.py).<br>\ndid you changed the order?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1032007,
          "author_name": "Tim Yee",
          "author_url": "",
          "post_date": "2020-09-29T21:04:41.473000",
          "content": "<p>You can just swap the channels using </p>\n<pre><code>img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)\n</code></pre>\n<p>I just follow the channel specification discussed <a href=\"https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182930\" target=\"_blank\">here</a></p>\n<pre><code>Note that these images are single channel. I have provided them in 3-channel RGB format. Each channel is a different window.\n\n- RED channel / LUNG window / level=-600, width=1500\n- GREEN channel / PE window / level=100, width=700\n- BLUE channel / MEDIASTINAL window / level=40, width=400\n\nPlease remember that cv2.imread by default loads images in BGR so if you are using that function make sure you're not confusing the red and blue channels. The PE specific and mediastinal windows will be most useful for evaluating whether there is blood clot. However, the lung window can show abnormalities in the lungs which may be suggestive of a clot, so I included it as well. Feel free to experiment with any single window or combination of windows.\n</code></pre>\n<p>I used the following code:</p>\n<pre><code>def stack_windows(path):\n    img = get_img(path)\n    img_lung = window(img, WL=-600, WW=1500)\n    img_mediastinal = window(img, WL=40, WW=400)\n    img_pe_specific = window(img, WL=100, WW=700)\n    return np.dstack([img_lung, img_pe_specific, img_mediastinal])\n</code></pre>\n<p>whereas Ian used:</p>\n<pre><code>image_lung = np.expand_dims(window(image, WL=-600, WW=1500), axis=3)\nimage_mediastinal = np.expand_dims(window(image, WL=40, WW=400), axis=3)\nimage_pe_specific = np.expand_dims(window(image, WL=100, WW=700), axis=3)\nimage = np.concatenate([image_mediastinal, image_pe_specific, image_lung], axis=3)\n</code></pre>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1032923,
          "author_name": "yama",
          "author_url": "",
          "post_date": "2020-09-30T14:13:23.693000",
          "content": "<p>Thank you for quick reply. I got it.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1031135,
      "author_name": "Naim Mhedhbi",
      "author_url": "",
      "post_date": "2020-09-29T09:06:23.753000",
      "content": "<p>good job ! good</p>",
      "votes": -5,
      "replies": []
    },
    {
      "id": 1058095,
      "author_name": "Alexander Soare",
      "author_url": "",
      "post_date": "2020-10-23T10:34:26.203000",
      "content": "<p><a href=\"https://www.kaggle.com/teeyee314\" target=\"_blank\">@teeyee314</a> many thanks for this. Would have take me a week to figure out how to generate this. I wonder if you've tried training with it. I have a memory leak issue when trying to run through the lot. Check out my <a href=\"https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/192786\" target=\"_blank\">kernel</a> describing it. It's not specific to your data of course, but thought you might have faced a similar issue.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1054073,
      "author_name": "Kamal Das",
      "author_url": "",
      "post_date": "2020-10-19T16:30:08.280000",
      "content": "<p>HI  <a href=\"https://www.kaggle.com/teeyee314\" target=\"_blank\">@teeyee314</a> !</p>\n<p>thank you for the  data; will help with the training..</p>\n<p>to confirm the image name of the file is the SOPInstanceUID?  wanted to see how to map each image  to the train csv…</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1043312,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-10-08T21:52:13.410000",
      "content": "<p>Thank you for sharing and additional bonus 👍</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1030857,
      "author_name": "Nitin Datta",
      "author_url": "",
      "post_date": "2020-09-29T03:52:41.560000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/teeyee314\" target=\"_blank\">@teeyee314</a> ,<br>\nThank you for this data. <br>\nCan you provide some insights on how you are training using these separate datasets..</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1032009,
          "author_name": "Tim Yee",
          "author_url": "",
          "post_date": "2020-09-29T21:06:23.547000",
          "content": "<p>I don't haven't gotten a reliable training/inferencing script up yet. I also don't have much time to devote to modeling for this competition anyways.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1021531": "Making the pre-processed Pulmonary Embolism Training dataset available here. I followed the pre-processing procedure provided by @vaillant - [original discussion here](https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182930).\n\n[Fold 0 Batch 0](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-0)\n[Fold 0 Batch 1](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-1)\n[Fold 0 Batch 2](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-2)\n[Fold 0 Batch 3](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-3)\n[Fold 0 Batch 4](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-4)\n[Fold 0 Batch 5](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-5)\n[Fold 0 Batch 6](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-6)\n[Fold 0 Batch 7](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-7)\n[Fold 0 Batch 8](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-8)\n[Fold 0 Batch 9](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-9)\n[Fold 0 Batch 10](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-10)\n[Fold 0 Batch 11](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-11)\n[Fold 0 Batch 12](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-12)\n[Fold 0 Batch 13](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-13)\n[Fold 0 Batch 14](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-14)\n[Fold 0 Batch 15](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-15)\n[Fold 0 Batch 16](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-16)\n[Fold 0 Batch 17](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-17)\n[Fold 0 Batch 18](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-18)\n[Fold 0 Batch 19](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-0-batch-19)\n\n[Fold 1 Batch 0](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-0)\n[Fold 1 Batch 1](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-1)\n[Fold 1 Batch 2](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-2)\n[Fold 1 Batch 3](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-3)\n[Fold 1 Batch 4](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-4)\n[Fold 1 Batch 5](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-5)\n[Fold 1 Batch 6](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-6)\n[Fold 1 Batch 7](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-7)\n[Fold 1 Batch 8](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-8)\n[Fold 1 Batch 9](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-9)\n[Fold 1 Batch 10](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-10)\n[Fold 1 Batch 11](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-11)\n[Fold 1 Batch 12](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-12)\n[Fold 1 Batch 13](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-13)\n[Fold 1 Batch 14](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-14)\n[Fold 1 Batch 15](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-15)\n[Fold 1 Batch 16](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-16)\n[Fold 1 Batch 17](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-17)\n[Fold 1 Batch 18](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-18)\n[Fold 1 Batch 19](https://www.kaggle.com/teeyee314/pe-train-512x512-fold-1-batch-19)\n\n\nCurrently, the training data is broken into 2 folds - 20 batches per fold. Each batch contains up to 45K images. Batches 19 for each fold contain slightly less than 45k images.\n\n### Bonus\n\nHow to create [TFRecords](https://www.kaggle.com/teeyee314/pulmonary-embolism-create-tfrecords) with Pulmonary Embolism data",
    "1031975": "@teeyee314 thank you for the helpful data.\nIt seems that the images looks blue and channel order is different from original one (created by convert_to_jpeg_for_kaggle.py).\ndid you changed the order?\n",
    "1031135": "good job ! good",
    "1058095": "@teeyee314 many thanks for this. Would have take me a week to figure out how to generate this. I wonder if you've tried training with it. I have a memory leak issue when trying to run through the lot. Check out my [kernel](https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/192786) describing it. It's not specific to your data of course, but thought you might have faced a similar issue.",
    "1054073": "HI  @teeyee314 !\n\nthank you for the  data; will help with the training..\n\nto confirm the image name of the file is the SOPInstanceUID?  wanted to see how to map each image  to the train csv...\n\n",
    "1043312": "Thank you for sharing and additional bonus 👍",
    "1030857": "Hi @teeyee314 ,\nThank you for this data. \nCan you provide some insights on how you are training using these separate datasets..\n\n"
  }
}