1. Learn
  2. /
  3. Courses
  4. /
  5. Biomedical Image Analysis in Python

Exercise

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

Instructions 1/2

undefined XP
    1
    2
  • Find the center-point of im using ndi.center_of_mass().
  • Calculate the distance from the image center (128, 128), along each axis.
  • Use ndi.shift() to shift the data.