{
  "id": 532060,
  "title": "Why some patients have multiple series per series type?",
  "url": "/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/532060",
  "author_name": "",
  "post_date": "2024-09-04T11:33:12.814139500Z",
  "votes": 7,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I apologize if this question has already been asked.</p>\n<p>I would like to request an official confirmation from the hosts and the Kaggle team.</p>\n<p>In some cases, not small number of patients have more than one series for the same series type (Axial T2 / Sagittal T1 / Sagittal T2/STIR). Why does such data exist?</p>\n<p>Does this include images where the scan failed, or were multiple scans simply taken?</p>\n<p>Additionally, what does STIR represent? Is it different from a standard MRI image?</p>\n<p>The below screen shot shows number of unique series_ids per each (study_id, Description) pair.<br>\nI think at most one series per (study_id, Description) is O.K. to make diagnosis.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4910466%2F9f086aec22b2e7ca51aefd52bb18431e%2FScreenshot%202024-09-04%20at%2020.41.17.png?generation=1725450098487111&amp;alt=media\" alt=\"\"></p>\n<h2>The code to reproduce</h2>\n<pre><code> pathlib  Path\n\n matplotlib.pyplot  plt\n numpy  np\n polars  pl\n pydicom\n tqdm  tqdm\n pandas  pd\n\n\nimage_path = Path(\n    \n)\npart_1 = (image_path.glob())\ndf_meta_f = pl.read_csv(\n    \n)\nid2desc = {\n    (item[], item[]): item[]\n     item  df_meta_f.to_dicts()\n}\nmeta_obj = {\n    (p.stem): {\n        : p.as_posix(),\n        : [(sub.stem)  sub  (p.glob())],\n        : [\n            id2desc.get(((p.stem), (sub.stem)), )  sub  (p.glob())\n        ],\n    }\n     p  part_1\n}\n\nimage_meta = pd.DataFrame(meta_obj).transpose()\nimage_meta.index.name = \nimage_meta = image_meta.explode([, ])\nimage_meta = image_meta.reset_index()\nimage_meta = pl.from_pandas(image_meta)\nimage_meta = image_meta.with_columns(\n    pl.col()\n    .count()\n    .over(, )\n    .alias(),\n)\ndisplay(image_meta[].value_counts().sort())\n</code></pre>",
  "messages": [
    {
      "id": "2978889",
      "postDate": "09/04/2024 11:33:12",
      "content": "<p>I apologize if this question has already been asked.</p>\n<p>I would like to request an official confirmation from the hosts and the Kaggle team.</p>\n<p>In some cases, not small number of patients have more than one series for the same series type (Axial T2 / Sagittal T1 / Sagittal T2/STIR). Why does such data exist?</p>\n<p>Does this include images where the scan failed, or were multiple scans simply taken?</p>\n<p>Additionally, what does STIR represent? Is it different from a standard MRI image?</p>\n<p>The below screen shot shows number of unique series_ids per each (study_id, Description) pair.<br>\nI think at most one series per (study_id, Description) is O.K. to make diagnosis.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4910466%2F9f086aec22b2e7ca51aefd52bb18431e%2FScreenshot%202024-09-04%20at%2020.41.17.png?generation=1725450098487111&amp;alt=media\" alt=\"\"></p>\n<h2>The code to reproduce</h2>\n<pre><code> pathlib  Path\n\n matplotlib.pyplot  plt\n numpy  np\n polars  pl\n pydicom\n tqdm  tqdm\n pandas  pd\n\n\nimage_path = Path(\n    \n)\npart_1 = (image_path.glob())\ndf_meta_f = pl.read_csv(\n    \n)\nid2desc = {\n    (item[], item[]): item[]\n     item  df_meta_f.to_dicts()\n}\nmeta_obj = {\n    (p.stem): {\n        : p.as_posix(),\n        : [(sub.stem)  sub  (p.glob())],\n        : [\n            id2desc.get(((p.stem), (sub.stem)), )  sub  (p.glob())\n        ],\n    }\n     p  part_1\n}\n\nimage_meta = pd.DataFrame(meta_obj).transpose()\nimage_meta.index.name = \nimage_meta = image_meta.explode([, ])\nimage_meta = image_meta.reset_index()\nimage_meta = pl.from_pandas(image_meta)\nimage_meta = image_meta.with_columns(\n    pl.col()\n    .count()\n    .over(, )\n    .alias(),\n)\ndisplay(image_meta[].value_counts().sort())\n</code></pre>",
      "rawMarkdown": "I apologize if this question has already been asked.\n\nI would like to request an official confirmation from the hosts and the Kaggle team.\n\nIn some cases, not small number of patients have more than one series for the same series type (Axial T2 / Sagittal T1 / Sagittal T2/STIR). Why does such data exist?\n\nDoes this include images where the scan failed, or were multiple scans simply taken?\n\nAdditionally, what does STIR represent? Is it different from a standard MRI image?\n\nThe below screen shot shows number of unique series_ids per each (study_id, Description) pair.\nI think at most one series per (study_id, Description) is O.K. to make diagnosis.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4910466%2F9f086aec22b2e7ca51aefd52bb18431e%2FScreenshot%202024-09-04%20at%2020.41.17.png?generation=1725450098487111&alt=media)\n\n\n## The code to reproduce\n\n```python\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport polars as pl\nimport pydicom\nfrom tqdm import tqdm\nimport pandas as pd\n\n\nimage_path = Path(\n    \"/kaggle/input/rsna-2024-lumbar-spine-degenerative-classification/train_images\"\n)\npart_1 = list(image_path.glob(\"*\"))\ndf_meta_f = pl.read_csv(\n    \"/kaggle/input/rsna-2024-lumbar-spine-degenerative-classification/train_series_descriptions.csv\"\n)\nid2desc = {\n    (item[\"study_id\"], item[\"series_id\"]): item[\"series_description\"]\n    for item in df_meta_f.to_dicts()\n}\nmeta_obj = {\n    int(p.stem): {\n        \"folder_path\": p.as_posix(),\n        \"SeriesInstanceUIDs\": [int(sub.stem) for sub in sorted(p.glob(\"*\"))],\n        \"SeriesDescriptions\": [\n            id2desc.get((int(p.stem), int(sub.stem)), \"N/A\") for sub in sorted(p.glob(\"*\"))\n        ],\n    }\n    for p in part_1\n}\n\nimage_meta = pd.DataFrame(meta_obj).transpose()\nimage_meta.index.name = \"study_id\"\nimage_meta = image_meta.explode([\"SeriesInstanceUIDs\", \"SeriesDescriptions\"])\nimage_meta = image_meta.reset_index()\nimage_meta = pl.from_pandas(image_meta)\nimage_meta = image_meta.with_columns(\n    pl.col(\"SeriesDescriptions\")\n    .count()\n    .over(\"study_id\", \"SeriesDescriptions\")\n    .alias(\"number_of_takes\"),\n)\ndisplay(image_meta[\"num_series\"].value_counts().sort(\"num_series\"))\n```",
      "votes": null
    },
    {
      "id": "2978908",
      "postDate": "09/04/2024 11:53:25",
      "content": "<p>multiple takes seems to only occurred to \"Axial T2\" and \"Sagittal T1\".</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4910466%2F75889a11441bea3374c837e5980fa965%2FScreenshot%202024-09-04%20at%2020.51.48.png?generation=1725450720483865&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "multiple takes seems to only occurred to \"Axial T2\" and \"Sagittal T1\".\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4910466%2F75889a11441bea3374c837e5980fa965%2FScreenshot%202024-09-04%20at%2020.51.48.png?generation=1725450720483865&alt=media)",
      "votes": null
    },
    {
      "id": "2980146",
      "postDate": "09/05/2024 14:22:08",
      "content": "<p>There are probably multiple reasons. I actually checked visually, and found that:</p>\n<ul>\n<li>The imaging was redone (for example, when motion artifacts appeared in one of the images, necessitating a retake). See the attached figure. The title indicates the level, the condition from coordinates.csv, and the series. The images in the left column have motion artifacts.</li>\n<li>The levels are different. In some cases, the upper and lower levels were separated into different series.</li>\n</ul>\n<p>This is based on observing only a few examples, so it's just for reference, but at least these reasons seem to exist.<br>\nAlso, STIR is fundamentally a technique for fat suppression, and I believe it's used because it makes the edematous changes associated with spinal degeneration more distinct.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2593251%2F3305053a30203181c0d2b5d32f249b32%2Fimage.png?generation=1725545913011907&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "There are probably multiple reasons. I actually checked visually, and found that:\n\n- The imaging was redone (for example, when motion artifacts appeared in one of the images, necessitating a retake). See the attached figure. The title indicates the level, the condition from coordinates.csv, and the series. The images in the left column have motion artifacts.\n- The levels are different. In some cases, the upper and lower levels were separated into different series.\n\nThis is based on observing only a few examples, so it's just for reference, but at least these reasons seem to exist.\nAlso, STIR is fundamentally a technique for fat suppression, and I believe it's used because it makes the edematous changes associated with spinal degeneration more distinct.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2593251%2F3305053a30203181c0d2b5d32f249b32%2Fimage.png?generation=1725545913011907&alt=media)",
      "votes": null
    },
    {
      "id": "2990523",
      "postDate": "09/16/2024 13:11:59",
      "content": "<p>Here is one examples of multiple axial T2 images.<br>\nThe left image appears to capture the <strong>upper part</strong>, while the right image seems to capture the <strong>lower part</strong>. In other words, the axial T2 images for a patient were probably taken in two separate sessions.</p>\n<p>However, I've found that <strong>not every case with more than two axial T2 images fits this pattern</strong>.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5850745%2F56b37631cf8749ee3f3b61a46e81bcf0%2Fmulti_axial_t2_viz.jpg?generation=1726491424983434&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Here is one examples of multiple axial T2 images.\nThe left image appears to capture the **upper part**, while the right image seems to capture the **lower part**. In other words, the axial T2 images for a patient were probably taken in two separate sessions.\n\nHowever, I've found that **not every case with more than two axial T2 images fits this pattern**.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5850745%2F56b37631cf8749ee3f3b61a46e81bcf0%2Fmulti_axial_t2_viz.jpg?generation=1726491424983434&alt=media)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2978908,
      "author_name": "tatamikenn",
      "author_url": "",
      "post_date": "09/04/2024 11:53:25",
      "content": "<p>multiple takes seems to only occurred to \"Axial T2\" and \"Sagittal T1\".</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4910466%2F75889a11441bea3374c837e5980fa965%2FScreenshot%202024-09-04%20at%2020.51.48.png?generation=1725450720483865&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2980146,
      "author_name": "yosukeyama",
      "author_url": "",
      "post_date": "09/05/2024 14:22:08",
      "content": "<p>There are probably multiple reasons. I actually checked visually, and found that:</p>\n<ul>\n<li>The imaging was redone (for example, when motion artifacts appeared in one of the images, necessitating a retake). See the attached figure. The title indicates the level, the condition from coordinates.csv, and the series. The images in the left column have motion artifacts.</li>\n<li>The levels are different. In some cases, the upper and lower levels were separated into different series.</li>\n</ul>\n<p>This is based on observing only a few examples, so it's just for reference, but at least these reasons seem to exist.<br>\nAlso, STIR is fundamentally a technique for fat suppression, and I believe it's used because it makes the edematous changes associated with spinal degeneration more distinct.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2593251%2F3305053a30203181c0d2b5d32f249b32%2Fimage.png?generation=1725545913011907&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2990523,
      "author_name": "tanakatentyo",
      "author_url": "",
      "post_date": "09/16/2024 13:11:59",
      "content": "<p>Here is one examples of multiple axial T2 images.<br>\nThe left image appears to capture the <strong>upper part</strong>, while the right image seems to capture the <strong>lower part</strong>. In other words, the axial T2 images for a patient were probably taken in two separate sessions.</p>\n<p>However, I've found that <strong>not every case with more than two axial T2 images fits this pattern</strong>.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5850745%2F56b37631cf8749ee3f3b61a46e81bcf0%2Fmulti_axial_t2_viz.jpg?generation=1726491424983434&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2978889": "I apologize if this question has already been asked.\n\nI would like to request an official confirmation from the hosts and the Kaggle team.\n\nIn some cases, not small number of patients have more than one series for the same series type (Axial T2 / Sagittal T1 / Sagittal T2/STIR). Why does such data exist?\n\nDoes this include images where the scan failed, or were multiple scans simply taken?\n\nAdditionally, what does STIR represent? Is it different from a standard MRI image?\n\nThe below screen shot shows number of unique series_ids per each (study_id, Description) pair.\nI think at most one series per (study_id, Description) is O.K. to make diagnosis.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4910466%2F9f086aec22b2e7ca51aefd52bb18431e%2FScreenshot%202024-09-04%20at%2020.41.17.png?generation=1725450098487111&alt=media)\n\n\n## The code to reproduce\n\n```python\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport polars as pl\nimport pydicom\nfrom tqdm import tqdm\nimport pandas as pd\n\n\nimage_path = Path(\n    \"/kaggle/input/rsna-2024-lumbar-spine-degenerative-classification/train_images\"\n)\npart_1 = list(image_path.glob(\"*\"))\ndf_meta_f = pl.read_csv(\n    \"/kaggle/input/rsna-2024-lumbar-spine-degenerative-classification/train_series_descriptions.csv\"\n)\nid2desc = {\n    (item[\"study_id\"], item[\"series_id\"]): item[\"series_description\"]\n    for item in df_meta_f.to_dicts()\n}\nmeta_obj = {\n    int(p.stem): {\n        \"folder_path\": p.as_posix(),\n        \"SeriesInstanceUIDs\": [int(sub.stem) for sub in sorted(p.glob(\"*\"))],\n        \"SeriesDescriptions\": [\n            id2desc.get((int(p.stem), int(sub.stem)), \"N/A\") for sub in sorted(p.glob(\"*\"))\n        ],\n    }\n    for p in part_1\n}\n\nimage_meta = pd.DataFrame(meta_obj).transpose()\nimage_meta.index.name = \"study_id\"\nimage_meta = image_meta.explode([\"SeriesInstanceUIDs\", \"SeriesDescriptions\"])\nimage_meta = image_meta.reset_index()\nimage_meta = pl.from_pandas(image_meta)\nimage_meta = image_meta.with_columns(\n    pl.col(\"SeriesDescriptions\")\n    .count()\n    .over(\"study_id\", \"SeriesDescriptions\")\n    .alias(\"number_of_takes\"),\n)\ndisplay(image_meta[\"num_series\"].value_counts().sort(\"num_series\"))\n```",
    "2978908": "multiple takes seems to only occurred to \"Axial T2\" and \"Sagittal T1\".\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4910466%2F75889a11441bea3374c837e5980fa965%2FScreenshot%202024-09-04%20at%2020.51.48.png?generation=1725450720483865&alt=media)",
    "2980146": "There are probably multiple reasons. I actually checked visually, and found that:\n\n- The imaging was redone (for example, when motion artifacts appeared in one of the images, necessitating a retake). See the attached figure. The title indicates the level, the condition from coordinates.csv, and the series. The images in the left column have motion artifacts.\n- The levels are different. In some cases, the upper and lower levels were separated into different series.\n\nThis is based on observing only a few examples, so it's just for reference, but at least these reasons seem to exist.\nAlso, STIR is fundamentally a technique for fat suppression, and I believe it's used because it makes the edematous changes associated with spinal degeneration more distinct.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2593251%2F3305053a30203181c0d2b5d32f249b32%2Fimage.png?generation=1725545913011907&alt=media)",
    "2990523": "Here is one examples of multiple axial T2 images.\nThe left image appears to capture the **upper part**, while the right image seems to capture the **lower part**. In other words, the axial T2 images for a patient were probably taken in two separate sessions.\n\nHowever, I've found that **not every case with more than two axial T2 images fits this pattern**.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5850745%2F56b37631cf8749ee3f3b61a46e81bcf0%2Fmulti_axial_t2_viz.jpg?generation=1726491424983434&alt=media)"
  },
  "source": "meta"
}