{
  "id": 262470,
  "title": "how to convert DICOM to NIfTI?",
  "url": "/competitions/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/262470",
  "author_name": "",
  "post_date": "2021-08-06T18:42:40.863778400Z",
  "votes": 5,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Can anyone help me with converting multiple dicom files into a single nifti file, step by step?</p>\n<p>every help will be highly appreciated</p>",
  "messages": [
    {
      "id": "1455965",
      "postDate": "08/06/2021 18:42:40",
      "content": "<p>Can anyone help me with converting multiple dicom files into a single nifti file, step by step?</p>\n<p>every help will be highly appreciated</p>",
      "rawMarkdown": "Can anyone help me with converting multiple dicom files into a single nifti file, step by step?\n\nevery help will be highly appreciated",
      "votes": null
    },
    {
      "id": "1458476",
      "postDate": "08/07/2021 22:19:13",
      "content": "<p>Check <a href=\"https://github.com/icometrix/dicom2nifti\" target=\"_blank\">https://github.com/icometrix/dicom2nifti</a>, it is very easy to use, almost plug and play. </p>\n<p>import dicom2nifti</p>\n<p>dicom2nifti.dicom_series_to_nifti(original_dicom_directory, output_file, reorient_nifti=True)</p>",
      "rawMarkdown": "Check https://github.com/icometrix/dicom2nifti, it is very easy to use, almost plug and play. \n\nimport dicom2nifti\n\ndicom2nifti.dicom_series_to_nifti(original_dicom_directory, output_file, reorient_nifti=True)",
      "votes": null
    },
    {
      "id": "1460678",
      "postDate": "08/09/2021 02:57:50",
      "content": "<p>Thanks for your respond</p>\n<p>I tried it, and it worked really easy as you said.</p>\n<p>but when I checked the output shape, it was somehow strange!<br>\nfor example, '<strong>FLAIR</strong>' folder of sample '<strong>00000</strong>' has <strong>400</strong> slices of  <strong>(512px,512px)</strong> images. and I expect to have a Numpy array in shape of <strong>(512,512,400)</strong> as output. but the output shape is <strong>(512,400,512)</strong> and I do not understand the reason. is there any specific reason behind it?</p>\n<p>it gets more weird when I checked the <strong>T1w</strong> folder with 33 slices and the output shape was <strong>(512,512,33)</strong> !!</p>\n<p>Do I have to do something special to have all outputs in the shape of <strong>(width, height, slices)</strong>?</p>",
      "rawMarkdown": "Thanks for your respond\n\nI tried it, and it worked really easy as you said.\n\nbut when I checked the output shape, it was somehow strange!\nfor example, '**FLAIR**' folder of sample '**00000**' has **400** slices of  **(512px,512px)** images. and I expect to have a Numpy array in shape of **(512,512,400)** as output. but the output shape is **(512,400,512)** and I do not understand the reason. is there any specific reason behind it?\n\nit gets more weird when I checked the **T1w** folder with 33 slices and the output shape was **(512,512,33)** !!\n\nDo I have to do something special to have all outputs in the shape of **(width, height, slices)**?",
      "votes": null
    },
    {
      "id": "1461351",
      "postDate": "08/09/2021 11:03:59",
      "content": "<p>Try to use some visualization tool, check <a href=\"https://fsl.fmrib.ox.ac.uk/fsl/fslwiki\" target=\"_blank\">https://fsl.fmrib.ox.ac.uk/fsl/fslwiki</a>. I guess sometimes the highest resolution plane is k and some other times might by j or i. I would always try to do a resampling and co-registration of the 4 modalities before doing anything else. </p>",
      "rawMarkdown": "Try to use some visualization tool, check https://fsl.fmrib.ox.ac.uk/fsl/fslwiki. I guess sometimes the highest resolution plane is k and some other times might by j or i. I would always try to do a resampling and co-registration of the 4 modalities before doing anything else.",
      "votes": null
    },
    {
      "id": "1463941",
      "postDate": "08/10/2021 11:49:36",
      "content": "<p>Its better to use SimpleITK as this is provided by default in Kaggle notebooks</p>",
      "rawMarkdown": "Its better to use SimpleITK as this is provided by default in Kaggle notebooks",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1458476,
      "author_name": "ranafago",
      "author_url": "",
      "post_date": "08/07/2021 22:19:13",
      "content": "<p>Check <a href=\"https://github.com/icometrix/dicom2nifti\" target=\"_blank\">https://github.com/icometrix/dicom2nifti</a>, it is very easy to use, almost plug and play. </p>\n<p>import dicom2nifti</p>\n<p>dicom2nifti.dicom_series_to_nifti(original_dicom_directory, output_file, reorient_nifti=True)</p>",
      "votes": null,
      "replies": [
        {
          "id": 1460678,
          "author_name": "alrzsdgh",
          "author_url": "",
          "post_date": "08/09/2021 02:57:50",
          "content": "<p>Thanks for your respond</p>\n<p>I tried it, and it worked really easy as you said.</p>\n<p>but when I checked the output shape, it was somehow strange!<br>\nfor example, '<strong>FLAIR</strong>' folder of sample '<strong>00000</strong>' has <strong>400</strong> slices of  <strong>(512px,512px)</strong> images. and I expect to have a Numpy array in shape of <strong>(512,512,400)</strong> as output. but the output shape is <strong>(512,400,512)</strong> and I do not understand the reason. is there any specific reason behind it?</p>\n<p>it gets more weird when I checked the <strong>T1w</strong> folder with 33 slices and the output shape was <strong>(512,512,33)</strong> !!</p>\n<p>Do I have to do something special to have all outputs in the shape of <strong>(width, height, slices)</strong>?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1461351,
          "author_name": "ranafago",
          "author_url": "",
          "post_date": "08/09/2021 11:03:59",
          "content": "<p>Try to use some visualization tool, check <a href=\"https://fsl.fmrib.ox.ac.uk/fsl/fslwiki\" target=\"_blank\">https://fsl.fmrib.ox.ac.uk/fsl/fslwiki</a>. I guess sometimes the highest resolution plane is k and some other times might by j or i. I would always try to do a resampling and co-registration of the 4 modalities before doing anything else. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1463941,
      "author_name": "siddharthtandon",
      "author_url": "",
      "post_date": "08/10/2021 11:49:36",
      "content": "<p>Its better to use SimpleITK as this is provided by default in Kaggle notebooks</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1455965": "Can anyone help me with converting multiple dicom files into a single nifti file, step by step?\n\nevery help will be highly appreciated",
    "1458476": "Check https://github.com/icometrix/dicom2nifti, it is very easy to use, almost plug and play. \n\nimport dicom2nifti\n\ndicom2nifti.dicom_series_to_nifti(original_dicom_directory, output_file, reorient_nifti=True)",
    "1460678": "Thanks for your respond\n\nI tried it, and it worked really easy as you said.\n\nbut when I checked the output shape, it was somehow strange!\nfor example, '**FLAIR**' folder of sample '**00000**' has **400** slices of  **(512px,512px)** images. and I expect to have a Numpy array in shape of **(512,512,400)** as output. but the output shape is **(512,400,512)** and I do not understand the reason. is there any specific reason behind it?\n\nit gets more weird when I checked the **T1w** folder with 33 slices and the output shape was **(512,512,33)** !!\n\nDo I have to do something special to have all outputs in the shape of **(width, height, slices)**?",
    "1461351": "Try to use some visualization tool, check https://fsl.fmrib.ox.ac.uk/fsl/fslwiki. I guess sometimes the highest resolution plane is k and some other times might by j or i. I would always try to do a resampling and co-registration of the 4 modalities before doing anything else.",
    "1463941": "Its better to use SimpleITK as this is provided by default in Kaggle notebooks"
  },
  "source": "meta"
}