【问题标题】:Shift argument in scipy.ndimage.shiftShift argument in scipy.ndimage.shift
【发布时间】:2022-11-20 11:48:44
【问题描述】:

Imagine I have a 3D image in a np array. I want to shift it along x-axis, y-axis and z-axis...

What does shift represent in the function scipy.ndimage.shift? Is it a float representing a ratio? Is it the number of pixels to be shifted?

If shift=[0.5, 0, 0] is the image being shifted in the x-axis by how much?

【问题讨论】:

    标签: python numpy scipy


    【解决方案1】:

    Okay, I have found the answer. shift corresponds to the number of pixels being shifted.

    Example 1: Imagine we have an image of shape (x, y, z), if shift=[24, 0, 0] then the image is shifted by 24 pixel in the x-axis.

    Example 2: Imagine we have an image of shape (y, z, x), if shift=[0, 12, 0] then the image is shifted by 12 pixel in the z-axis.

    Important: If shift is an int then no interpolation is performed, but if shift is a float the image is interpolated.

    【讨论】:

      猜你喜欢
      • 2022-12-01
      • 2019-09-08
      • 1970-01-01
      • 2022-02-24
      • 1970-01-01
      • 1970-01-01
      • 2022-08-09
      • 1970-01-01
      • 2021-09-27
      相关资源
      最近更新 更多