Session Ready
Exercise

Intensity

In this chapter, we will work with a hand radiograph from a 2017 Radiological Society of North America competition. X-ray absorption is highest in dense tissue such as bone, so the resulting intensities should be high. Consequently, images like this can be used to predict "bone age" in children.

To start, let's load the image and check its intensity range.

The image datatype determines the range of possible intensities: e.g., 8-bit unsigned integers (uint8) can take values in the range of 0 to 255. A colorbar can be helpful for connecting these values to the visualized image.

All exercises in this chapter have the following imports:

import imageio
import numpy as np
import matplotlib.pyplot as plt
Instructions
100 XP
  • Load the image "hand-xray.jpg" using imageio.
  • Print the image's data type (dtype), minimum (min()) and maximum intensity (max()).
  • Plot the image using plt.imshow(). Explicitly set the colormap's minimum (0) and maximum (255) values using the vmin and vmax arguments.
  • Add a colorbar using plt.colorbar(), then render the plot using the custom function format_and_render_plot(). This has been done for you.