{
  "id": 182172,
  "title": "Missing required dependencies: GDCM ",
  "url": "/competitions/rsna-str-pulmonary-embolism-detection/discussion/182172",
  "author_name": "TOUCAN",
  "post_date": "2020-09-11T14:40:05.960000",
  "votes": 4,
  "comment_count": 8,
  "views": 0,
  "content": "<p>Hello, </p>\n<p>I am getting the following error when I try to access the pixel array of DICOM: RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM)<br>\nSomeone can help ?<br>\nThanks</p>",
  "messages": [
    {
      "id": 1006769,
      "postDate": "2020-09-11T14:40:05.960Z",
      "content": "<p>Hello, </p>\n<p>I am getting the following error when I try to access the pixel array of DICOM: RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM)<br>\nSomeone can help ?<br>\nThanks</p>",
      "rawMarkdown": "Hello, \n\nI am getting the following error when I try to access the pixel array of DICOM: RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM)\nSomeone can help ?\nThanks",
      "votes": 3
    },
    {
      "id": 1009125,
      "postDate": "2020-09-13T17:06:10.560Z",
      "content": "<p>From my experience, what is found is that previously I used to do the code like </p>\n<p>**Old Method😓😓: </p>\n<pre><code>import pydicom as dcm\n\nscan = dcm.dcmread(filepath)\nimg = scan.pixel_array\n</code></pre>\n<p>which oftentimes caused that error. Later I modified the code in the following way:</p>\n<p>**New Method🤓🤓: </p>\n<pre><code>import pydicom\n\nscan = pycdicom.read_file(filepath)\nimg = scan.pixel_array\n</code></pre>\n<p>The old method was not that reliable. It sometimes ran properly sometimes not. But the new method never failed me… </p>",
      "rawMarkdown": "From my experience, what is found is that previously I used to do the code like \n\n**Old Method😓😓: \n```\nimport pydicom as dcm\n\nscan = dcm.dcmread(filepath)\nimg = scan.pixel_array\n```\nwhich oftentimes caused that error. Later I modified the code in the following way:\n\n**New Method🤓🤓: \n```\nimport pydicom\n\nscan = pycdicom.read_file(filepath)\nimg = scan.pixel_array\n```\n\nThe old method was not that reliable. It sometimes ran properly sometimes not. But the new method never failed me... ",
      "votes": 2
    },
    {
      "id": 1007636,
      "postDate": "2020-09-12T10:53:28.493Z",
      "content": "<p>Unfortunately, if you're training on windows, even the <code>conda</code> version of <code>gdcm</code> does not work with python 3.7 or 3.8, so you'll need a python 3.6 environment if you want to use <code>conda install -c conda-forge gdcm</code></p>",
      "rawMarkdown": "Unfortunately, if you're training on windows, even the `conda` version of `gdcm` does not work with python 3.7 or 3.8, so you'll need a python 3.6 environment if you want to use `conda install -c conda-forge gdcm`",
      "votes": 2
    },
    {
      "id": 1009614,
      "postDate": "2020-09-14T06:14:55.067Z",
      "content": "<p>I had the same problem previously and raised a <a href=\"https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182144\" target=\"_blank\">topic</a> for it. And my solution was the same <code>conda</code> line to install. However, I decided to switch to <code>vtk</code> which was featured <a href=\"https://www.kaggle.com/eladwar/20-seconds-or-less\" target=\"_blank\">here</a>. I found this on the other similar <a href=\"https://www.kaggle.com/c/osic-pulmonary-fibrosis-progression/discussion\" target=\"_blank\">competition</a> that had files in DICOM too.</p>\n<p>As far as I tested, <code>vtk</code> has yet to raise a single exception when handling DICOM files.</p>\n<p>If you want to see how to use it, go to my notebook <a href=\"https://www.kaggle.com/seraphwedd18/pe-detection-with-keras-model-creation#Check-Targets-and-Input-Image\" target=\"_blank\">here</a>.</p>\n<p>Hope this helps.</p>",
      "rawMarkdown": "I had the same problem previously and raised a [topic](https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182144) for it. And my solution was the same `conda` line to install. However, I decided to switch to `vtk` which was featured [here](https://www.kaggle.com/eladwar/20-seconds-or-less). I found this on the other similar [competition](https://www.kaggle.com/c/osic-pulmonary-fibrosis-progression/discussion) that had files in DICOM too.\n\nAs far as I tested, `vtk` has yet to raise a single exception when handling DICOM files.\n\nIf you want to see how to use it, go to my notebook [here](https://www.kaggle.com/seraphwedd18/pe-detection-with-keras-model-creation#Check-Targets-and-Input-Image).\n\nHope this helps."
    },
    {
      "id": 1009424,
      "postDate": "2020-09-14T02:17:28.943Z",
      "content": "<p>None of the proposed fixes have solved the problem for me in Kaggle Notebooks, though it only occurred in 2/12 cases for me (see <a href=\"https://www.kaggle.com/wfwiggins203/exploring-the-dicom-metadata-images-with-fast-ai\" target=\"_blank\">here</a>). I've yet to try it on another platform.</p>",
      "rawMarkdown": "None of the proposed fixes have solved the problem for me in Kaggle Notebooks, though it only occurred in 2/12 cases for me (see [here](https://www.kaggle.com/wfwiggins203/exploring-the-dicom-metadata-images-with-fast-ai)). I've yet to try it on another platform."
    },
    {
      "id": 1006815,
      "postDate": "2020-09-11T15:11:46.580Z",
      "content": "<p>I had the same error, running it multiple times will solve the issue</p>",
      "rawMarkdown": "I had the same error, running it multiple times will solve the issue",
      "replies": [
        {
          "id": 1006926,
          "postDate": "2020-09-11T16:44:58.473Z",
          "content": "<p>Hello Alaa,<br>\nI solved the problem ! The solution is to put <code>!conda install -c conda-forge gdcm -y</code> at the beginning of your notebook. <br>\nGood luck</p>",
          "rawMarkdown": "Hello Alaa,\nI solved the problem ! The solution is to put `!conda install -c conda-forge gdcm -y` at the beginning of your notebook. \nGood luck\n",
          "votes": 2
        },
        {
          "id": 1006927,
          "postDate": "2020-09-11T16:46:15.230Z",
          "content": "<p>That was helpful, thank you!</p>",
          "rawMarkdown": "That was helpful, thank you!",
          "votes": 1
        },
        {
          "id": 1009353,
          "postDate": "2020-09-13T22:26:48.483Z",
          "content": "<p>how will it install during inference if there is no internet? you might have to add it as external data?</p>",
          "rawMarkdown": "how will it install during inference if there is no internet? you might have to add it as external data?"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1009125,
      "author_name": "Redwan Sony",
      "author_url": "",
      "post_date": "2020-09-13T17:06:10.560000",
      "content": "<p>From my experience, what is found is that previously I used to do the code like </p>\n<p>**Old Method😓😓: </p>\n<pre><code>import pydicom as dcm\n\nscan = dcm.dcmread(filepath)\nimg = scan.pixel_array\n</code></pre>\n<p>which oftentimes caused that error. Later I modified the code in the following way:</p>\n<p>**New Method🤓🤓: </p>\n<pre><code>import pydicom\n\nscan = pycdicom.read_file(filepath)\nimg = scan.pixel_array\n</code></pre>\n<p>The old method was not that reliable. It sometimes ran properly sometimes not. But the new method never failed me… </p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1007636,
      "author_name": "James Howard",
      "author_url": "",
      "post_date": "2020-09-12T10:53:28.493000",
      "content": "<p>Unfortunately, if you're training on windows, even the <code>conda</code> version of <code>gdcm</code> does not work with python 3.7 or 3.8, so you'll need a python 3.6 environment if you want to use <code>conda install -c conda-forge gdcm</code></p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1009614,
      "author_name": "Venturillo JE",
      "author_url": "",
      "post_date": "2020-09-14T06:14:55.067000",
      "content": "<p>I had the same problem previously and raised a <a href=\"https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182144\" target=\"_blank\">topic</a> for it. And my solution was the same <code>conda</code> line to install. However, I decided to switch to <code>vtk</code> which was featured <a href=\"https://www.kaggle.com/eladwar/20-seconds-or-less\" target=\"_blank\">here</a>. I found this on the other similar <a href=\"https://www.kaggle.com/c/osic-pulmonary-fibrosis-progression/discussion\" target=\"_blank\">competition</a> that had files in DICOM too.</p>\n<p>As far as I tested, <code>vtk</code> has yet to raise a single exception when handling DICOM files.</p>\n<p>If you want to see how to use it, go to my notebook <a href=\"https://www.kaggle.com/seraphwedd18/pe-detection-with-keras-model-creation#Check-Targets-and-Input-Image\" target=\"_blank\">here</a>.</p>\n<p>Hope this helps.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1009424,
      "author_name": "Walter Wiggins",
      "author_url": "",
      "post_date": "2020-09-14T02:17:28.943000",
      "content": "<p>None of the proposed fixes have solved the problem for me in Kaggle Notebooks, though it only occurred in 2/12 cases for me (see <a href=\"https://www.kaggle.com/wfwiggins203/exploring-the-dicom-metadata-images-with-fast-ai\" target=\"_blank\">here</a>). I've yet to try it on another platform.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1006815,
      "author_name": "Alaa Triki",
      "author_url": "",
      "post_date": "2020-09-11T15:11:46.580000",
      "content": "<p>I had the same error, running it multiple times will solve the issue</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1006926,
          "author_name": "TOUCAN",
          "author_url": "",
          "post_date": "2020-09-11T16:44:58.473000",
          "content": "<p>Hello Alaa,<br>\nI solved the problem ! The solution is to put <code>!conda install -c conda-forge gdcm -y</code> at the beginning of your notebook. <br>\nGood luck</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1006927,
          "author_name": "Alaa Triki",
          "author_url": "",
          "post_date": "2020-09-11T16:46:15.230000",
          "content": "<p>That was helpful, thank you!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1009353,
          "author_name": "hirviö",
          "author_url": "",
          "post_date": "2020-09-13T22:26:48.483000",
          "content": "<p>how will it install during inference if there is no internet? you might have to add it as external data?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1006769": "Hello, \n\nI am getting the following error when I try to access the pixel array of DICOM: RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM)\nSomeone can help ?\nThanks",
    "1009125": "From my experience, what is found is that previously I used to do the code like \n\n**Old Method😓😓: \n```\nimport pydicom as dcm\n\nscan = dcm.dcmread(filepath)\nimg = scan.pixel_array\n```\nwhich oftentimes caused that error. Later I modified the code in the following way:\n\n**New Method🤓🤓: \n```\nimport pydicom\n\nscan = pycdicom.read_file(filepath)\nimg = scan.pixel_array\n```\n\nThe old method was not that reliable. It sometimes ran properly sometimes not. But the new method never failed me... ",
    "1007636": "Unfortunately, if you're training on windows, even the `conda` version of `gdcm` does not work with python 3.7 or 3.8, so you'll need a python 3.6 environment if you want to use `conda install -c conda-forge gdcm`",
    "1009614": "I had the same problem previously and raised a [topic](https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/discussion/182144) for it. And my solution was the same `conda` line to install. However, I decided to switch to `vtk` which was featured [here](https://www.kaggle.com/eladwar/20-seconds-or-less). I found this on the other similar [competition](https://www.kaggle.com/c/osic-pulmonary-fibrosis-progression/discussion) that had files in DICOM too.\n\nAs far as I tested, `vtk` has yet to raise a single exception when handling DICOM files.\n\nIf you want to see how to use it, go to my notebook [here](https://www.kaggle.com/seraphwedd18/pe-detection-with-keras-model-creation#Check-Targets-and-Input-Image).\n\nHope this helps.",
    "1009424": "None of the proposed fixes have solved the problem for me in Kaggle Notebooks, though it only occurred in 2/12 cases for me (see [here](https://www.kaggle.com/wfwiggins203/exploring-the-dicom-metadata-images-with-fast-ai)). I've yet to try it on another platform.",
    "1006815": "I had the same error, running it multiple times will solve the issue"
  }
}