Comece agoraComece grátis

Segment the heart

In this chapter, we'll work with magnetic resonance (MR) imaging data from the Sunnybrook Cardiac Dataset. The full image is a 3D time series spanning a single heartbeat. These data are used by radiologists to measure the ejection fraction: the proportion of blood ejected from the left ventricle during each stroke.

To begin, segment the left ventricle from a single slice of the volume (im). First, you'll filter and mask the image; then you'll label each object with ndi.label().

This chapter's exercises have the following imports:

import imageio.v2 as imageio
import numpy as np
import scipy.ndimage as ndi
import matplotlib.pyplot as plt

Este exercicio faz parte do curso

Biomedical Image Analysis in Python

Ver curso

exercicio interativo prático

Tente este exercicio completando este código de exemplo.

# Smooth intensity values
im_filt = ____

# Select high-intensity pixels
mask_start = np.where(____, 1, 0)
mask = ____

# Label the objects in "mask"
labels, nlabels = ____
print('Num. Labels:', ____)
Editar e Executar Código