{
  "id": 18552,
  "title": "Interpreting DICOM files in R?",
  "url": "/competitions/second-annual-data-science-bowl/discussion/18552",
  "author_name": "",
  "post_date": "2016-01-25T01:59:37.057Z",
  "votes": null,
  "comment_count": 2,
  "views": 903,
  "content": "<p>Hello,</p>\n\n<p>I am a new Kaggle(r), so please forgive my inexperience; I have read-in a DICOM image file within R, and I am trying to understand the attributes within it. The structure of the file is: </p>\n\n<pre><code>List of 2\n $ hdr:'data.frame':\t91 obs. of  7 variables:\n      ..$ group   : chr [1:91] &quot;0002&quot; &quot;0002&quot; &quot;0002&quot; &quot;0002&quot; ...\n  ..$ element : chr [1:91] &quot;0000&quot; &quot;0001&quot; &quot;0002&quot; &quot;0003&quot; ...\n      ..$ name    : chr [1:91] &quot;GroupLength&quot; &quot;FileMetaInformationVersion&quot; &quot;MediaStorageSOPClassUID&quot; &quot;MediaStorageSOPInstanceUID&quot; ...\n  ..$ code    : chr [1:91] &quot;UL&quot; &quot;OB&quot; &quot;UI&quot; &quot;UI&quot; ...\n      ..$ length  : chr [1:91] &quot;4&quot; &quot;2&quot; &quot;26&quot; &quot;64&quot; ...\n  ..$ value   : chr [1:91] &quot;216&quot; &quot;\\001&quot; &quot;1.2.840.10008.5.1.4.1.1.4&quot; &quot;1.3.6.1.4.1.9590.100.1.2.88326266112102283316010794751441793851&quot; ...\n      ..$ sequence: chr [1:91] &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; ...\n $ img: int [1:256, 1:230] 0 0 0 0 0 0 0 0 0 0 ...\n</code></pre>\n\n<p>My initial thoughts are that everything within the hdr dataframe is mainly just qualitative information that is not relevant for the semantic segmentation of the image. This leads me to believe the img field is representative of the actual DICOM image itself; does anybody know what the cells in the 256 X 256 img represent? Or know how to interpret the values in the matrix? Any help would be greatly appreciated!</p>",
  "messages": [
    {
      "id": "105593",
      "postDate": "01/25/2016 01:59:37",
      "content": "<p>Hello,</p>\n\n<p>I am a new Kaggle(r), so please forgive my inexperience; I have read-in a DICOM image file within R, and I am trying to understand the attributes within it. The structure of the file is: </p>\n\n<pre><code>List of 2\n $ hdr:'data.frame':\t91 obs. of  7 variables:\n      ..$ group   : chr [1:91] &quot;0002&quot; &quot;0002&quot; &quot;0002&quot; &quot;0002&quot; ...\n  ..$ element : chr [1:91] &quot;0000&quot; &quot;0001&quot; &quot;0002&quot; &quot;0003&quot; ...\n      ..$ name    : chr [1:91] &quot;GroupLength&quot; &quot;FileMetaInformationVersion&quot; &quot;MediaStorageSOPClassUID&quot; &quot;MediaStorageSOPInstanceUID&quot; ...\n  ..$ code    : chr [1:91] &quot;UL&quot; &quot;OB&quot; &quot;UI&quot; &quot;UI&quot; ...\n      ..$ length  : chr [1:91] &quot;4&quot; &quot;2&quot; &quot;26&quot; &quot;64&quot; ...\n  ..$ value   : chr [1:91] &quot;216&quot; &quot;\\001&quot; &quot;1.2.840.10008.5.1.4.1.1.4&quot; &quot;1.3.6.1.4.1.9590.100.1.2.88326266112102283316010794751441793851&quot; ...\n      ..$ sequence: chr [1:91] &quot;&quot; &quot;&quot; &quot;&quot; &quot;&quot; ...\n $ img: int [1:256, 1:230] 0 0 0 0 0 0 0 0 0 0 ...\n</code></pre>\n\n<p>My initial thoughts are that everything within the hdr dataframe is mainly just qualitative information that is not relevant for the semantic segmentation of the image. This leads me to believe the img field is representative of the actual DICOM image itself; does anybody know what the cells in the 256 X 256 img represent? Or know how to interpret the values in the matrix? Any help would be greatly appreciated!</p>",
      "rawMarkdown": "Hello,\r\n\r\nI am a new Kaggle(r), so please forgive my inexperience; I have read-in a DICOM image file within R, and I am trying to understand the attributes within it. The structure of the file is: \r\n\r\n    List of 2\r\n     $ hdr:'data.frame':\t91 obs. of  7 variables:\r\n      ..$ group   : chr [1:91] \"0002\" \"0002\" \"0002\" \"0002\" ...\r\n      ..$ element : chr [1:91] \"0000\" \"0001\" \"0002\" \"0003\" ...\r\n      ..$ name    : chr [1:91] \"GroupLength\" \"FileMetaInformationVersion\" \"MediaStorageSOPClassUID\" \"MediaStorageSOPInstanceUID\" ...\r\n      ..$ code    : chr [1:91] \"UL\" \"OB\" \"UI\" \"UI\" ...\r\n      ..$ length  : chr [1:91] \"4\" \"2\" \"26\" \"64\" ...\r\n      ..$ value   : chr [1:91] \"216\" \"\\001\" \"1.2.840.10008.5.1.4.1.1.4\" \"1.3.6.1.4.1.9590.100.1.2.88326266112102283316010794751441793851\" ...\r\n      ..$ sequence: chr [1:91] \"\" \"\" \"\" \"\" ...\r\n     $ img: int [1:256, 1:230] 0 0 0 0 0 0 0 0 0 0 ...\r\n\r\nMy initial thoughts are that everything within the hdr dataframe is mainly just qualitative information that is not relevant for the semantic segmentation of the image. This leads me to believe the img field is representative of the actual DICOM image itself; does anybody know what the cells in the 256 X 256 img represent? Or know how to interpret the values in the matrix? Any help would be greatly appreciated!",
      "votes": null
    },
    {
      "id": "105742",
      "postDate": "01/26/2016 11:57:45",
      "content": "<p>Every information &quot;can be&quot; of relevance. </p>\n\n<p>img-data is the image data, you can plot it e.g. with the function contour or filled.contour. The higher a value is, the higher is the brightness at this point in the picture. </p>",
      "rawMarkdown": "Every information \"can be\" of relevance. \r\n\r\nimg-data is the image data, you can plot it e.g. with the function contour or filled.contour. The higher a value is, the higher is the brightness at this point in the picture.",
      "votes": null
    },
    {
      "id": "105752",
      "postDate": "01/26/2016 14:32:59",
      "content": "<p>You can try using the <strong>oro.dicom</strong> and <strong>EBImage</strong> packages for reading DICOM files resp image processing. You would do something like </p>\n\n<pre><code>dicom &lt;- readDICOMFile(f)\nimg &lt;- Image(normalize(dicom$img))\n</code></pre>\n\n<p>to get the data into a EBImage file for further processing.</p>\n\n<p>To extract meta info from the DICOM files, use something like:</p>\n\n<pre><code>dicomHeader &lt;- readDICOMFile(f, pixelData = FALSE)\npixelSpacing &lt;- extractHeader(dicomHeader$hdr, &quot;PixelSpacing&quot;, numeric=FALSE)\n</code></pre>",
      "rawMarkdown": "You can try using the **oro.dicom** and **EBImage** packages for reading DICOM files resp image processing. You would do something like \r\n\r\n    dicom <- readDICOMFile(f)\r\n    img <- Image(normalize(dicom$img))\r\n\r\nto get the data into a EBImage file for further processing.\r\n\r\nTo extract meta info from the DICOM files, use something like:\r\n\r\n    dicomHeader <- readDICOMFile(f, pixelData = FALSE)\r\n    pixelSpacing <- extractHeader(dicomHeader$hdr, \"PixelSpacing\", numeric=FALSE)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 105742,
      "author_name": "icedragon",
      "author_url": "",
      "post_date": "01/26/2016 11:57:45",
      "content": "<p>Every information &quot;can be&quot; of relevance. </p>\n\n<p>img-data is the image data, you can plot it e.g. with the function contour or filled.contour. The higher a value is, the higher is the brightness at this point in the picture. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 105752,
      "author_name": "operdeck",
      "author_url": "",
      "post_date": "01/26/2016 14:32:59",
      "content": "<p>You can try using the <strong>oro.dicom</strong> and <strong>EBImage</strong> packages for reading DICOM files resp image processing. You would do something like </p>\n\n<pre><code>dicom &lt;- readDICOMFile(f)\nimg &lt;- Image(normalize(dicom$img))\n</code></pre>\n\n<p>to get the data into a EBImage file for further processing.</p>\n\n<p>To extract meta info from the DICOM files, use something like:</p>\n\n<pre><code>dicomHeader &lt;- readDICOMFile(f, pixelData = FALSE)\npixelSpacing &lt;- extractHeader(dicomHeader$hdr, &quot;PixelSpacing&quot;, numeric=FALSE)\n</code></pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "105593": "Hello,\r\n\r\nI am a new Kaggle(r), so please forgive my inexperience; I have read-in a DICOM image file within R, and I am trying to understand the attributes within it. The structure of the file is: \r\n\r\n    List of 2\r\n     $ hdr:'data.frame':\t91 obs. of  7 variables:\r\n      ..$ group   : chr [1:91] \"0002\" \"0002\" \"0002\" \"0002\" ...\r\n      ..$ element : chr [1:91] \"0000\" \"0001\" \"0002\" \"0003\" ...\r\n      ..$ name    : chr [1:91] \"GroupLength\" \"FileMetaInformationVersion\" \"MediaStorageSOPClassUID\" \"MediaStorageSOPInstanceUID\" ...\r\n      ..$ code    : chr [1:91] \"UL\" \"OB\" \"UI\" \"UI\" ...\r\n      ..$ length  : chr [1:91] \"4\" \"2\" \"26\" \"64\" ...\r\n      ..$ value   : chr [1:91] \"216\" \"\\001\" \"1.2.840.10008.5.1.4.1.1.4\" \"1.3.6.1.4.1.9590.100.1.2.88326266112102283316010794751441793851\" ...\r\n      ..$ sequence: chr [1:91] \"\" \"\" \"\" \"\" ...\r\n     $ img: int [1:256, 1:230] 0 0 0 0 0 0 0 0 0 0 ...\r\n\r\nMy initial thoughts are that everything within the hdr dataframe is mainly just qualitative information that is not relevant for the semantic segmentation of the image. This leads me to believe the img field is representative of the actual DICOM image itself; does anybody know what the cells in the 256 X 256 img represent? Or know how to interpret the values in the matrix? Any help would be greatly appreciated!",
    "105742": "Every information \"can be\" of relevance. \r\n\r\nimg-data is the image data, you can plot it e.g. with the function contour or filled.contour. The higher a value is, the higher is the brightness at this point in the picture.",
    "105752": "You can try using the **oro.dicom** and **EBImage** packages for reading DICOM files resp image processing. You would do something like \r\n\r\n    dicom <- readDICOMFile(f)\r\n    img <- Image(normalize(dicom$img))\r\n\r\nto get the data into a EBImage file for further processing.\r\n\r\nTo extract meta info from the DICOM files, use something like:\r\n\r\n    dicomHeader <- readDICOMFile(f, pixelData = FALSE)\r\n    pixelSpacing <- extractHeader(dicomHeader$hdr, \"PixelSpacing\", numeric=FALSE)"
  },
  "source": "meta"
}