{
  "id": 250245,
  "title": "Reading DICOM data",
  "url": "/competitions/siim-covid19-detection/discussion/250245",
  "author_name": "",
  "post_date": "2021-07-01T19:40:31.133208400Z",
  "votes": null,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Hi there good people,<br>\nAs far as I understand, I have to read the DICOM files from the training set and make a prediction on the four classes as well as a bounding box. I am new to DICOM format and having None output while trying to read a file. I have added my code below:</p>\n<p>*import pydicom<br>\nfrom pydicom.data import get_testdata_file</p>\n<p>filename = get_testdata_file(\"../input/siim-covid19-detection/test/00188a671292/3eb5a506ccf3/3dcdfc352a06.dcm\")</p>\n<p>print(filename)</p>\n<p>output: None*</p>\n<p>What am I doing wrong here?<br>\nThanks in advance :)</p>",
  "messages": [
    {
      "id": "1372538",
      "postDate": "07/01/2021 19:40:31",
      "content": "<p>Hi there good people,<br>\nAs far as I understand, I have to read the DICOM files from the training set and make a prediction on the four classes as well as a bounding box. I am new to DICOM format and having None output while trying to read a file. I have added my code below:</p>\n<p>*import pydicom<br>\nfrom pydicom.data import get_testdata_file</p>\n<p>filename = get_testdata_file(\"../input/siim-covid19-detection/test/00188a671292/3eb5a506ccf3/3dcdfc352a06.dcm\")</p>\n<p>print(filename)</p>\n<p>output: None*</p>\n<p>What am I doing wrong here?<br>\nThanks in advance :)</p>",
      "rawMarkdown": "Hi there good people,\nAs far as I understand, I have to read the DICOM files from the training set and make a prediction on the four classes as well as a bounding box. I am new to DICOM format and having None output while trying to read a file. I have added my code below:\n\n*import pydicom\nfrom pydicom.data import get_testdata_file\n\nfilename = get_testdata_file(\"../input/siim-covid19-detection/test/00188a671292/3eb5a506ccf3/3dcdfc352a06.dcm\")\n\nprint(filename)\n\noutput: None*\n\nWhat am I doing wrong here?\nThanks in advance :)",
      "votes": null
    },
    {
      "id": "1372549",
      "postDate": "07/01/2021 20:06:39",
      "content": "<p>The <code>get_testdata_file()</code> method is used to get the filenames of images in a test set that comes with pydicom. It's not used for loading external files.</p>\n<p>You'll need to use something <code>pydicom.dcmread()</code> to load a DICOM file. Then you can visualize it with <code>matplotlib.imshow()</code></p>\n<pre><code>import matplotlib.pyplot as plt\nimport pydicom\nimg = pydicom.dcmread('../path/to/file.dcm')\nplt.imshow(img.pixel_array, cmap='gray')\n</code></pre>",
      "rawMarkdown": "The `get_testdata_file()` method is used to get the filenames of images in a test set that comes with pydicom. It's not used for loading external files.\n\nYou'll need to use something `pydicom.dcmread()` to load a DICOM file. Then you can visualize it with `matplotlib.imshow()`\n\n```\nimport matplotlib.pyplot as plt\nimport pydicom\nimg = pydicom.dcmread('../path/to/file.dcm')\nplt.imshow(img.pixel_array, cmap='gray')\n```",
      "votes": null
    },
    {
      "id": "1372833",
      "postDate": "07/02/2021 04:31:53",
      "content": "<p>Thanks a lot for the suggestion. It worked.</p>",
      "rawMarkdown": "Thanks a lot for the suggestion. It worked.",
      "votes": null
    },
    {
      "id": "1372861",
      "postDate": "07/02/2021 05:09:46",
      "content": "<p>Brother, the get_testdata_file() method is used to get the filenames of images in a test set that comes with pydicom. It's not used for loading external files.</p>",
      "rawMarkdown": "Brother, the get_testdata_file() method is used to get the filenames of images in a test set that comes with pydicom. It's not used for loading external files.",
      "votes": null
    },
    {
      "id": "1372863",
      "postDate": "07/02/2021 05:11:04",
      "content": "<p>You'll need to use something <strong>pydicom.dcmread()</strong> to load a DICOM file.</p>",
      "rawMarkdown": "You'll need to use something **pydicom.dcmread()** to load a DICOM file.",
      "votes": null
    },
    {
      "id": "1372864",
      "postDate": "07/02/2021 05:12:07",
      "content": "<p>I hope it's useful for you..😊😊</p>",
      "rawMarkdown": "I hope it's useful for you..😊😊",
      "votes": null
    },
    {
      "id": "1379157",
      "postDate": "07/07/2021 06:20:48",
      "content": "<p>Appreciate the help.<br>\nThanks!</p>",
      "rawMarkdown": "Appreciate the help.\nThanks!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1372549,
      "author_name": "davidbroberts",
      "author_url": "",
      "post_date": "07/01/2021 20:06:39",
      "content": "<p>The <code>get_testdata_file()</code> method is used to get the filenames of images in a test set that comes with pydicom. It's not used for loading external files.</p>\n<p>You'll need to use something <code>pydicom.dcmread()</code> to load a DICOM file. Then you can visualize it with <code>matplotlib.imshow()</code></p>\n<pre><code>import matplotlib.pyplot as plt\nimport pydicom\nimg = pydicom.dcmread('../path/to/file.dcm')\nplt.imshow(img.pixel_array, cmap='gray')\n</code></pre>",
      "votes": null,
      "replies": [
        {
          "id": 1372833,
          "author_name": "fahimmahmudjoy",
          "author_url": "",
          "post_date": "07/02/2021 04:31:53",
          "content": "<p>Thanks a lot for the suggestion. It worked.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1372861,
      "author_name": "yash10kundu",
      "author_url": "",
      "post_date": "07/02/2021 05:09:46",
      "content": "<p>Brother, the get_testdata_file() method is used to get the filenames of images in a test set that comes with pydicom. It's not used for loading external files.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1372863,
      "author_name": "yash10kundu",
      "author_url": "",
      "post_date": "07/02/2021 05:11:04",
      "content": "<p>You'll need to use something <strong>pydicom.dcmread()</strong> to load a DICOM file.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1379157,
          "author_name": "fahimmahmudjoy",
          "author_url": "",
          "post_date": "07/07/2021 06:20:48",
          "content": "<p>Appreciate the help.<br>\nThanks!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1372864,
      "author_name": "yash10kundu",
      "author_url": "",
      "post_date": "07/02/2021 05:12:07",
      "content": "<p>I hope it's useful for you..😊😊</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1372538": "Hi there good people,\nAs far as I understand, I have to read the DICOM files from the training set and make a prediction on the four classes as well as a bounding box. I am new to DICOM format and having None output while trying to read a file. I have added my code below:\n\n*import pydicom\nfrom pydicom.data import get_testdata_file\n\nfilename = get_testdata_file(\"../input/siim-covid19-detection/test/00188a671292/3eb5a506ccf3/3dcdfc352a06.dcm\")\n\nprint(filename)\n\noutput: None*\n\nWhat am I doing wrong here?\nThanks in advance :)",
    "1372549": "The `get_testdata_file()` method is used to get the filenames of images in a test set that comes with pydicom. It's not used for loading external files.\n\nYou'll need to use something `pydicom.dcmread()` to load a DICOM file. Then you can visualize it with `matplotlib.imshow()`\n\n```\nimport matplotlib.pyplot as plt\nimport pydicom\nimg = pydicom.dcmread('../path/to/file.dcm')\nplt.imshow(img.pixel_array, cmap='gray')\n```",
    "1372833": "Thanks a lot for the suggestion. It worked.",
    "1372861": "Brother, the get_testdata_file() method is used to get the filenames of images in a test set that comes with pydicom. It's not used for loading external files.",
    "1372863": "You'll need to use something **pydicom.dcmread()** to load a DICOM file.",
    "1372864": "I hope it's useful for you..😊😊",
    "1379157": "Appreciate the help.\nThanks!"
  },
  "source": "meta"
}