MulaiMulai sekarang secara gratis

Load images

In this chapter, we'll work with sections of a computed tomography (CT) scan from The Cancer Imaging Archive. CT uses a rotating X-ray tube to create a 3D image of the target area.

The actual content of the image depends on the instrument used: photographs measure visible light, x-ray and CT measure radiation absorbance, and MRI scanners measure magnetic fields.

To warm up, use the imageio package to load a single DICOM image from the scan volume and check out a few of its attributes.

Latihan ini adalah bagian dari kursus

Biomedical Image Analysis in Python

Lihat Kursus

Petunjuk latihan

  • Import imageio.
  • Read in the image "chest-220.dcm" using the imread() function.
  • Print the type() and shape (number of pixels) of im.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Import ImageIO
import ____

# Load "chest-220.dcm"
im = ____

# Print image attributes
print('Image type:', ____)
print('Shape of image array:', im.____)
Edit dan Jalankan Kode