{
  "id": 166957,
  "title": "GDCM library is needed to read scans properly with pydicom",
  "url": "/competitions/osic-pulmonary-fibrosis-progression/discussion/166957",
  "author_name": "Ahmed Shahin",
  "post_date": "2020-07-14T17:03:30.202000",
  "votes": 53,
  "comment_count": 35,
  "views": 0,
  "content": "<p>Hi everyone,\nIf you receive this error while reading some scans:\n&gt; RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM)</p>\n\n<p>Then you need to install GDCM library for DICOM files, please follow the steps here:\n<a href=\"https://github.com/pydicom/pydicom/wiki/Installing-the-Python-GDCM-bindings-without-Conda\">https://github.com/pydicom/pydicom/wiki/Installing-the-Python-GDCM-bindings-without-Conda</a></p>\n\n<p>Or via conda:</p>\n\n<blockquote>\n  <p>!conda install -c conda-forge gdcm -y</p>\n</blockquote>",
  "messages": [
    {
      "id": 929431,
      "postDate": "2020-07-14T17:03:30.203Z",
      "content": "<p>Hi everyone,\nIf you receive this error while reading some scans:\n&gt; RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM)</p>\n\n<p>Then you need to install GDCM library for DICOM files, please follow the steps here:\n<a href=\"https://github.com/pydicom/pydicom/wiki/Installing-the-Python-GDCM-bindings-without-Conda\">https://github.com/pydicom/pydicom/wiki/Installing-the-Python-GDCM-bindings-without-Conda</a></p>\n\n<p>Or via conda:</p>\n\n<blockquote>\n  <p>!conda install -c conda-forge gdcm -y</p>\n</blockquote>",
      "rawMarkdown": "Hi everyone,\nIf you receive this error while reading some scans:\n&gt; RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM)\n\nThen you need to install GDCM library for DICOM files, please follow the steps here:\nhttps://github.com/pydicom/pydicom/wiki/Installing-the-Python-GDCM-bindings-without-Conda\n\nOr via conda:\n&gt; !conda install -c conda-forge gdcm -y",
      "votes": 51
    },
    {
      "id": 932893,
      "postDate": "2020-07-17T11:19:28.053Z",
      "content": "<p>I have tried installing GDCM using conda but it still gives that error</p>",
      "rawMarkdown": "I have tried installing GDCM using conda but it still gives that error",
      "votes": 8
    },
    {
      "id": 1379136,
      "postDate": "2021-07-07T05:55:19.337Z",
      "content": "<p>Thank you! It worked for me! After installing GCDM, it is important to restart the kernel. Otherwise it will still give the same error.</p>",
      "rawMarkdown": "Thank you! It worked for me! After installing GCDM, it is important to restart the kernel. Otherwise it will still give the same error.",
      "votes": 1
    },
    {
      "id": 970804,
      "postDate": "2020-08-14T20:11:55.303Z",
      "content": "<p>You can use the library \"vtk\". Example in <a href=\"https://www.kaggle.com/eladwar/20-seconds-or-less\">https://www.kaggle.com/eladwar/20-seconds-or-less</a> . It's way faster and way more memory efficient than pydicom. It can take 20 seconds or less to load 1,549 slices with only one cpu. To load the whole 3D slice, use setdirectory instead of setfilename.</p>",
      "rawMarkdown": "You can use the library \"vtk\". Example in https://www.kaggle.com/eladwar/20-seconds-or-less . It's way faster and way more memory efficient than pydicom. It can take 20 seconds or less to load 1,549 slices with only one cpu. To load the whole 3D slice, use setdirectory instead of setfilename.",
      "votes": 3
    },
    {
      "id": 1007854,
      "postDate": "2020-09-12T15:28:41.350Z",
      "content": "<p>I was getting this issue even after doing everything right from package perspective, then found it's happening for these 2 IDs:<br>\nBAD_ID = ['ID00011637202177653955184', 'ID00052637202186188008618']<br>\nYou would need to control for these 2 image reads and then it should be fine.</p>",
      "rawMarkdown": "I was getting this issue even after doing everything right from package perspective, then found it's happening for these 2 IDs:\nBAD_ID = ['ID00011637202177653955184', 'ID00052637202186188008618']\nYou would need to control for these 2 image reads and then it should be fine.",
      "votes": 1,
      "replies": [
        {
          "id": 1008254,
          "postDate": "2020-09-12T22:39:53.070Z",
          "content": "<p>Yes, you need GDCM to be installed in order to read two patients in the dataset.</p>",
          "rawMarkdown": "Yes, you need GDCM to be installed in order to read two patients in the dataset."
        }
      ]
    },
    {
      "id": 986658,
      "postDate": "2020-08-26T17:05:12.640Z",
      "content": "<p>For those having error while trying to install or after installing gdcm, this is what worked for me:<br>\n1) I created new environment using Anaconda command prompt with python 3.6 instead of python 3.7<br>\n2) Then I  added path to access libraries -&gt; conda config--add channels conda -forge<br>\n3) Now open your anaconda navigator click on environment and install all packages needed for the project(pandas, pydicom, gdcm , spyder kernel etcc…) one shot (This helped in remove the conflicts that arises due to overlap modules in the packages)</p>",
      "rawMarkdown": "For those having error while trying to install or after installing gdcm, this is what worked for me:\n1) I created new environment using Anaconda command prompt with python 3.6 instead of python 3.7\n2) Then I  added path to access libraries -> conda config--add channels conda -forge\n3) Now open your anaconda navigator click on environment and install all packages needed for the project(pandas, pydicom, gdcm , spyder kernel etcc...) one shot (This helped in remove the conflicts that arises due to overlap modules in the packages)\n",
      "votes": 1
    },
    {
      "id": 933262,
      "postDate": "2020-07-17T15:47:29.067Z",
      "content": "<p>I can't find the error part in your notebook, see my comment below to Paul. When you submit, the internet is off so you can't install the package, and the package is needed for only two cases, the rest should be fine.</p>",
      "rawMarkdown": "I can't find the error part in your notebook, see my comment below to Paul. When you submit, the internet is off so you can't install the package, and the package is needed for only two cases, the rest should be fine.",
      "votes": 1
    },
    {
      "id": 963815,
      "postDate": "2020-08-09T10:13:26.173Z",
      "content": "<p>Has anyone succeeded in installing GDCM on Mac OS without using conda?</p>",
      "rawMarkdown": "Has anyone succeeded in installing GDCM on Mac OS without using conda?",
      "votes": 2
    },
    {
      "id": 963241,
      "postDate": "2020-08-08T19:32:16.733Z",
      "content": "<p>Great work. upvoted! <a href=\"/ahmedhshahin\">@ahmedhshahin</a> </p>",
      "rawMarkdown": "Great work. upvoted! @ahmedhshahin ",
      "votes": -2
    },
    {
      "id": 1151909,
      "postDate": "2021-01-13T16:32:16.833Z",
      "content": "<p>hello, am going through the same issue in my new MacBook apple silicon (M1).. my project needs Tensorflow and Pydicom. Based on Apple's Github pages for Tensorflow, they released a new version that is compatible for M1 which uses python &gt;3.8. So when I created a virtual env with python 3.8.6 and TF in it, pydicom doesn't work anymore. I have no clue how to install GDCM and pylibjpeg in M1. Pydicom does work in a virtual env with python 3.6.12 but TF doesn't :(. Any thoughts or suggestions would be highly appreciated! Here's the error I see,</p>\n<p><code>RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )</code></p>\n<p>PFA the screen shot for output I got when I ran, <code>! conda install -c conda-forge gdcm -y</code></p>",
      "rawMarkdown": "hello, am going through the same issue in my new MacBook apple silicon (M1).. my project needs Tensorflow and Pydicom. Based on Apple's Github pages for Tensorflow, they released a new version that is compatible for M1 which uses python >3.8. So when I created a virtual env with python 3.8.6 and TF in it, pydicom doesn't work anymore. I have no clue how to install GDCM and pylibjpeg in M1. Pydicom does work in a virtual env with python 3.6.12 but TF doesn't :(. Any thoughts or suggestions would be highly appreciated! Here's the error I see,\n\n`RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )`\n\nPFA the screen shot for output I got when I ran, `! conda install -c conda-forge gdcm -y`\n\n\n"
    },
    {
      "id": 1032502,
      "postDate": "2020-09-30T08:49:16.207Z",
      "content": "<p><a href=\"https://www.kaggle.com/ahmedhshahin\" target=\"_blank\">@ahmedhshahin</a><br>\nThe library(! conda install -c conda-forge gdcm -y) is properly install on colab.<br>\nAlso support for jupyter notebook. <br>\nwell done.</p>",
      "rawMarkdown": "@ahmedhshahin\nThe library(! conda install -c conda-forge gdcm -y) is properly install on colab.\nAlso support for jupyter notebook. \nwell done."
    },
    {
      "id": 1025977,
      "postDate": "2020-09-24T23:51:53.683Z",
      "content": "<p>Thankyou for sharing !</p>",
      "rawMarkdown": "Thankyou for sharing !"
    },
    {
      "id": 1000941,
      "postDate": "2020-09-06T23:45:51.380Z",
      "content": "<p>After I changed my notebook preferences to use the latest environment, I didn't seem to have any more issues with reading the problematic DICOM files.</p>",
      "rawMarkdown": "After I changed my notebook preferences to use the latest environment, I didn't seem to have any more issues with reading the problematic DICOM files.",
      "replies": [
        {
          "id": 1000945,
          "postDate": "2020-09-06T23:53:19.453Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 979491,
      "postDate": "2020-08-20T22:10:46.747Z",
      "content": "<p>all ready installed GDCM, the <code>import gdcm</code> work with no problem but i still have this erro :</p>\n<blockquote>\n  <p>The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. )</p>\n</blockquote>\n<p>rise from this code :</p>\n<p><code>pydicom.dcmread('../input/osic-pulmonary-fibrosis-progression/train/ID00011637202177653955184/1.dcm')</code></p>\n<p>Any explication ?</p>",
      "rawMarkdown": "all ready installed GDCM, the `import gdcm` work with no problem but i still have this erro :\n\n> The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. )\n\nrise from this code :\n\n`pydicom.dcmread('../input/osic-pulmonary-fibrosis-progression/train/ID00011637202177653955184/1.dcm')`\n\nAny explication ?",
      "replies": [
        {
          "id": 979494,
          "postDate": "2020-08-20T22:13:20.913Z",
          "content": "<p>Other people here recommend restarting kernel/machine. I didn't verify this though.</p>",
          "rawMarkdown": "Other people here recommend restarting kernel/machine. I didn't verify this though.",
          "votes": 1
        },
        {
          "id": 980163,
          "postDate": "2020-08-21T11:23:32.160Z",
          "content": "<p>After retart kernel it works, thnx Ahmed.</p>",
          "rawMarkdown": "After retart kernel it works, thnx Ahmed."
        }
      ]
    },
    {
      "id": 977517,
      "postDate": "2020-08-19T14:28:00.343Z",
      "content": "<p>If you need to install conda on Colab: <a href=\"https://towardsdatascience.com/conda-google-colab-75f7c867a522\" target=\"_blank\">url</a></p>",
      "rawMarkdown": "If you need to install conda on Colab: [url](https://towardsdatascience.com/conda-google-colab-75f7c867a522)"
    },
    {
      "id": 963153,
      "postDate": "2020-08-08T17:47:58.407Z",
      "content": "<p>I have installed gdcm using conda , then I imported it and made sure it raised no error , yet I faced the error again </p>",
      "rawMarkdown": "I have installed gdcm using conda , then I imported it and made sure it raised no error , yet I faced the error again ",
      "replies": [
        {
          "id": 963944,
          "postDate": "2020-08-09T13:05:41.613Z",
          "content": "<p>I verified this method locally (python 3.7, pydicom 2.0, ubuntu 20), and other people verified it on Kaggle notebooks. Perhaps you can share your environment, maybe someone with the same environment can advise.<br>\nJust to check, you should do the following: <br>\ninstall pydicom, gdcm<br>\nimport pydicom (do not import gdcm)<br>\nread scans</p>",
          "rawMarkdown": "I verified this method locally (python 3.7, pydicom 2.0, ubuntu 20), and other people verified it on Kaggle notebooks. Perhaps you can share your environment, maybe someone with the same environment can advise.\nJust to check, you should do the following: \ninstall pydicom, gdcm\nimport pydicom (do not import gdcm)\nread scans",
          "votes": -2
        },
        {
          "id": 994234,
          "postDate": "2020-09-01T13:29:43.427Z",
          "content": "<p>if ur using kaggle notebook then try using these command in ur notebook u dont have to do anything , code take of restarting the kernel and all</p>\n<p>!conda install -c conda-forge gdcm -y</p>\n<p>from IPython.display import display_html<br>\ndef restartkernel() :<br>\n    display_html(\"\",raw=True)<br>\nrestartkernel()</p>\n<p>this worked for me hope this helps</p>",
          "rawMarkdown": "if ur using kaggle notebook then try using these command in ur notebook u dont have to do anything , code take of restarting the kernel and all\n\n!conda install -c conda-forge gdcm -y\n\nfrom IPython.display import display_html\ndef restartkernel() :\n    display_html(\"<script>Jupyter.notebook.kernel.restart()</script>\",raw=True)\nrestartkernel()\n\nthis worked for me hope this helps",
          "votes": 2
        },
        {
          "id": 1003348,
          "postDate": "2020-09-08T21:16:56.537Z",
          "content": "<p>I added the script to your code inside the display_html() method.</p>\n<pre><code>from IPython.display import display_html\ndef restartkernel() :\n    display_html(\"&lt;script&gt;Jupyter.notebook.kernel.restart()&lt;/script&gt;\",raw=True)\n</code></pre>\n<p>And then it finally worked with patien ID00011637202177653955184</p>",
          "rawMarkdown": "I added the script to your code inside the display_html() method.\n\n```\nfrom IPython.display import display_html\ndef restartkernel() :\n    display_html(\"<script>Jupyter.notebook.kernel.restart()</script>\",raw=True)\n```\n\nAnd then it finally worked with patien ID00011637202177653955184",
          "votes": 2
        },
        {
          "id": 1499798,
          "postDate": "2021-09-02T00:03:31.427Z",
          "content": "<p>Thank you very much! I tried everything, nothing worked but this!! Thank youu</p>",
          "rawMarkdown": "Thank you very much! I tried everything, nothing worked but this!! Thank youu"
        }
      ]
    },
    {
      "id": 932916,
      "postDate": "2020-07-17T11:32:47.387Z",
      "content": "<p>Make sure it has been installed successfully:\n&gt; import gdcm</p>",
      "rawMarkdown": "Make sure it has been installed successfully:\n&gt; import gdcm",
      "replies": [
        {
          "id": 932995,
          "postDate": "2020-07-17T12:10:32.297Z",
          "content": "<p>I have .. its successfully installed and imported but it's still showing the error <br>\nhere is my kernel<a href=\"https://www.kaggle.com/zainahmad/preprocessing-the-dicom-data\" target=\"_blank\"> https://www.kaggle.com/zainahmad/preprocessing-the-dicom-data</a> could you please have a look at it</p>",
          "rawMarkdown": "I have .. its successfully installed and imported but it's still showing the error \nhere is my kernel[ https://www.kaggle.com/zainahmad/preprocessing-the-dicom-data](https://www.kaggle.com/zainahmad/preprocessing-the-dicom-data) could you please have a look at it",
          "votes": 4
        },
        {
          "id": 1899076,
          "postDate": "2022-08-15T03:57:05.870Z",
          "content": "<p>Did it work?</p>",
          "rawMarkdown": "Did it work?"
        }
      ]
    },
    {
      "id": 931372,
      "postDate": "2020-07-16T06:53:54.823Z",
      "content": "<p>How to install GDCM library without internet in the submission kernel?</p>",
      "rawMarkdown": "How to install GDCM library without internet in the submission kernel?",
      "replies": [
        {
          "id": 931613,
          "postDate": "2020-07-16T09:59:39.987Z",
          "content": "<p>One solution could be to install the package, train a model, then upload the pretrained model. Another one could be to save the scans that are not readable without GDCM (two scans) in npy files, and then load them using np load.</p>",
          "rawMarkdown": "One solution could be to install the package, train a model, then upload the pretrained model. Another one could be to save the scans that are not readable without GDCM (two scans) in npy files, and then load them using np load.",
          "votes": -2
        },
        {
          "id": 932773,
          "postDate": "2020-07-17T09:14:02.733Z",
          "content": "<p>If these are <strong>UNSEEN</strong> images (CT scans) behind the private lb, neither way could  parse those dicoms and use image feature unless the GDCM library has been installed in the backend kernel. Am I right?</p>",
          "rawMarkdown": "If these are **UNSEEN** images (CT scans) behind the private lb, neither way could  parse those dicoms and use image feature unless the GDCM library has been installed in the backend kernel. Am I right?",
          "votes": 2
        },
        {
          "id": 932807,
          "postDate": "2020-07-17T09:50:28.273Z",
          "content": "<p>Yes, you are. However, there are only two cases that are problematic without GDCM in the training set. In the private test set, all images are normally readable with pydicom.</p>",
          "rawMarkdown": "Yes, you are. However, there are only two cases that are problematic without GDCM in the training set. In the private test set, all images are normally readable with pydicom.",
          "votes": 4
        },
        {
          "id": 948579,
          "postDate": "2020-07-28T04:35:30.640Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 949025,
          "postDate": "2020-07-28T11:46:31.117Z",
          "content": "<p>Hi Samuel, there are no problems with reading the scans in the dataset. If you have GDCM, you will be able to read all images. If not, you will have problems reading two scans.</p>",
          "rawMarkdown": "Hi Samuel, there are no problems with reading the scans in the dataset. If you have GDCM, you will be able to read all images. If not, you will have problems reading two scans."
        },
        {
          "id": 949801,
          "postDate": "2020-07-29T00:16:13.467Z",
          "content": "<p>It works fine to read all test scans without GDCM. Just for confirmation.</p>",
          "rawMarkdown": "It works fine to read all test scans without GDCM. Just for confirmation.",
          "votes": 2
        }
      ]
    },
    {
      "id": 933067,
      "postDate": "2020-07-17T13:08:00.783Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 932904,
      "postDate": "2020-07-17T11:27:24.867Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 932893,
      "author_name": "Zain Ahmad",
      "author_url": "",
      "post_date": "2020-07-17T11:19:28.053000",
      "content": "<p>I have tried installing GDCM using conda but it still gives that error</p>",
      "votes": 8,
      "replies": []
    },
    {
      "id": 1379136,
      "author_name": "Bahar",
      "author_url": "",
      "post_date": "2021-07-07T05:55:19.337000",
      "content": "<p>Thank you! It worked for me! After installing GCDM, it is important to restart the kernel. Otherwise it will still give the same error.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 970804,
      "author_name": "Pythonian",
      "author_url": "",
      "post_date": "2020-08-14T20:11:55.303000",
      "content": "<p>You can use the library \"vtk\". Example in <a href=\"https://www.kaggle.com/eladwar/20-seconds-or-less\">https://www.kaggle.com/eladwar/20-seconds-or-less</a> . It's way faster and way more memory efficient than pydicom. It can take 20 seconds or less to load 1,549 slices with only one cpu. To load the whole 3D slice, use setdirectory instead of setfilename.</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1007854,
      "author_name": "Anurag Trivedi",
      "author_url": "",
      "post_date": "2020-09-12T15:28:41.350000",
      "content": "<p>I was getting this issue even after doing everything right from package perspective, then found it's happening for these 2 IDs:<br>\nBAD_ID = ['ID00011637202177653955184', 'ID00052637202186188008618']<br>\nYou would need to control for these 2 image reads and then it should be fine.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1008254,
          "author_name": "Ahmed Shahin",
          "author_url": "",
          "post_date": "2020-09-12T22:39:53.070000",
          "content": "<p>Yes, you need GDCM to be installed in order to read two patients in the dataset.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 986658,
      "author_name": "Kurian robert",
      "author_url": "",
      "post_date": "2020-08-26T17:05:12.640000",
      "content": "<p>For those having error while trying to install or after installing gdcm, this is what worked for me:<br>\n1) I created new environment using Anaconda command prompt with python 3.6 instead of python 3.7<br>\n2) Then I  added path to access libraries -&gt; conda config--add channels conda -forge<br>\n3) Now open your anaconda navigator click on environment and install all packages needed for the project(pandas, pydicom, gdcm , spyder kernel etcc…) one shot (This helped in remove the conflicts that arises due to overlap modules in the packages)</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 933262,
      "author_name": "Ahmed Shahin",
      "author_url": "",
      "post_date": "2020-07-17T15:47:29.067000",
      "content": "<p>I can't find the error part in your notebook, see my comment below to Paul. When you submit, the internet is off so you can't install the package, and the package is needed for only two cases, the rest should be fine.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 963815,
      "author_name": "hatry",
      "author_url": "",
      "post_date": "2020-08-09T10:13:26.173000",
      "content": "<p>Has anyone succeeded in installing GDCM on Mac OS without using conda?</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 963241,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-08-08T19:32:16.733000",
      "content": "<p>Great work. upvoted! <a href=\"/ahmedhshahin\">@ahmedhshahin</a> </p>",
      "votes": -2,
      "replies": []
    },
    {
      "id": 1151909,
      "author_name": "Thulasi M",
      "author_url": "",
      "post_date": "2021-01-13T16:32:16.833000",
      "content": "<p>hello, am going through the same issue in my new MacBook apple silicon (M1).. my project needs Tensorflow and Pydicom. Based on Apple's Github pages for Tensorflow, they released a new version that is compatible for M1 which uses python &gt;3.8. So when I created a virtual env with python 3.8.6 and TF in it, pydicom doesn't work anymore. I have no clue how to install GDCM and pylibjpeg in M1. Pydicom does work in a virtual env with python 3.6.12 but TF doesn't :(. Any thoughts or suggestions would be highly appreciated! Here's the error I see,</p>\n<p><code>RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )</code></p>\n<p>PFA the screen shot for output I got when I ran, <code>! conda install -c conda-forge gdcm -y</code></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1032502,
      "author_name": "Shubham",
      "author_url": "",
      "post_date": "2020-09-30T08:49:16.207000",
      "content": "<p><a href=\"https://www.kaggle.com/ahmedhshahin\" target=\"_blank\">@ahmedhshahin</a><br>\nThe library(! conda install -c conda-forge gdcm -y) is properly install on colab.<br>\nAlso support for jupyter notebook. <br>\nwell done.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1025977,
      "author_name": "MovvaSrilekha",
      "author_url": "",
      "post_date": "2020-09-24T23:51:53.683000",
      "content": "<p>Thankyou for sharing !</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1000941,
      "author_name": "Maryam Ansari",
      "author_url": "",
      "post_date": "2020-09-06T23:45:51.380000",
      "content": "<p>After I changed my notebook preferences to use the latest environment, I didn't seem to have any more issues with reading the problematic DICOM files.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1000945,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-09-06T23:53:19.453000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 979491,
      "author_name": "Mehdi GASMI",
      "author_url": "",
      "post_date": "2020-08-20T22:10:46.747000",
      "content": "<p>all ready installed GDCM, the <code>import gdcm</code> work with no problem but i still have this erro :</p>\n<blockquote>\n  <p>The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. )</p>\n</blockquote>\n<p>rise from this code :</p>\n<p><code>pydicom.dcmread('../input/osic-pulmonary-fibrosis-progression/train/ID00011637202177653955184/1.dcm')</code></p>\n<p>Any explication ?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 979494,
          "author_name": "Ahmed Shahin",
          "author_url": "",
          "post_date": "2020-08-20T22:13:20.913000",
          "content": "<p>Other people here recommend restarting kernel/machine. I didn't verify this though.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 980163,
          "author_name": "Mehdi GASMI",
          "author_url": "",
          "post_date": "2020-08-21T11:23:32.160000",
          "content": "<p>After retart kernel it works, thnx Ahmed.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 977517,
      "author_name": "Paulo Lacerda",
      "author_url": "",
      "post_date": "2020-08-19T14:28:00.343000",
      "content": "<p>If you need to install conda on Colab: <a href=\"https://towardsdatascience.com/conda-google-colab-75f7c867a522\" target=\"_blank\">url</a></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 963153,
      "author_name": "Abdelrahman Mohamed",
      "author_url": "",
      "post_date": "2020-08-08T17:47:58.407000",
      "content": "<p>I have installed gdcm using conda , then I imported it and made sure it raised no error , yet I faced the error again </p>",
      "votes": 0,
      "replies": [
        {
          "id": 963944,
          "author_name": "Ahmed Shahin",
          "author_url": "",
          "post_date": "2020-08-09T13:05:41.613000",
          "content": "<p>I verified this method locally (python 3.7, pydicom 2.0, ubuntu 20), and other people verified it on Kaggle notebooks. Perhaps you can share your environment, maybe someone with the same environment can advise.<br>\nJust to check, you should do the following: <br>\ninstall pydicom, gdcm<br>\nimport pydicom (do not import gdcm)<br>\nread scans</p>",
          "votes": -2,
          "replies": []
        },
        {
          "id": 994234,
          "author_name": "Ravitej Manduri",
          "author_url": "",
          "post_date": "2020-09-01T13:29:43.427000",
          "content": "<p>if ur using kaggle notebook then try using these command in ur notebook u dont have to do anything , code take of restarting the kernel and all</p>\n<p>!conda install -c conda-forge gdcm -y</p>\n<p>from IPython.display import display_html<br>\ndef restartkernel() :<br>\n    display_html(\"\",raw=True)<br>\nrestartkernel()</p>\n<p>this worked for me hope this helps</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1003348,
          "author_name": "Ernesto Castillo",
          "author_url": "",
          "post_date": "2020-09-08T21:16:56.537000",
          "content": "<p>I added the script to your code inside the display_html() method.</p>\n<pre><code>from IPython.display import display_html\ndef restartkernel() :\n    display_html(\"&lt;script&gt;Jupyter.notebook.kernel.restart()&lt;/script&gt;\",raw=True)\n</code></pre>\n<p>And then it finally worked with patien ID00011637202177653955184</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1499798,
          "author_name": "esssss2364",
          "author_url": "",
          "post_date": "2021-09-02T00:03:31.427000",
          "content": "<p>Thank you very much! I tried everything, nothing worked but this!! Thank youu</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 932916,
      "author_name": "Ahmed Shahin",
      "author_url": "",
      "post_date": "2020-07-17T11:32:47.387000",
      "content": "<p>Make sure it has been installed successfully:\n&gt; import gdcm</p>",
      "votes": 0,
      "replies": [
        {
          "id": 932995,
          "author_name": "Zain Ahmad",
          "author_url": "",
          "post_date": "2020-07-17T12:10:32.297000",
          "content": "<p>I have .. its successfully installed and imported but it's still showing the error <br>\nhere is my kernel<a href=\"https://www.kaggle.com/zainahmad/preprocessing-the-dicom-data\" target=\"_blank\"> https://www.kaggle.com/zainahmad/preprocessing-the-dicom-data</a> could you please have a look at it</p>",
          "votes": 4,
          "replies": []
        },
        {
          "id": 1899076,
          "author_name": "Chintan Raiyani",
          "author_url": "",
          "post_date": "2022-08-15T03:57:05.870000",
          "content": "<p>Did it work?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 931372,
      "author_name": "Paul Chen",
      "author_url": "",
      "post_date": "2020-07-16T06:53:54.823000",
      "content": "<p>How to install GDCM library without internet in the submission kernel?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 931613,
          "author_name": "Ahmed Shahin",
          "author_url": "",
          "post_date": "2020-07-16T09:59:39.987000",
          "content": "<p>One solution could be to install the package, train a model, then upload the pretrained model. Another one could be to save the scans that are not readable without GDCM (two scans) in npy files, and then load them using np load.</p>",
          "votes": -2,
          "replies": []
        },
        {
          "id": 932773,
          "author_name": "Paul Chen",
          "author_url": "",
          "post_date": "2020-07-17T09:14:02.733000",
          "content": "<p>If these are <strong>UNSEEN</strong> images (CT scans) behind the private lb, neither way could  parse those dicoms and use image feature unless the GDCM library has been installed in the backend kernel. Am I right?</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 932807,
          "author_name": "Ahmed Shahin",
          "author_url": "",
          "post_date": "2020-07-17T09:50:28.273000",
          "content": "<p>Yes, you are. However, there are only two cases that are problematic without GDCM in the training set. In the private test set, all images are normally readable with pydicom.</p>",
          "votes": 4,
          "replies": []
        },
        {
          "id": 948579,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-07-28T04:35:30.640000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 949025,
          "author_name": "Ahmed Shahin",
          "author_url": "",
          "post_date": "2020-07-28T11:46:31.117000",
          "content": "<p>Hi Samuel, there are no problems with reading the scans in the dataset. If you have GDCM, you will be able to read all images. If not, you will have problems reading two scans.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 949801,
          "author_name": "Paul Chen",
          "author_url": "",
          "post_date": "2020-07-29T00:16:13.467000",
          "content": "<p>It works fine to read all test scans without GDCM. Just for confirmation.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 933067,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-07-17T13:08:00.783000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 932904,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-07-17T11:27:24.867000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "929431": "Hi everyone,\nIf you receive this error while reading some scans:\n&gt; RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM)\n\nThen you need to install GDCM library for DICOM files, please follow the steps here:\nhttps://github.com/pydicom/pydicom/wiki/Installing-the-Python-GDCM-bindings-without-Conda\n\nOr via conda:\n&gt; !conda install -c conda-forge gdcm -y",
    "932893": "I have tried installing GDCM using conda but it still gives that error",
    "1379136": "Thank you! It worked for me! After installing GCDM, it is important to restart the kernel. Otherwise it will still give the same error.",
    "970804": "You can use the library \"vtk\". Example in https://www.kaggle.com/eladwar/20-seconds-or-less . It's way faster and way more memory efficient than pydicom. It can take 20 seconds or less to load 1,549 slices with only one cpu. To load the whole 3D slice, use setdirectory instead of setfilename.",
    "1007854": "I was getting this issue even after doing everything right from package perspective, then found it's happening for these 2 IDs:\nBAD_ID = ['ID00011637202177653955184', 'ID00052637202186188008618']\nYou would need to control for these 2 image reads and then it should be fine.",
    "986658": "For those having error while trying to install or after installing gdcm, this is what worked for me:\n1) I created new environment using Anaconda command prompt with python 3.6 instead of python 3.7\n2) Then I  added path to access libraries -> conda config--add channels conda -forge\n3) Now open your anaconda navigator click on environment and install all packages needed for the project(pandas, pydicom, gdcm , spyder kernel etcc...) one shot (This helped in remove the conflicts that arises due to overlap modules in the packages)\n",
    "933262": "I can't find the error part in your notebook, see my comment below to Paul. When you submit, the internet is off so you can't install the package, and the package is needed for only two cases, the rest should be fine.",
    "963815": "Has anyone succeeded in installing GDCM on Mac OS without using conda?",
    "963241": "Great work. upvoted! @ahmedhshahin ",
    "1151909": "hello, am going through the same issue in my new MacBook apple silicon (M1).. my project needs Tensorflow and Pydicom. Based on Apple's Github pages for Tensorflow, they released a new version that is compatible for M1 which uses python >3.8. So when I created a virtual env with python 3.8.6 and TF in it, pydicom doesn't work anymore. I have no clue how to install GDCM and pylibjpeg in M1. Pydicom does work in a virtual env with python 3.6.12 but TF doesn't :(. Any thoughts or suggestions would be highly appreciated! Here's the error I see,\n\n`RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )`\n\nPFA the screen shot for output I got when I ran, `! conda install -c conda-forge gdcm -y`\n\n\n",
    "1032502": "@ahmedhshahin\nThe library(! conda install -c conda-forge gdcm -y) is properly install on colab.\nAlso support for jupyter notebook. \nwell done.",
    "1025977": "Thankyou for sharing !",
    "1000941": "After I changed my notebook preferences to use the latest environment, I didn't seem to have any more issues with reading the problematic DICOM files.",
    "979491": "all ready installed GDCM, the `import gdcm` work with no problem but i still have this erro :\n\n> The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. )\n\nrise from this code :\n\n`pydicom.dcmread('../input/osic-pulmonary-fibrosis-progression/train/ID00011637202177653955184/1.dcm')`\n\nAny explication ?",
    "977517": "If you need to install conda on Colab: [url](https://towardsdatascience.com/conda-google-colab-75f7c867a522)",
    "963153": "I have installed gdcm using conda , then I imported it and made sure it raised no error , yet I faced the error again ",
    "932916": "Make sure it has been installed successfully:\n&gt; import gdcm",
    "931372": "How to install GDCM library without internet in the submission kernel?",
    "933067": "",
    "932904": ""
  }
}