1. Học hỏi
  2. /
  3. Khoa Học
  4. /
  5. Biomedical Image Analysis in Python

Connected

Bài tập

Rotations

In cases where an object is angled or flipped, the image can be rotated. Using ndi.rotate(), the image is rotated from its center by the specified degrees from the right horizontal axis.

For this exercise, shift and rotate the brain image (im) so that it is roughly level and "facing" the right side of the image.

Hướng dẫn

100 XP
  • Shift im towards the center: 20 pixels left and 20 pixels up.
  • Use ndi.rotate to turn xfm 30 degrees downward. Set reshape=False to prevent the image shape from changing.
  • Plot the original and transformed images.