{
  "id": 207813,
  "title": "Patient Metadata from DICOM Format",
  "url": "/competitions/vinbigdata-chest-xray-abnormalities-detection/discussion/207813",
  "author_name": "Ultron",
  "post_date": "2020-12-31T11:23:51.371000",
  "votes": 5,
  "comment_count": 4,
  "views": 0,
  "content": "<p>As confirmed by the organizers, we have all unique patients in the dataset, i.e. there is one-one mapping among image_ids and patients. Do correct me If I am wrong.</p>\n<p>And upon reading the Dicom file, we have the following information about the patients:</p>\n<p>Code snippet:</p>\n<pre><code>sample_fn = train_df.image_id.to_list()[random.randint(0, len(train_df))]\nsample = pdc.read_file(os.path.join(train_dir, sample_fn + \".dicom\"))\nsample\n</code></pre>\n<p>Output Snippet:</p>\n<pre><code>Dataset.file_meta -------------------------------\n(0002, 0000) File Meta Information Group Length  UL: 156\n(0002, 0001) File Meta Information Version       OB: b'\\x00\\x01'\n(0002, 0002) Media Storage SOP Class UID         UI: Digital X-Ray Image Storage - For Presentation\n(0002, 0003) Media Storage SOP Instance UID      UI: 30292747f6799a93b20e1f9e67be0c67\n(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian\n(0002, 0012) Implementation Class UID            UI: 1.2.3.4\n(0002, 0013) Implementation Version Name         SH: ''\n(0002, 0016) Source Application Entity Title     AE: 'VITREA1'\n-------------------------------------------------\n(0010, 0040) Patient's Sex                       CS: ''\n(0028, 0002) Samples per Pixel                   US: 1\n(0028, 0004) Photometric Interpretation          CS: 'MONOCHROME2'\n(0028, 0010) Rows                                US: 3078\n(0028, 0011) Columns                             US: 2441\n(0028, 0030) Pixel Spacing                       DS: [0.125, 0.125]\n(0028, 0100) Bits Allocated                      US: 16\n(0028, 0101) Bits Stored                         US: 12\n(0028, 0102) High Bit                            US: 11\n(0028, 0103) Pixel Representation                US: 0\n(0028, 1050) Window Center                       DS: \"2085.0\"\n(0028, 1051) Window Width                        DS: \"4082.0\"\n(0028, 1052) Rescale Intercept                   DS: \"0.0\"\n(0028, 1053) Rescale Slope                       DS: \"1.0\"\n(0028, 2110) Lossy Image Compression             CS: '00'\n(7fe0, 0010) Pixel Data                          OW: Array of 15026796 elements\n</code></pre>\n<ul>\n<li>Patient's Sex      </li>\n<li>Patient's Age                </li>\n<li>Samples per Pixel                 </li>\n<li>Photometric Interpretation   </li>\n<li>Number of Frames      </li>\n<li>Rows                               </li>\n<li>Columns                          </li>\n<li>Pixel Spacing                      </li>\n<li>Bits Allocated                      </li>\n<li>Bits Stored                         </li>\n<li>High Bit                            </li>\n<li>Pixel Representation             </li>\n<li>Window Center                       </li>\n<li>Window Width                      </li>\n<li>Rescale Intercept                   </li>\n<li>Rescale Slope                       </li>\n<li>Lossy Image Compression </li>\n<li>Lossy Image Compression Ratio</li>\n<li>Lossy Image Compression Method</li>\n<li>Pixel Data                         </li>\n</ul>\n<p>EDIT1: Updated <code>Patient's Age</code>, <code>Number of Frames</code>, <code>Lossy Image Compression Ratio</code> and <code>Lossy Image Compression Method</code> for image id <code>063319de25ce7edb9b1c6b8881290140</code>. credits: <a href=\"https://www.kaggle.com/yerramvarun\" target=\"_blank\">@yerramvarun</a> </p>\n<p>Do let me know about the extensions in the comment section until I update it myself in the next version :)*</p>",
  "messages": [
    {
      "id": 1133605,
      "postDate": "2020-12-31T11:23:51.370Z",
      "content": "<p>As confirmed by the organizers, we have all unique patients in the dataset, i.e. there is one-one mapping among image_ids and patients. Do correct me If I am wrong.</p>\n<p>And upon reading the Dicom file, we have the following information about the patients:</p>\n<p>Code snippet:</p>\n<pre><code>sample_fn = train_df.image_id.to_list()[random.randint(0, len(train_df))]\nsample = pdc.read_file(os.path.join(train_dir, sample_fn + \".dicom\"))\nsample\n</code></pre>\n<p>Output Snippet:</p>\n<pre><code>Dataset.file_meta -------------------------------\n(0002, 0000) File Meta Information Group Length  UL: 156\n(0002, 0001) File Meta Information Version       OB: b'\\x00\\x01'\n(0002, 0002) Media Storage SOP Class UID         UI: Digital X-Ray Image Storage - For Presentation\n(0002, 0003) Media Storage SOP Instance UID      UI: 30292747f6799a93b20e1f9e67be0c67\n(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian\n(0002, 0012) Implementation Class UID            UI: 1.2.3.4\n(0002, 0013) Implementation Version Name         SH: ''\n(0002, 0016) Source Application Entity Title     AE: 'VITREA1'\n-------------------------------------------------\n(0010, 0040) Patient's Sex                       CS: ''\n(0028, 0002) Samples per Pixel                   US: 1\n(0028, 0004) Photometric Interpretation          CS: 'MONOCHROME2'\n(0028, 0010) Rows                                US: 3078\n(0028, 0011) Columns                             US: 2441\n(0028, 0030) Pixel Spacing                       DS: [0.125, 0.125]\n(0028, 0100) Bits Allocated                      US: 16\n(0028, 0101) Bits Stored                         US: 12\n(0028, 0102) High Bit                            US: 11\n(0028, 0103) Pixel Representation                US: 0\n(0028, 1050) Window Center                       DS: \"2085.0\"\n(0028, 1051) Window Width                        DS: \"4082.0\"\n(0028, 1052) Rescale Intercept                   DS: \"0.0\"\n(0028, 1053) Rescale Slope                       DS: \"1.0\"\n(0028, 2110) Lossy Image Compression             CS: '00'\n(7fe0, 0010) Pixel Data                          OW: Array of 15026796 elements\n</code></pre>\n<ul>\n<li>Patient's Sex      </li>\n<li>Patient's Age                </li>\n<li>Samples per Pixel                 </li>\n<li>Photometric Interpretation   </li>\n<li>Number of Frames      </li>\n<li>Rows                               </li>\n<li>Columns                          </li>\n<li>Pixel Spacing                      </li>\n<li>Bits Allocated                      </li>\n<li>Bits Stored                         </li>\n<li>High Bit                            </li>\n<li>Pixel Representation             </li>\n<li>Window Center                       </li>\n<li>Window Width                      </li>\n<li>Rescale Intercept                   </li>\n<li>Rescale Slope                       </li>\n<li>Lossy Image Compression </li>\n<li>Lossy Image Compression Ratio</li>\n<li>Lossy Image Compression Method</li>\n<li>Pixel Data                         </li>\n</ul>\n<p>EDIT1: Updated <code>Patient's Age</code>, <code>Number of Frames</code>, <code>Lossy Image Compression Ratio</code> and <code>Lossy Image Compression Method</code> for image id <code>063319de25ce7edb9b1c6b8881290140</code>. credits: <a href=\"https://www.kaggle.com/yerramvarun\" target=\"_blank\">@yerramvarun</a> </p>\n<p>Do let me know about the extensions in the comment section until I update it myself in the next version :)*</p>",
      "rawMarkdown": "As confirmed by the organizers, we have all unique patients in the dataset, i.e. there is one-one mapping among image_ids and patients. Do correct me If I am wrong.\n\nAnd upon reading the Dicom file, we have the following information about the patients:\n\nCode snippet:\n```\nsample_fn = train_df.image_id.to_list()[random.randint(0, len(train_df))]\nsample = pdc.read_file(os.path.join(train_dir, sample_fn + \".dicom\"))\nsample\n```\nOutput Snippet:\n```\nDataset.file_meta -------------------------------\n(0002, 0000) File Meta Information Group Length  UL: 156\n(0002, 0001) File Meta Information Version       OB: b'\\x00\\x01'\n(0002, 0002) Media Storage SOP Class UID         UI: Digital X-Ray Image Storage - For Presentation\n(0002, 0003) Media Storage SOP Instance UID      UI: 30292747f6799a93b20e1f9e67be0c67\n(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian\n(0002, 0012) Implementation Class UID            UI: 1.2.3.4\n(0002, 0013) Implementation Version Name         SH: ''\n(0002, 0016) Source Application Entity Title     AE: 'VITREA1'\n-------------------------------------------------\n(0010, 0040) Patient's Sex                       CS: ''\n(0028, 0002) Samples per Pixel                   US: 1\n(0028, 0004) Photometric Interpretation          CS: 'MONOCHROME2'\n(0028, 0010) Rows                                US: 3078\n(0028, 0011) Columns                             US: 2441\n(0028, 0030) Pixel Spacing                       DS: [0.125, 0.125]\n(0028, 0100) Bits Allocated                      US: 16\n(0028, 0101) Bits Stored                         US: 12\n(0028, 0102) High Bit                            US: 11\n(0028, 0103) Pixel Representation                US: 0\n(0028, 1050) Window Center                       DS: \"2085.0\"\n(0028, 1051) Window Width                        DS: \"4082.0\"\n(0028, 1052) Rescale Intercept                   DS: \"0.0\"\n(0028, 1053) Rescale Slope                       DS: \"1.0\"\n(0028, 2110) Lossy Image Compression             CS: '00'\n(7fe0, 0010) Pixel Data                          OW: Array of 15026796 elements\n```\n- Patient's Sex      \n- Patient's Age                \n- Samples per Pixel                 \n- Photometric Interpretation   \n- Number of Frames      \n- Rows                               \n- Columns                          \n- Pixel Spacing                      \n- Bits Allocated                      \n- Bits Stored                         \n- High Bit                            \n- Pixel Representation             \n- Window Center                       \n- Window Width                      \n- Rescale Intercept                   \n- Rescale Slope                       \n- Lossy Image Compression \n- Lossy Image Compression Ratio\n- Lossy Image Compression Method\n- Pixel Data                         \n\nEDIT1: Updated `Patient's Age`, `Number of Frames`, `Lossy Image Compression Ratio` and `Lossy Image Compression Method` for image id `063319de25ce7edb9b1c6b8881290140`. credits: @yerramvarun \n\nDo let me know about the extensions in the comment section until I update it myself in the next version :)*",
      "votes": 5
    },
    {
      "id": 1133645,
      "postDate": "2020-12-31T11:59:56.447Z",
      "content": "<p>Some of the dicom files also have Patient Age Attribute - </p>\n<pre><code>Image ID  063319de25ce7edb9b1c6b8881290140\nDataset.file_meta -------------------------------\n(0002, 0000) File Meta Information Group Length  UL: 154\n(0002, 0001) File Meta Information Version       OB: b'\\x00\\x01'\n(0002, 0002) Media Storage SOP Class UID         UI: Computed Radiography Image Storage\n(0002, 0003) Media Storage SOP Instance UID      UI: 063319de25ce7edb9b1c6b8881290140\n(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian\n(0002, 0012) Implementation Class UID            UI: 1.2.3.4\n(0002, 0013) Implementation Version Name         SH: 'OFFIS_DCMTK_360'\n-------------------------------------------------\n(0010, 0040) Patient's Sex                       CS: 'F'\n(0010, 1010) Patient's Age                       AS: '022Y'\n(0028, 0002) Samples per Pixel                   US: 1\n(0028, 0004) Photometric Interpretation          CS: 'MONOCHROME2'\n(0028, 0008) Number of Frames                    IS: \"1\"\n(0028, 0010) Rows                                US: 3072\n(0028, 0011) Columns                             US: 2540\n(0028, 0030) Pixel Spacing                       DS: [0.140, 0.140]\n(0028, 0034) Pixel Aspect Ratio                  IS: None\n(0028, 0100) Bits Allocated                      US: 16\n(0028, 0101) Bits Stored                         US: 14\n(0028, 0102) High Bit                            US: 13\n(0028, 0103) Pixel Representation                US: 0\n(0028, 1050) Window Center                       DS: \"8375.0\"\n(0028, 1051) Window Width                        DS: \"8948.0\"\n(0028, 2110) Lossy Image Compression             CS: ''\n(0028, 2112) Lossy Image Compression Ratio       DS: None\n(0028, 2114) Lossy Image Compression Method      CS: ''\n(7fe0, 0010) Pixel Data                          OW: Array of 15605760 elements\n</code></pre>",
      "rawMarkdown": "Some of the dicom files also have Patient Age Attribute - \n```\nImage ID  063319de25ce7edb9b1c6b8881290140\nDataset.file_meta -------------------------------\n(0002, 0000) File Meta Information Group Length  UL: 154\n(0002, 0001) File Meta Information Version       OB: b'\\x00\\x01'\n(0002, 0002) Media Storage SOP Class UID         UI: Computed Radiography Image Storage\n(0002, 0003) Media Storage SOP Instance UID      UI: 063319de25ce7edb9b1c6b8881290140\n(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian\n(0002, 0012) Implementation Class UID            UI: 1.2.3.4\n(0002, 0013) Implementation Version Name         SH: 'OFFIS_DCMTK_360'\n-------------------------------------------------\n(0010, 0040) Patient's Sex                       CS: 'F'\n(0010, 1010) Patient's Age                       AS: '022Y'\n(0028, 0002) Samples per Pixel                   US: 1\n(0028, 0004) Photometric Interpretation          CS: 'MONOCHROME2'\n(0028, 0008) Number of Frames                    IS: \"1\"\n(0028, 0010) Rows                                US: 3072\n(0028, 0011) Columns                             US: 2540\n(0028, 0030) Pixel Spacing                       DS: [0.140, 0.140]\n(0028, 0034) Pixel Aspect Ratio                  IS: None\n(0028, 0100) Bits Allocated                      US: 16\n(0028, 0101) Bits Stored                         US: 14\n(0028, 0102) High Bit                            US: 13\n(0028, 0103) Pixel Representation                US: 0\n(0028, 1050) Window Center                       DS: \"8375.0\"\n(0028, 1051) Window Width                        DS: \"8948.0\"\n(0028, 2110) Lossy Image Compression             CS: ''\n(0028, 2112) Lossy Image Compression Ratio       DS: None\n(0028, 2114) Lossy Image Compression Method      CS: ''\n(7fe0, 0010) Pixel Data                          OW: Array of 15605760 elements\n```",
      "votes": 1,
      "replies": [
        {
          "id": 1133649,
          "postDate": "2020-12-31T12:03:38.990Z",
          "content": "<p>Yeah, and <code>Number of Frames</code>, <code>Lossy Image Compression Ratio</code> and <code>Lossy Image Compression Method</code> are there too. Let's see what else comes with time, it seems really interesting to explore and dive deeper into the attributes.</p>",
          "rawMarkdown": "Yeah, and `Number of Frames`, `Lossy Image Compression Ratio` and `Lossy Image Compression Method` are there too. Let's see what else comes with time, it seems really interesting to explore and dive deeper into the attributes.",
          "votes": 1
        },
        {
          "id": 1133751,
          "postDate": "2020-12-31T13:51:19.150Z",
          "content": "<p>Yes. It will be interesting to see how we can use the Image data along with the dicom data to predict the final output.</p>",
          "rawMarkdown": "Yes. It will be interesting to see how we can use the Image data along with the dicom data to predict the final output.",
          "votes": 1
        }
      ]
    },
    {
      "id": 1138788,
      "postDate": "2021-01-05T01:08:37.580Z",
      "content": "<p>The age attribute is there, however, it needs some cleaning. For example <code>008Y</code> suggests the patient is 8 years old, however, we've been told that the dataset contains only adults. Also ages of <code>000Y</code> exist, and in some cases, the age attribute is missing altogether from the dicom file. To access the age attribute, I usually do:</p>\n<pre><code>age = dicom[0x10, 0x1010].value if [0x10, 0x1010] in dicom else \"\"\n</code></pre>\n<p>The sex attribute you have to be careful with as well. All of the records have that attribute, so you can do:</p>\n<pre><code>sex = dicom[0x10, 0x40]\n</code></pre>\n<p>I've recorded values <code>M</code>, <code>F</code>, <code>O</code> or the empty string. </p>",
      "rawMarkdown": "The age attribute is there, however, it needs some cleaning. For example `008Y` suggests the patient is 8 years old, however, we've been told that the dataset contains only adults. Also ages of `000Y` exist, and in some cases, the age attribute is missing altogether from the dicom file. To access the age attribute, I usually do:\n\n    age = dicom[0x10, 0x1010].value if [0x10, 0x1010] in dicom else \"\"\n\nThe sex attribute you have to be careful with as well. All of the records have that attribute, so you can do:\n\n    sex = dicom[0x10, 0x40]\n\n I've recorded values `M`, `F`, `O` or the empty string. "
    }
  ],
  "comments": [
    {
      "id": 1133645,
      "author_name": "Yerram Varun",
      "author_url": "",
      "post_date": "2020-12-31T11:59:56.447000",
      "content": "<p>Some of the dicom files also have Patient Age Attribute - </p>\n<pre><code>Image ID  063319de25ce7edb9b1c6b8881290140\nDataset.file_meta -------------------------------\n(0002, 0000) File Meta Information Group Length  UL: 154\n(0002, 0001) File Meta Information Version       OB: b'\\x00\\x01'\n(0002, 0002) Media Storage SOP Class UID         UI: Computed Radiography Image Storage\n(0002, 0003) Media Storage SOP Instance UID      UI: 063319de25ce7edb9b1c6b8881290140\n(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian\n(0002, 0012) Implementation Class UID            UI: 1.2.3.4\n(0002, 0013) Implementation Version Name         SH: 'OFFIS_DCMTK_360'\n-------------------------------------------------\n(0010, 0040) Patient's Sex                       CS: 'F'\n(0010, 1010) Patient's Age                       AS: '022Y'\n(0028, 0002) Samples per Pixel                   US: 1\n(0028, 0004) Photometric Interpretation          CS: 'MONOCHROME2'\n(0028, 0008) Number of Frames                    IS: \"1\"\n(0028, 0010) Rows                                US: 3072\n(0028, 0011) Columns                             US: 2540\n(0028, 0030) Pixel Spacing                       DS: [0.140, 0.140]\n(0028, 0034) Pixel Aspect Ratio                  IS: None\n(0028, 0100) Bits Allocated                      US: 16\n(0028, 0101) Bits Stored                         US: 14\n(0028, 0102) High Bit                            US: 13\n(0028, 0103) Pixel Representation                US: 0\n(0028, 1050) Window Center                       DS: \"8375.0\"\n(0028, 1051) Window Width                        DS: \"8948.0\"\n(0028, 2110) Lossy Image Compression             CS: ''\n(0028, 2112) Lossy Image Compression Ratio       DS: None\n(0028, 2114) Lossy Image Compression Method      CS: ''\n(7fe0, 0010) Pixel Data                          OW: Array of 15605760 elements\n</code></pre>",
      "votes": 1,
      "replies": [
        {
          "id": 1133649,
          "author_name": "Ultron",
          "author_url": "",
          "post_date": "2020-12-31T12:03:38.990000",
          "content": "<p>Yeah, and <code>Number of Frames</code>, <code>Lossy Image Compression Ratio</code> and <code>Lossy Image Compression Method</code> are there too. Let's see what else comes with time, it seems really interesting to explore and dive deeper into the attributes.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1133751,
          "author_name": "Yerram Varun",
          "author_url": "",
          "post_date": "2020-12-31T13:51:19.150000",
          "content": "<p>Yes. It will be interesting to see how we can use the Image data along with the dicom data to predict the final output.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1138788,
      "author_name": "Craig Thomas",
      "author_url": "",
      "post_date": "2021-01-05T01:08:37.580000",
      "content": "<p>The age attribute is there, however, it needs some cleaning. For example <code>008Y</code> suggests the patient is 8 years old, however, we've been told that the dataset contains only adults. Also ages of <code>000Y</code> exist, and in some cases, the age attribute is missing altogether from the dicom file. To access the age attribute, I usually do:</p>\n<pre><code>age = dicom[0x10, 0x1010].value if [0x10, 0x1010] in dicom else \"\"\n</code></pre>\n<p>The sex attribute you have to be careful with as well. All of the records have that attribute, so you can do:</p>\n<pre><code>sex = dicom[0x10, 0x40]\n</code></pre>\n<p>I've recorded values <code>M</code>, <code>F</code>, <code>O</code> or the empty string. </p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1133605": "As confirmed by the organizers, we have all unique patients in the dataset, i.e. there is one-one mapping among image_ids and patients. Do correct me If I am wrong.\n\nAnd upon reading the Dicom file, we have the following information about the patients:\n\nCode snippet:\n```\nsample_fn = train_df.image_id.to_list()[random.randint(0, len(train_df))]\nsample = pdc.read_file(os.path.join(train_dir, sample_fn + \".dicom\"))\nsample\n```\nOutput Snippet:\n```\nDataset.file_meta -------------------------------\n(0002, 0000) File Meta Information Group Length  UL: 156\n(0002, 0001) File Meta Information Version       OB: b'\\x00\\x01'\n(0002, 0002) Media Storage SOP Class UID         UI: Digital X-Ray Image Storage - For Presentation\n(0002, 0003) Media Storage SOP Instance UID      UI: 30292747f6799a93b20e1f9e67be0c67\n(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian\n(0002, 0012) Implementation Class UID            UI: 1.2.3.4\n(0002, 0013) Implementation Version Name         SH: ''\n(0002, 0016) Source Application Entity Title     AE: 'VITREA1'\n-------------------------------------------------\n(0010, 0040) Patient's Sex                       CS: ''\n(0028, 0002) Samples per Pixel                   US: 1\n(0028, 0004) Photometric Interpretation          CS: 'MONOCHROME2'\n(0028, 0010) Rows                                US: 3078\n(0028, 0011) Columns                             US: 2441\n(0028, 0030) Pixel Spacing                       DS: [0.125, 0.125]\n(0028, 0100) Bits Allocated                      US: 16\n(0028, 0101) Bits Stored                         US: 12\n(0028, 0102) High Bit                            US: 11\n(0028, 0103) Pixel Representation                US: 0\n(0028, 1050) Window Center                       DS: \"2085.0\"\n(0028, 1051) Window Width                        DS: \"4082.0\"\n(0028, 1052) Rescale Intercept                   DS: \"0.0\"\n(0028, 1053) Rescale Slope                       DS: \"1.0\"\n(0028, 2110) Lossy Image Compression             CS: '00'\n(7fe0, 0010) Pixel Data                          OW: Array of 15026796 elements\n```\n- Patient's Sex      \n- Patient's Age                \n- Samples per Pixel                 \n- Photometric Interpretation   \n- Number of Frames      \n- Rows                               \n- Columns                          \n- Pixel Spacing                      \n- Bits Allocated                      \n- Bits Stored                         \n- High Bit                            \n- Pixel Representation             \n- Window Center                       \n- Window Width                      \n- Rescale Intercept                   \n- Rescale Slope                       \n- Lossy Image Compression \n- Lossy Image Compression Ratio\n- Lossy Image Compression Method\n- Pixel Data                         \n\nEDIT1: Updated `Patient's Age`, `Number of Frames`, `Lossy Image Compression Ratio` and `Lossy Image Compression Method` for image id `063319de25ce7edb9b1c6b8881290140`. credits: @yerramvarun \n\nDo let me know about the extensions in the comment section until I update it myself in the next version :)*",
    "1133645": "Some of the dicom files also have Patient Age Attribute - \n```\nImage ID  063319de25ce7edb9b1c6b8881290140\nDataset.file_meta -------------------------------\n(0002, 0000) File Meta Information Group Length  UL: 154\n(0002, 0001) File Meta Information Version       OB: b'\\x00\\x01'\n(0002, 0002) Media Storage SOP Class UID         UI: Computed Radiography Image Storage\n(0002, 0003) Media Storage SOP Instance UID      UI: 063319de25ce7edb9b1c6b8881290140\n(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian\n(0002, 0012) Implementation Class UID            UI: 1.2.3.4\n(0002, 0013) Implementation Version Name         SH: 'OFFIS_DCMTK_360'\n-------------------------------------------------\n(0010, 0040) Patient's Sex                       CS: 'F'\n(0010, 1010) Patient's Age                       AS: '022Y'\n(0028, 0002) Samples per Pixel                   US: 1\n(0028, 0004) Photometric Interpretation          CS: 'MONOCHROME2'\n(0028, 0008) Number of Frames                    IS: \"1\"\n(0028, 0010) Rows                                US: 3072\n(0028, 0011) Columns                             US: 2540\n(0028, 0030) Pixel Spacing                       DS: [0.140, 0.140]\n(0028, 0034) Pixel Aspect Ratio                  IS: None\n(0028, 0100) Bits Allocated                      US: 16\n(0028, 0101) Bits Stored                         US: 14\n(0028, 0102) High Bit                            US: 13\n(0028, 0103) Pixel Representation                US: 0\n(0028, 1050) Window Center                       DS: \"8375.0\"\n(0028, 1051) Window Width                        DS: \"8948.0\"\n(0028, 2110) Lossy Image Compression             CS: ''\n(0028, 2112) Lossy Image Compression Ratio       DS: None\n(0028, 2114) Lossy Image Compression Method      CS: ''\n(7fe0, 0010) Pixel Data                          OW: Array of 15605760 elements\n```",
    "1138788": "The age attribute is there, however, it needs some cleaning. For example `008Y` suggests the patient is 8 years old, however, we've been told that the dataset contains only adults. Also ages of `000Y` exist, and in some cases, the age attribute is missing altogether from the dicom file. To access the age attribute, I usually do:\n\n    age = dicom[0x10, 0x1010].value if [0x10, 0x1010] in dicom else \"\"\n\nThe sex attribute you have to be careful with as well. All of the records have that attribute, so you can do:\n\n    sex = dicom[0x10, 0x40]\n\n I've recorded values `M`, `F`, `O` or the empty string. "
  }
}