{
  "id": 247781,
  "title": "Runtime error reading .dcm file",
  "url": "/competitions/siim-covid19-detection/discussion/247781",
  "author_name": "",
  "post_date": "2021-06-21T06:20:13.232234500Z",
  "votes": 5,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I am getting this error message <em>\"RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\"</em></p>\n<p>My code : </p>\n<pre><code>dir = os.listdir(os.path.join(train_path,study_id))\npath = train_path + \"/\" + study_id + \"/\"+ dir[0] + \"/\" + id_x[:-6] + \".dcm\"\ndicom = pydicom.read_file(path)\n img = dicom.pixel_array\n</code></pre>\n<p>It correctly loads some images but some gives this runtime error.</p>\n<p>Any Suggestions! </p>",
  "messages": [
    {
      "id": "1359195",
      "postDate": "06/21/2021 06:20:13",
      "content": "<p>I am getting this error message <em>\"RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\"</em></p>\n<p>My code : </p>\n<pre><code>dir = os.listdir(os.path.join(train_path,study_id))\npath = train_path + \"/\" + study_id + \"/\"+ dir[0] + \"/\" + id_x[:-6] + \".dcm\"\ndicom = pydicom.read_file(path)\n img = dicom.pixel_array\n</code></pre>\n<p>It correctly loads some images but some gives this runtime error.</p>\n<p>Any Suggestions! </p>",
      "rawMarkdown": "I am getting this error message *\"RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\"*\n\nMy code : \n```\ndir = os.listdir(os.path.join(train_path,study_id))\npath = train_path + \"/\" + study_id + \"/\"+ dir[0] + \"/\" + id_x[:-6] + \".dcm\"\ndicom = pydicom.read_file(path)\n img = dicom.pixel_array\n```\n\nIt correctly loads some images but some gives this runtime error.\n\nAny Suggestions!",
      "votes": null
    },
    {
      "id": "1359528",
      "postDate": "06/21/2021 10:42:44",
      "content": "<p>Hey I have the same issue…If you get a solution please share it in the chat too</p>",
      "rawMarkdown": "Hey I have the same issue...If you get a solution please share it in the chat too",
      "votes": null
    },
    {
      "id": "1359576",
      "postDate": "06/21/2021 11:21:58",
      "content": "<p>Hey just run this command before the code: <br>\n<code>!conda install -c conda-forge gdcm -y</code><br>\nMine worked that way</p>",
      "rawMarkdown": "Hey just run this command before the code: \n`!conda install -c conda-forge gdcm -y`\nMine worked that way",
      "votes": null
    },
    {
      "id": "1360424",
      "postDate": "06/22/2021 04:59:14",
      "content": "<p><a href=\"https://www.kaggle.com/nvdgufuytdy\" target=\"_blank\">@nvdgufuytdy</a> Thank You.</p>",
      "rawMarkdown": "nvdgufuytdy Thank You.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1359528,
      "author_name": "nvdgufuytdy",
      "author_url": "",
      "post_date": "06/21/2021 10:42:44",
      "content": "<p>Hey I have the same issue…If you get a solution please share it in the chat too</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1359576,
      "author_name": "nvdgufuytdy",
      "author_url": "",
      "post_date": "06/21/2021 11:21:58",
      "content": "<p>Hey just run this command before the code: <br>\n<code>!conda install -c conda-forge gdcm -y</code><br>\nMine worked that way</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1360424,
      "author_name": "manharsharma007",
      "author_url": "",
      "post_date": "06/22/2021 04:59:14",
      "content": "<p><a href=\"https://www.kaggle.com/nvdgufuytdy\" target=\"_blank\">@nvdgufuytdy</a> Thank You.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1359195": "I am getting this error message *\"RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\"*\n\nMy code : \n```\ndir = os.listdir(os.path.join(train_path,study_id))\npath = train_path + \"/\" + study_id + \"/\"+ dir[0] + \"/\" + id_x[:-6] + \".dcm\"\ndicom = pydicom.read_file(path)\n img = dicom.pixel_array\n```\n\nIt correctly loads some images but some gives this runtime error.\n\nAny Suggestions!",
    "1359528": "Hey I have the same issue...If you get a solution please share it in the chat too",
    "1359576": "Hey just run this command before the code: \n`!conda install -c conda-forge gdcm -y`\nMine worked that way",
    "1360424": "nvdgufuytdy Thank You."
  },
  "source": "meta"
}