MulaiMulai sekarang secara gratis

Translations

In this chapter, we'll leverage data use data from the Open Access Series of Imaging Studies to compare the brains of different populations: young and old, male and female, healthy and diseased.

To start, center a single slice of a 3D brain volume (im). First, find the center point in the image array and the center of mass of the brain. Then, translate the image to the center.

This chapter's exercises have all had the following imports:

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

Latihan ini adalah bagian dari kursus

Biomedical Image Analysis in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Find image center of mass
com = ____

# Calculate amount of shift needed
d0 = 128 - _____
d1 = ____

# Translate the brain towards the center
xfm = ndi.shift(____, shift=____)
Edit dan Jalankan Kode