# How to get the window width and window level of DICOM file, and set VR data to display only bones according to the window width and window level.

**URL:** https://discourse.itk.org/t/how-to-get-the-window-width-and-window-level-of-dicom-file-and-set-vr-data-to-display-only-bones-according-to-the-window-width-and-window-level/4045
**Category:** Uncategorized
**Tags:** dicom, itk-releases, itk-4122
**Created:** [April 19, 2021, 7:13am UTC](https://discourse.itk.org/t/how-to-get-the-window-width-and-window-level-of-dicom-file-and-set-vr-data-to-display-only-bones-according-to-the-window-width-and-window-level/4045 "2021-04-19T07:13:03Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 19, 2021, 1:38pm UTC](https://discourse.itk.org/t/how-to-get-the-window-width-and-window-level-of-dicom-file-and-set-vr-data-to-display-only-bones-according-to-the-window-width-and-window-level/4045/2 "2021-04-19T13:38:23Z")

</div>

[This example](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/IO/DicomImageReadPrintTags.cxx) shows how to get DICOM tags. In Python it is even easier: `image["0010|0010"]`.

> display only bones

As ITK does not deal with visualization, you will need to consult your visualization library for this.

You should also read this short thread:

> [@Transform Hounsfield unit to intensity values](https://discourse.itk.org/t/transform-hounsfield-unit-to-intensity-values/2818/2):
>
> Windowing transforms intensities from one range to another, for example from 1000-1900 into 0-255 in order to display CT pixels on regular screens. Values outside the range map to endpoints: -1000, 0, 200 and 999 all map to 0, while 1901, 3000 and 25000 all map to 255. Window is the width of the range (901 in the example above) and level is center of the range (1450.5 in the example). Therefore, window and level need a range to exist, they are not defined for a single value.

---

_[View the full topic](https://discourse.itk.org/t/how-to-get-the-window-width-and-window-level-of-dicom-file-and-set-vr-data-to-display-only-bones-according-to-the-window-width-and-window-level/4045)._
