{
  "id": 510606,
  "title": "Test Images",
  "url": "/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/510606",
  "author_name": "",
  "post_date": "2024-06-06T20:23:33.455197800Z",
  "votes": 1,
  "comment_count": 5,
  "views": 0,
  "content": "<p>When dealing with a large test set comprising numerous MRI images in a folder, how can one accurately discern between images depicting the right neural foramina versus those illustrating the left neural foramina?</p>",
  "messages": [
    {
      "id": "2859162",
      "postDate": "06/06/2024 20:23:33",
      "content": "<p>When dealing with a large test set comprising numerous MRI images in a folder, how can one accurately discern between images depicting the right neural foramina versus those illustrating the left neural foramina?</p>",
      "rawMarkdown": "When dealing with a large test set comprising numerous MRI images in a folder, how can one accurately discern between images depicting the right neural foramina versus those illustrating the left neural foramina?",
      "votes": null
    },
    {
      "id": "2860680",
      "postDate": "06/07/2024 18:03:22",
      "content": "<p>Spinal cord is always dorsal to the vertebrae. So right is right if vertebra is on top of the cord in the image, right is left otherwise</p>",
      "rawMarkdown": "Spinal cord is always dorsal to the vertebrae. So right is right if vertebra is on top of the cord in the image, right is left otherwise",
      "votes": null
    },
    {
      "id": "2860922",
      "postDate": "06/07/2024 21:26:09",
      "content": "<p>Victor S, how did you make predictions on the dataset since it isn't clear which images we should use for the dataset? Could you provide more information? It would be really helpful.</p>",
      "rawMarkdown": "Victor S, how did you make predictions on the dataset since it isn't clear which images we should use for the dataset? Could you provide more information? It would be really helpful.",
      "votes": null
    },
    {
      "id": "2863142",
      "postDate": "06/09/2024 08:41:33",
      "content": "<p>If your question is, given an axial slice, how do I know which side is left or right, then you can use orientation to find that out.</p>\n<p>As far as I can tell, <code>Axial T2</code> will always be \"RAI\" orientation and the other 2 Sagittal ones will always be in \"ASL\" orientation.</p>\n<p>I will give an example using <code>torchio</code> package:</p>\n<pre><code> pathlib  Path\n\n torchio  tio\n\n\nINPUT_DIR = Path()\ntrain_images_path = INPUT_DIR / \nstudy_id, series_id = ,   \n\nimage_vol = tio.ScalarImage(train_images_path / study_id / series_id)\n\n_, h, w, _ = image_vol.shape\nextra = \nh_l, h_r, w_l, w_r = h// + extra, *h// - extra, w// + extra, *w// - extra\nimage_vol.set_data(image_vol.data[:, h_l: h_r,w_l: w_r])\n\nimage_vol.plot()\n</code></pre>\n<p>The plot created:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1303569%2Fbb95a30d683a6a4ad5459bb9d9f0e4c7%2Ftio_plot.png?generation=1717921508560253&amp;alt=media\"></p>\n<p>You can see here in the axial plane, the <strong>left</strong> side of the image is the right and vice versa. So, RAI volume will be oriented from \"R\" (right to left), \"A\" (anterior[front] to posterior[back]) and \"I\" (inferior[bottom] to superior[top]). </p>",
      "rawMarkdown": "If your question is, given an axial slice, how do I know which side is left or right, then you can use orientation to find that out.\n\nAs far as I can tell, `Axial T2` will always be \"RAI\" orientation and the other 2 Sagittal ones will always be in \"ASL\" orientation.\n\nI will give an example using `torchio` package:\n```python\nfrom pathlib import Path\n\nimport torchio as tio\n\n\nINPUT_DIR = Path(\"../input/rsna-2024-lumbar-spine-degenerative-classification\")\ntrain_images_path = INPUT_DIR / \"train_images\"\nstudy_id, series_id = \"4096820034\", \"2097107888\"  # Axial T2 scan\n\nimage_vol = tio.ScalarImage(train_images_path / study_id / series_id)\n# Zooming in\n_, h, w, _ = image_vol.shape\nextra = 60\nh_l, h_r, w_l, w_r = h//4 + extra, 3*h//4 - extra, w//4 + extra, 3*w//4 - extra\nimage_vol.set_data(image_vol.data[:, h_l: h_r,w_l: w_r])\n# Plot\nimage_vol.plot()\n```\nThe plot created:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1303569%2Fbb95a30d683a6a4ad5459bb9d9f0e4c7%2Ftio_plot.png?generation=1717921508560253&alt=media)\n\nYou can see here in the axial plane, the **left** side of the image is the right and vice versa. So, RAI volume will be oriented from \"R\" (right to left), \"A\" (anterior[front] to posterior[back]) and \"I\" (inferior[bottom] to superior[top]).",
      "votes": null
    },
    {
      "id": "2909752",
      "postDate": "07/07/2024 09:16:59",
      "content": "<p>You have to consider the entire series of images. With a sagittal view, one end of the series corresponds to the left side and the other end of the series corresponds to the right side. So, for foraminal narrowing, one way to tell if it's left or right is to look at the instance number. I'm not sure if the order of the images per series is standardized though.</p>",
      "rawMarkdown": "You have to consider the entire series of images. With a sagittal view, one end of the series corresponds to the left side and the other end of the series corresponds to the right side. So, for foraminal narrowing, one way to tell if it's left or right is to look at the instance number. I'm not sure if the order of the images per series is standardized though.",
      "votes": null
    },
    {
      "id": "2909994",
      "postDate": "07/07/2024 12:44:35",
      "content": "<p>Scratch that. The instance numbers are random. You should look at the metadata of each image instead as explained below by Victor S. :)<br>\n<a href=\"https://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/518525#2909992\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/518525#2909992</a></p>",
      "rawMarkdown": "Scratch that. The instance numbers are random. You should look at the metadata of each image instead as explained below by Victor S. :)\nhttps://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/518525#2909992",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2860680,
      "author_name": "vsahin",
      "author_url": "",
      "post_date": "06/07/2024 18:03:22",
      "content": "<p>Spinal cord is always dorsal to the vertebrae. So right is right if vertebra is on top of the cord in the image, right is left otherwise</p>",
      "votes": null,
      "replies": [
        {
          "id": 2860922,
          "author_name": "theexaltedone",
          "author_url": "",
          "post_date": "06/07/2024 21:26:09",
          "content": "<p>Victor S, how did you make predictions on the dataset since it isn't clear which images we should use for the dataset? Could you provide more information? It would be really helpful.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2863142,
      "author_name": "coderrkj",
      "author_url": "",
      "post_date": "06/09/2024 08:41:33",
      "content": "<p>If your question is, given an axial slice, how do I know which side is left or right, then you can use orientation to find that out.</p>\n<p>As far as I can tell, <code>Axial T2</code> will always be \"RAI\" orientation and the other 2 Sagittal ones will always be in \"ASL\" orientation.</p>\n<p>I will give an example using <code>torchio</code> package:</p>\n<pre><code> pathlib  Path\n\n torchio  tio\n\n\nINPUT_DIR = Path()\ntrain_images_path = INPUT_DIR / \nstudy_id, series_id = ,   \n\nimage_vol = tio.ScalarImage(train_images_path / study_id / series_id)\n\n_, h, w, _ = image_vol.shape\nextra = \nh_l, h_r, w_l, w_r = h// + extra, *h// - extra, w// + extra, *w// - extra\nimage_vol.set_data(image_vol.data[:, h_l: h_r,w_l: w_r])\n\nimage_vol.plot()\n</code></pre>\n<p>The plot created:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1303569%2Fbb95a30d683a6a4ad5459bb9d9f0e4c7%2Ftio_plot.png?generation=1717921508560253&amp;alt=media\"></p>\n<p>You can see here in the axial plane, the <strong>left</strong> side of the image is the right and vice versa. So, RAI volume will be oriented from \"R\" (right to left), \"A\" (anterior[front] to posterior[back]) and \"I\" (inferior[bottom] to superior[top]). </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2909752,
      "author_name": "ikinglopez",
      "author_url": "",
      "post_date": "07/07/2024 09:16:59",
      "content": "<p>You have to consider the entire series of images. With a sagittal view, one end of the series corresponds to the left side and the other end of the series corresponds to the right side. So, for foraminal narrowing, one way to tell if it's left or right is to look at the instance number. I'm not sure if the order of the images per series is standardized though.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2909994,
          "author_name": "ikinglopez",
          "author_url": "",
          "post_date": "07/07/2024 12:44:35",
          "content": "<p>Scratch that. The instance numbers are random. You should look at the metadata of each image instead as explained below by Victor S. :)<br>\n<a href=\"https://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/518525#2909992\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/518525#2909992</a></p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2859162": "When dealing with a large test set comprising numerous MRI images in a folder, how can one accurately discern between images depicting the right neural foramina versus those illustrating the left neural foramina?",
    "2860680": "Spinal cord is always dorsal to the vertebrae. So right is right if vertebra is on top of the cord in the image, right is left otherwise",
    "2860922": "Victor S, how did you make predictions on the dataset since it isn't clear which images we should use for the dataset? Could you provide more information? It would be really helpful.",
    "2863142": "If your question is, given an axial slice, how do I know which side is left or right, then you can use orientation to find that out.\n\nAs far as I can tell, `Axial T2` will always be \"RAI\" orientation and the other 2 Sagittal ones will always be in \"ASL\" orientation.\n\nI will give an example using `torchio` package:\n```python\nfrom pathlib import Path\n\nimport torchio as tio\n\n\nINPUT_DIR = Path(\"../input/rsna-2024-lumbar-spine-degenerative-classification\")\ntrain_images_path = INPUT_DIR / \"train_images\"\nstudy_id, series_id = \"4096820034\", \"2097107888\"  # Axial T2 scan\n\nimage_vol = tio.ScalarImage(train_images_path / study_id / series_id)\n# Zooming in\n_, h, w, _ = image_vol.shape\nextra = 60\nh_l, h_r, w_l, w_r = h//4 + extra, 3*h//4 - extra, w//4 + extra, 3*w//4 - extra\nimage_vol.set_data(image_vol.data[:, h_l: h_r,w_l: w_r])\n# Plot\nimage_vol.plot()\n```\nThe plot created:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1303569%2Fbb95a30d683a6a4ad5459bb9d9f0e4c7%2Ftio_plot.png?generation=1717921508560253&alt=media)\n\nYou can see here in the axial plane, the **left** side of the image is the right and vice versa. So, RAI volume will be oriented from \"R\" (right to left), \"A\" (anterior[front] to posterior[back]) and \"I\" (inferior[bottom] to superior[top]).",
    "2909752": "You have to consider the entire series of images. With a sagittal view, one end of the series corresponds to the left side and the other end of the series corresponds to the right side. So, for foraminal narrowing, one way to tell if it's left or right is to look at the instance number. I'm not sure if the order of the images per series is standardized though.",
    "2909994": "Scratch that. The instance numbers are random. You should look at the metadata of each image instead as explained below by Victor S. :)\nhttps://www.kaggle.com/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/518525#2909992"
  },
  "source": "meta"
}