{
  "id": 341412,
  "title": "Fixing Error: ... missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )",
  "url": "/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/341412",
  "author_name": "Andrada",
  "post_date": "2022-08-02T18:39:39.899000",
  "votes": 37,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Hi all!</p>\n<p>Apparently some of the .dcm files are different than others in terms of the <code>dcm.file_meta.TransferSyntaxUID</code> (<a href=\"https://github.com/pydicom/pydicom/issues/1061\" target=\"_blank\">more details here</a>) - in short, some of them are:</p>\n<pre><code>print(dcm.file_meta.TransferSyntaxUID)\n'1.2.840.10008.1.2.4.70'\n</code></pre>\n<p>when they should simply be: <code>'1.2.840.10008.1'</code></p>\n<p>I had no clue, so when I tried to retrieve the images from some .dcm files, this error was popping up:</p>\n<pre><code>RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\n</code></pre>\n<p><img src=\"https://i.imgur.com/TXna0RW.png\"></p>\n<p>I fixed it by putting at <strong>the beginning of the notebook</strong> (be sure to do this BEFORE importing <code>pydicom</code>) the following:</p>\n<pre><code>! pip install python-gdcm\n! pip install pylibjpeg pylibjpeg-libjpeg pydicom\n</code></pre>\n<p>or</p>\n<pre><code>! pip install -qU \"python-gdcm\" pydicom pylibjpeg \"opencv-python-headless\"\n</code></pre>\n<p>Hope this helps! Cheers!</p>",
  "messages": [
    {
      "id": 1881761,
      "postDate": "2022-08-02T18:39:39.900Z",
      "content": "<p>Hi all!</p>\n<p>Apparently some of the .dcm files are different than others in terms of the <code>dcm.file_meta.TransferSyntaxUID</code> (<a href=\"https://github.com/pydicom/pydicom/issues/1061\" target=\"_blank\">more details here</a>) - in short, some of them are:</p>\n<pre><code>print(dcm.file_meta.TransferSyntaxUID)\n'1.2.840.10008.1.2.4.70'\n</code></pre>\n<p>when they should simply be: <code>'1.2.840.10008.1'</code></p>\n<p>I had no clue, so when I tried to retrieve the images from some .dcm files, this error was popping up:</p>\n<pre><code>RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\n</code></pre>\n<p><img src=\"https://i.imgur.com/TXna0RW.png\"></p>\n<p>I fixed it by putting at <strong>the beginning of the notebook</strong> (be sure to do this BEFORE importing <code>pydicom</code>) the following:</p>\n<pre><code>! pip install python-gdcm\n! pip install pylibjpeg pylibjpeg-libjpeg pydicom\n</code></pre>\n<p>or</p>\n<pre><code>! pip install -qU \"python-gdcm\" pydicom pylibjpeg \"opencv-python-headless\"\n</code></pre>\n<p>Hope this helps! Cheers!</p>",
      "rawMarkdown": "Hi all!\n\nApparently some of the .dcm files are different than others in terms of the `dcm.file_meta.TransferSyntaxUID` ([more details here](https://github.com/pydicom/pydicom/issues/1061)) - in short, some of them are:\n\n```\nprint(dcm.file_meta.TransferSyntaxUID)\n'1.2.840.10008.1.2.4.70'\n```\n\nwhen they should simply be: `'1.2.840.10008.1'`\n\nI had no clue, so when I tried to retrieve the images from some .dcm files, this error was popping up:\n\n```\nRuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\n```\n\n<img src=\"https://i.imgur.com/TXna0RW.png\">\n\nI fixed it by putting at **the beginning of the notebook** (be sure to do this BEFORE importing `pydicom`) the following:\n\n```\n! pip install python-gdcm\n! pip install pylibjpeg pylibjpeg-libjpeg pydicom\n```\n\nor\n\n```\n! pip install -qU \"python-gdcm\" pydicom pylibjpeg \"opencv-python-headless\"\n```\n\nHope this helps! Cheers!",
      "votes": 37
    },
    {
      "id": 1886507,
      "postDate": "2022-08-05T22:31:20.843Z",
      "content": "<p><a href=\"https://www.kaggle.com/andradaolteanu\" target=\"_blank\">@andradaolteanu</a> </p>\n<p>Sorry, here it is.<br>\n<a href=\"https://www.kaggle.com/code/awsaf49/pydicom-conda-helper\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a> </p>",
      "rawMarkdown": "@andradaolteanu \n\nSorry, here it is.\nhttps://www.kaggle.com/code/awsaf49/pydicom-conda-helper ",
      "votes": 6,
      "replies": [
        {
          "id": 1887008,
          "postDate": "2022-08-06T11:14:39.857Z",
          "content": "<p>thankssss! 🙏</p>",
          "rawMarkdown": "thankssss! 🙏",
          "votes": 1
        }
      ]
    },
    {
      "id": 1885177,
      "postDate": "2022-08-05T01:25:06.643Z",
      "content": "<p>In the case where the Internet is available, the method mentioned above is valid. However, as this competition requires the Internet off, we have to do another method such as using pydicom-conda-helper established by <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a></p>",
      "rawMarkdown": "In the case where the Internet is available, the method mentioned above is valid. However, as this competition requires the Internet off, we have to do another method such as using pydicom-conda-helper established by @awsaf49",
      "votes": 2,
      "replies": [
        {
          "id": 1885519,
          "postDate": "2022-08-05T08:25:25.343Z",
          "content": "<p>Could you give me a link? I haven't seen that one ^^</p>",
          "rawMarkdown": "Could you give me a link? I haven't seen that one ^^"
        }
      ]
    },
    {
      "id": 1912898,
      "postDate": "2022-08-25T03:05:20.733Z",
      "content": "<p>When following the <a href=\"url\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a>, I get a bunch of PathNotFound Errors.  Did anyone else see this too?</p>\n<pre><code>`Downloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/gdcm-2.8.9-py37h500ead1_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/conda-4.10.1-py37h89c1867_0.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/certifi-2020.12.5-py37h89c1867_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/openssl-1.1.1k-h7f98852_0.tar.bz2`\n</code></pre>",
      "rawMarkdown": "When following the [https://www.kaggle.com/code/awsaf49/pydicom-conda-helper](url), I get a bunch of PathNotFound Errors.  Did anyone else see this too?\n\n```\n`Downloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/gdcm-2.8.9-py37h500ead1_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/conda-4.10.1-py37h89c1867_0.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/certifi-2020.12.5-py37h89c1867_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/openssl-1.1.1k-h7f98852_0.tar.bz2`\n```",
      "replies": [
        {
          "id": 1918795,
          "postDate": "2022-08-29T21:03:16.893Z",
          "content": "<p>I used the 'Add Data' button to add the referenced notebook… </p>\n<p><a href=\"https://www.kaggle.com/code/awsaf49/pydicom-conda-helper\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a></p>\n<p>to my notebook then added the following into a cell at the top of my notebook to copy the relevant bz2 files to my /kaggle/working directory…</p>\n<p>!cp ../input/pydicom-conda-helper/*.bz2 /kaggle/working</p>\n<p>I also had to modify the conda install commands as follows:</p>\n<p>!conda install --offline 'libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2'  -y<br>\n!conda install --offline 'libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -y<br>\n!conda install --offline 'gdcm-2.8.9-py37h500ead1_1.tar.bz2' -y<br>\n!conda install --offline 'conda-4.10.1-py37h89c1867_0.tar.bz2' -c conda-forge -y<br>\n!conda install --offline 'certifi-2020.12.5-py37h89c1867_1.tar.bz2' -y<br>\n!conda install --offline 'openssl-1.1.1k-h7f98852_0.tar.bz2' -y</p>",
          "rawMarkdown": "I used the 'Add Data' button to add the referenced notebook... \n\nhttps://www.kaggle.com/code/awsaf49/pydicom-conda-helper\n\nto my notebook then added the following into a cell at the top of my notebook to copy the relevant bz2 files to my /kaggle/working directory...\n\n!cp ../input/pydicom-conda-helper/*.bz2 /kaggle/working\n\nI also had to modify the conda install commands as follows:\n\n!conda install --offline 'libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2'  -y\n!conda install --offline 'libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -y\n!conda install --offline 'gdcm-2.8.9-py37h500ead1_1.tar.bz2' -y\n!conda install --offline 'conda-4.10.1-py37h89c1867_0.tar.bz2' -c conda-forge -y\n!conda install --offline 'certifi-2020.12.5-py37h89c1867_1.tar.bz2' -y\n!conda install --offline 'openssl-1.1.1k-h7f98852_0.tar.bz2' -y\n\n",
          "votes": 2
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1886507,
      "author_name": "Nidaime PostDoc",
      "author_url": "",
      "post_date": "2022-08-05T22:31:20.843000",
      "content": "<p><a href=\"https://www.kaggle.com/andradaolteanu\" target=\"_blank\">@andradaolteanu</a> </p>\n<p>Sorry, here it is.<br>\n<a href=\"https://www.kaggle.com/code/awsaf49/pydicom-conda-helper\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a> </p>",
      "votes": 6,
      "replies": [
        {
          "id": 1887008,
          "author_name": "Andrada",
          "author_url": "",
          "post_date": "2022-08-06T11:14:39.857000",
          "content": "<p>thankssss! 🙏</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1885177,
      "author_name": "Nidaime PostDoc",
      "author_url": "",
      "post_date": "2022-08-05T01:25:06.643000",
      "content": "<p>In the case where the Internet is available, the method mentioned above is valid. However, as this competition requires the Internet off, we have to do another method such as using pydicom-conda-helper established by <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a></p>",
      "votes": 2,
      "replies": [
        {
          "id": 1885519,
          "author_name": "Andrada",
          "author_url": "",
          "post_date": "2022-08-05T08:25:25.343000",
          "content": "<p>Could you give me a link? I haven't seen that one ^^</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1912898,
      "author_name": "cbarb15",
      "author_url": "",
      "post_date": "2022-08-25T03:05:20.733000",
      "content": "<p>When following the <a href=\"url\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a>, I get a bunch of PathNotFound Errors.  Did anyone else see this too?</p>\n<pre><code>`Downloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/gdcm-2.8.9-py37h500ead1_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/conda-4.10.1-py37h89c1867_0.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/certifi-2020.12.5-py37h89c1867_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/openssl-1.1.1k-h7f98852_0.tar.bz2`\n</code></pre>",
      "votes": 0,
      "replies": [
        {
          "id": 1918795,
          "author_name": "John Robinson",
          "author_url": "",
          "post_date": "2022-08-29T21:03:16.893000",
          "content": "<p>I used the 'Add Data' button to add the referenced notebook… </p>\n<p><a href=\"https://www.kaggle.com/code/awsaf49/pydicom-conda-helper\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a></p>\n<p>to my notebook then added the following into a cell at the top of my notebook to copy the relevant bz2 files to my /kaggle/working directory…</p>\n<p>!cp ../input/pydicom-conda-helper/*.bz2 /kaggle/working</p>\n<p>I also had to modify the conda install commands as follows:</p>\n<p>!conda install --offline 'libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2'  -y<br>\n!conda install --offline 'libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -y<br>\n!conda install --offline 'gdcm-2.8.9-py37h500ead1_1.tar.bz2' -y<br>\n!conda install --offline 'conda-4.10.1-py37h89c1867_0.tar.bz2' -c conda-forge -y<br>\n!conda install --offline 'certifi-2020.12.5-py37h89c1867_1.tar.bz2' -y<br>\n!conda install --offline 'openssl-1.1.1k-h7f98852_0.tar.bz2' -y</p>",
          "votes": 2,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1881761": "Hi all!\n\nApparently some of the .dcm files are different than others in terms of the `dcm.file_meta.TransferSyntaxUID` ([more details here](https://github.com/pydicom/pydicom/issues/1061)) - in short, some of them are:\n\n```\nprint(dcm.file_meta.TransferSyntaxUID)\n'1.2.840.10008.1.2.4.70'\n```\n\nwhen they should simply be: `'1.2.840.10008.1'`\n\nI had no clue, so when I tried to retrieve the images from some .dcm files, this error was popping up:\n\n```\nRuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\n```\n\n<img src=\"https://i.imgur.com/TXna0RW.png\">\n\nI fixed it by putting at **the beginning of the notebook** (be sure to do this BEFORE importing `pydicom`) the following:\n\n```\n! pip install python-gdcm\n! pip install pylibjpeg pylibjpeg-libjpeg pydicom\n```\n\nor\n\n```\n! pip install -qU \"python-gdcm\" pydicom pylibjpeg \"opencv-python-headless\"\n```\n\nHope this helps! Cheers!",
    "1886507": "@andradaolteanu \n\nSorry, here it is.\nhttps://www.kaggle.com/code/awsaf49/pydicom-conda-helper ",
    "1885177": "In the case where the Internet is available, the method mentioned above is valid. However, as this competition requires the Internet off, we have to do another method such as using pydicom-conda-helper established by @awsaf49",
    "1912898": "When following the [https://www.kaggle.com/code/awsaf49/pydicom-conda-helper](url), I get a bunch of PathNotFound Errors.  Did anyone else see this too?\n\n```\n`Downloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/gdcm-2.8.9-py37h500ead1_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/conda-4.10.1-py37h89c1867_0.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/certifi-2020.12.5-py37h89c1867_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/openssl-1.1.1k-h7f98852_0.tar.bz2`\n```"
  }
}