{
  "id": 594006,
  "title": "Convert DICOM to NIfTI",
  "url": "/competitions/rsna-intracranial-aneurysm-detection/discussion/594006",
  "author_name": "Ching-Yuan Yu",
  "post_date": "2025-08-01T02:05:29.884000",
  "votes": 3,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Hi, I'm using SimpleITK to convert DICOM files to NIfTI format, but the shape of the resulting volumes doesn't match those in the segmentations folder. Would it be possible to share the preprocessing script or pipeline you used to convert the original DICOMs into the NIfTI files?</p>",
  "messages": [
    {
      "id": 3259159,
      "postDate": "2025-08-01T02:05:29.883Z",
      "content": "<p>Hi, I'm using SimpleITK to convert DICOM files to NIfTI format, but the shape of the resulting volumes doesn't match those in the segmentations folder. Would it be possible to share the preprocessing script or pipeline you used to convert the original DICOMs into the NIfTI files?</p>",
      "rawMarkdown": "Hi, I'm using SimpleITK to convert DICOM files to NIfTI format, but the shape of the resulting volumes doesn't match those in the segmentations folder. Would it be possible to share the preprocessing script or pipeline you used to convert the original DICOMs into the NIfTI files?",
      "votes": 3
    },
    {
      "id": 3265742,
      "postDate": "2025-08-07T22:33:57.567Z",
      "content": "<p>Can you try loading the DICOM images and corresponding NIfTI segmentations in ITK-snap? Alternatively, use existing DICOM to NifTI software like dcm2niix to convert the images and see if the shape matches? If those both work, then it may be an issue with your conversion code. If you provide a snippet someone may be able to help.</p>",
      "rawMarkdown": "Can you try loading the DICOM images and corresponding NIfTI segmentations in ITK-snap? Alternatively, use existing DICOM to NifTI software like dcm2niix to convert the images and see if the shape matches? If those both work, then it may be an issue with your conversion code. If you provide a snippet someone may be able to help.",
      "replies": [
        {
          "id": 3268989,
          "postDate": "2025-08-13T18:18:27.033Z",
          "content": "<p>I used ITK-SNAP to load the DICOM images, and they are 512×512×[slices]. However, some of the NIfTI segmentation files have a shape of 576×768×[slices], so they are not aligned with their corresponding DICOM images.</p>",
          "rawMarkdown": "I used ITK-SNAP to load the DICOM images, and they are 512×512×[slices]. However, some of the NIfTI segmentation files have a shape of 576×768×[slices], so they are not aligned with their corresponding DICOM images.",
          "votes": 1,
          "replies": [
            {
              "id": 3271708,
              "postDate": "2025-08-19T13:30:00.010Z",
              "content": "<p>I'm not sure I understand what you are trying to do. We provided both images and segmentations in NIfTI format. So I don't understand why you need to convert DICOM to NIfTI for the segmentations. </p>\n<p>Also, can you provide an example study ID where you see this issue?</p>",
              "rawMarkdown": "I'm not sure I understand what you are trying to do. We provided both images and segmentations in NIfTI format. So I don't understand why you need to convert DICOM to NIfTI for the segmentations. \n\nAlso, can you provide an example study ID where you see this issue?",
              "votes": 1
            },
            {
              "id": 3272250,
              "postDate": "2025-08-20T15:30:16.970Z",
              "content": "<p>Thank you for your response. To clarify, in our workflow we train a segmentation model and generate pseudo segmentation masks for each case. As part of our sanity check, we compared the NIfTI files we converted from DICOM files against the NIfTI files provided in the challenge data. In doing so, we found that the shapes did not align.</p>\n<p>For example, we observed this mismatch in the following study:</p>\n<p>Study ID: 1.2.826.0.1.3680043.8.498.97256479550884529885940791074752719030</p>",
              "rawMarkdown": "Thank you for your response. To clarify, in our workflow we train a segmentation model and generate pseudo segmentation masks for each case. As part of our sanity check, we compared the NIfTI files we converted from DICOM files against the NIfTI files provided in the challenge data. In doing so, we found that the shapes did not align.\n\nFor example, we observed this mismatch in the following study:\n\nStudy ID: 1.2.826.0.1.3680043.8.498.97256479550884529885940791074752719030",
              "votes": 1
            },
            {
              "id": 3272754,
              "postDate": "2025-08-21T14:39:57.070Z",
              "content": "<p>I see. Thanks for clarifying. That is a bit strange! Can you share the middle slice of your converted NIfTI versus the NIfTI we provided? Are they the same image? Also, what NIfTI conversion method are you using? Thanks!</p>",
              "rawMarkdown": "I see. Thanks for clarifying. That is a bit strange! Can you share the middle slice of your converted NIfTI versus the NIfTI we provided? Are they the same image? Also, what NIfTI conversion method are you using? Thanks!",
              "votes": 1
            },
            {
              "id": 3273467,
              "postDate": "2025-08-22T18:29:02.300Z",
              "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23876186%2F4b90733f253d3c5e21643148c0ac4f72%2Fsnapshot0001.png?generation=1755887019795354&amp;alt=media\" alt=\"\"><br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23876186%2F6ab9d03c6c91f9058d6ec502f80bf35c%2Fsnapshot0002.png?generation=1755887313950027&amp;alt=media\" alt=\"\"><br>\nI visualized both the DICOM and the NIfTI files from the provided case in ITK-SNAP. Compared to the NIfTI file, the DICOM appears to be cropped and has adjusted spacing.</p>",
              "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23876186%2F4b90733f253d3c5e21643148c0ac4f72%2Fsnapshot0001.png?generation=1755887019795354&alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23876186%2F6ab9d03c6c91f9058d6ec502f80bf35c%2Fsnapshot0002.png?generation=1755887313950027&alt=media)\nI visualized both the DICOM and the NIfTI files from the provided case in ITK-SNAP. Compared to the NIfTI file, the DICOM appears to be cropped and has adjusted spacing.",
              "votes": 1
            },
            {
              "id": 3274836,
              "postDate": "2025-08-25T13:55:31.203Z",
              "content": "<p>Very strange… What method are you using for conversion?</p>",
              "rawMarkdown": "Very strange... What method are you using for conversion?"
            }
          ]
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 3265742,
      "author_name": "Evan Calabrese",
      "author_url": "",
      "post_date": "2025-08-07T22:33:57.567000",
      "content": "<p>Can you try loading the DICOM images and corresponding NIfTI segmentations in ITK-snap? Alternatively, use existing DICOM to NifTI software like dcm2niix to convert the images and see if the shape matches? If those both work, then it may be an issue with your conversion code. If you provide a snippet someone may be able to help.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3268989,
          "author_name": "Ching-Yuan Yu",
          "author_url": "",
          "post_date": "2025-08-13T18:18:27.033000",
          "content": "<p>I used ITK-SNAP to load the DICOM images, and they are 512×512×[slices]. However, some of the NIfTI segmentation files have a shape of 576×768×[slices], so they are not aligned with their corresponding DICOM images.</p>",
          "votes": 1,
          "replies": [
            {
              "id": 3271708,
              "author_name": "Evan Calabrese",
              "author_url": "",
              "post_date": "2025-08-19T13:30:00.010000",
              "content": "<p>I'm not sure I understand what you are trying to do. We provided both images and segmentations in NIfTI format. So I don't understand why you need to convert DICOM to NIfTI for the segmentations. </p>\n<p>Also, can you provide an example study ID where you see this issue?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3272250,
              "author_name": "Ching-Yuan Yu",
              "author_url": "",
              "post_date": "2025-08-20T15:30:16.970000",
              "content": "<p>Thank you for your response. To clarify, in our workflow we train a segmentation model and generate pseudo segmentation masks for each case. As part of our sanity check, we compared the NIfTI files we converted from DICOM files against the NIfTI files provided in the challenge data. In doing so, we found that the shapes did not align.</p>\n<p>For example, we observed this mismatch in the following study:</p>\n<p>Study ID: 1.2.826.0.1.3680043.8.498.97256479550884529885940791074752719030</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3272754,
              "author_name": "Evan Calabrese",
              "author_url": "",
              "post_date": "2025-08-21T14:39:57.070000",
              "content": "<p>I see. Thanks for clarifying. That is a bit strange! Can you share the middle slice of your converted NIfTI versus the NIfTI we provided? Are they the same image? Also, what NIfTI conversion method are you using? Thanks!</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3273467,
              "author_name": "Ching-Yuan Yu",
              "author_url": "",
              "post_date": "2025-08-22T18:29:02.300000",
              "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23876186%2F4b90733f253d3c5e21643148c0ac4f72%2Fsnapshot0001.png?generation=1755887019795354&amp;alt=media\" alt=\"\"><br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23876186%2F6ab9d03c6c91f9058d6ec502f80bf35c%2Fsnapshot0002.png?generation=1755887313950027&amp;alt=media\" alt=\"\"><br>\nI visualized both the DICOM and the NIfTI files from the provided case in ITK-SNAP. Compared to the NIfTI file, the DICOM appears to be cropped and has adjusted spacing.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3274836,
              "author_name": "Evan Calabrese",
              "author_url": "",
              "post_date": "2025-08-25T13:55:31.203000",
              "content": "<p>Very strange… What method are you using for conversion?</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3259159": "Hi, I'm using SimpleITK to convert DICOM files to NIfTI format, but the shape of the resulting volumes doesn't match those in the segmentations folder. Would it be possible to share the preprocessing script or pipeline you used to convert the original DICOMs into the NIfTI files?",
    "3265742": "Can you try loading the DICOM images and corresponding NIfTI segmentations in ITK-snap? Alternatively, use existing DICOM to NifTI software like dcm2niix to convert the images and see if the shape matches? If those both work, then it may be an issue with your conversion code. If you provide a snippet someone may be able to help."
  }
}