{
  "id": 593857,
  "title": "Some vessel segmentations are reversed from the image NIfTI",
  "url": "/competitions/rsna-intracranial-aneurysm-detection/discussion/593857",
  "author_name": "Ian Pan",
  "post_date": "2025-07-31T01:27:36.366000",
  "votes": 39,
  "comment_count": 7,
  "views": 0,
  "content": "<p>After reviewing the vessel segmentations, I noticed for some of them, when you load in the .nii file, the segmentations are actually reversed from the images along axis 2.</p>\n<p>For example:</p>\n<pre><code> = nib.load().get_fdata()\n = nib.load().get_fdata()\n\n\n = img[:, :, ::-]\n</code></pre>\n<p>I have attached a list of these series here.</p>",
  "messages": [
    {
      "id": 3258630,
      "postDate": "2025-07-31T01:27:36.367Z",
      "content": "<p>After reviewing the vessel segmentations, I noticed for some of them, when you load in the .nii file, the segmentations are actually reversed from the images along axis 2.</p>\n<p>For example:</p>\n<pre><code> = nib.load().get_fdata()\n = nib.load().get_fdata()\n\n\n = img[:, :, ::-]\n</code></pre>\n<p>I have attached a list of these series here.</p>",
      "rawMarkdown": "After reviewing the vessel segmentations, I noticed for some of them, when you load in the .nii file, the segmentations are actually reversed from the images along axis 2.\n\nFor example:\n```\nimg = nib.load(\"a.nii\").get_fdata()\nseg = nib.load(\"a_cowseg.nii\").get_fdata()\n\n# need to reverse img (or seg) along axis 2\nimg = img[:, :, ::-1]\n```\n\nI have attached a list of these series here.",
      "votes": 38
    },
    {
      "id": 3258932,
      "postDate": "2025-07-31T14:08:13.793Z",
      "content": "<p>We are looking into this and will provide a fix as soon as possible. Should be a straightforward fix, but we will want to test/review to make sure its correct.</p>",
      "rawMarkdown": "We are looking into this and will provide a fix as soon as possible. Should be a straightforward fix, but we will want to test/review to make sure its correct.",
      "votes": 2,
      "replies": [
        {
          "id": 3266238,
          "postDate": "2025-08-08T16:36:52.933Z",
          "content": "<p>Hi Evan, Could you confirm this has been fixed so the current dataset is the final? Thanks in advance.</p>",
          "rawMarkdown": "Hi Evan, Could you confirm this has been fixed so the current dataset is the final? Thanks in advance.",
          "replies": [
            {
              "id": 3266269,
              "postDate": "2025-08-08T17:26:58.757Z",
              "content": "<p>The fix has not been implemented yet, as we are trying to release a single fix for multiple small issues given the complexity of all the data consistency checks required whenever we update the dataset.</p>\n<p>However, using the list and code snippet provided by <a href=\"https://www.kaggle.com/vaillant\" target=\"_blank\">@vaillant</a> you can run the fix on your local copy of the data.</p>",
              "rawMarkdown": "The fix has not been implemented yet, as we are trying to release a single fix for multiple small issues given the complexity of all the data consistency checks required whenever we update the dataset.\n\nHowever, using the list and code snippet provided by @vaillant you can run the fix on your local copy of the data.",
              "votes": 2
            }
          ]
        }
      ]
    },
    {
      "id": 3277585,
      "postDate": "2025-08-28T10:04:22.370Z",
      "content": "<p>To ensure consistent alignment between images and segmentations, you can use MONAI’s Orientationd transform, which standardizes orientation across both files.</p>\n<pre><code>transforms = monai.transforms.Compose([\n    monai.transforms.LoadImaged(\n        keys=[, ], \n        =, \n        =\n    ),\n    monai.transforms.Orientationd(\n        keys=[, ], \n        =  # Reorients  a common RAS orientation\n    ),\n])\n</code></pre>",
      "rawMarkdown": "To ensure consistent alignment between images and segmentations, you can use MONAI’s Orientationd transform, which standardizes orientation across both files.\n```\ntransforms = monai.transforms.Compose([\n    monai.transforms.LoadImaged(\n        keys=[\"img_file\", \"seg_file\"], \n        image_only=True, \n        ensure_channel_first=True\n    ),\n    monai.transforms.Orientationd(\n        keys=[\"img_file\", \"seg_file\"], \n        axcodes=\"RAS\"  # Reorients to a common RAS orientation\n    ),\n])\n```"
    },
    {
      "id": 3261709,
      "postDate": "2025-08-02T03:56:32.253Z",
      "content": "<p>Thank you for your sharing!</p>",
      "rawMarkdown": "Thank you for your sharing!"
    },
    {
      "id": 3259097,
      "postDate": "2025-07-31T21:29:16.577Z",
      "content": "<p>Thank you for your sharing!</p>",
      "rawMarkdown": "Thank you for your sharing!"
    },
    {
      "id": 3258872,
      "postDate": "2025-07-31T11:22:55.077Z",
      "content": "<p>Thank you so much for your findings!</p>",
      "rawMarkdown": "Thank you so much for your findings!"
    }
  ],
  "comments": [
    {
      "id": 3258932,
      "author_name": "Evan Calabrese",
      "author_url": "",
      "post_date": "2025-07-31T14:08:13.793000",
      "content": "<p>We are looking into this and will provide a fix as soon as possible. Should be a straightforward fix, but we will want to test/review to make sure its correct.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 3266238,
          "author_name": "FullEmpty",
          "author_url": "",
          "post_date": "2025-08-08T16:36:52.933000",
          "content": "<p>Hi Evan, Could you confirm this has been fixed so the current dataset is the final? Thanks in advance.</p>",
          "votes": 0,
          "replies": [
            {
              "id": 3266269,
              "author_name": "Evan Calabrese",
              "author_url": "",
              "post_date": "2025-08-08T17:26:58.757000",
              "content": "<p>The fix has not been implemented yet, as we are trying to release a single fix for multiple small issues given the complexity of all the data consistency checks required whenever we update the dataset.</p>\n<p>However, using the list and code snippet provided by <a href=\"https://www.kaggle.com/vaillant\" target=\"_blank\">@vaillant</a> you can run the fix on your local copy of the data.</p>",
              "votes": 2,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3277585,
      "author_name": "Dias Tashev, MD",
      "author_url": "",
      "post_date": "2025-08-28T10:04:22.370000",
      "content": "<p>To ensure consistent alignment between images and segmentations, you can use MONAI’s Orientationd transform, which standardizes orientation across both files.</p>\n<pre><code>transforms = monai.transforms.Compose([\n    monai.transforms.LoadImaged(\n        keys=[, ], \n        =, \n        =\n    ),\n    monai.transforms.Orientationd(\n        keys=[, ], \n        =  # Reorients  a common RAS orientation\n    ),\n])\n</code></pre>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3261709,
      "author_name": "sanjana kumari",
      "author_url": "",
      "post_date": "2025-08-02T03:56:32.253000",
      "content": "<p>Thank you for your sharing!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3259097,
      "author_name": "ABDELHAK OUANZOUGUI",
      "author_url": "",
      "post_date": "2025-07-31T21:29:16.577000",
      "content": "<p>Thank you for your sharing!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3258872,
      "author_name": "Khang Nguyen Le",
      "author_url": "",
      "post_date": "2025-07-31T11:22:55.077000",
      "content": "<p>Thank you so much for your findings!</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3258630": "After reviewing the vessel segmentations, I noticed for some of them, when you load in the .nii file, the segmentations are actually reversed from the images along axis 2.\n\nFor example:\n```\nimg = nib.load(\"a.nii\").get_fdata()\nseg = nib.load(\"a_cowseg.nii\").get_fdata()\n\n# need to reverse img (or seg) along axis 2\nimg = img[:, :, ::-1]\n```\n\nI have attached a list of these series here.",
    "3258932": "We are looking into this and will provide a fix as soon as possible. Should be a straightforward fix, but we will want to test/review to make sure its correct.",
    "3277585": "To ensure consistent alignment between images and segmentations, you can use MONAI’s Orientationd transform, which standardizes orientation across both files.\n```\ntransforms = monai.transforms.Compose([\n    monai.transforms.LoadImaged(\n        keys=[\"img_file\", \"seg_file\"], \n        image_only=True, \n        ensure_channel_first=True\n    ),\n    monai.transforms.Orientationd(\n        keys=[\"img_file\", \"seg_file\"], \n        axcodes=\"RAS\"  # Reorients to a common RAS orientation\n    ),\n])\n```",
    "3261709": "Thank you for your sharing!",
    "3259097": "Thank you for your sharing!",
    "3258872": "Thank you so much for your findings!"
  }
}