Unification ct scan voxel size by using interpolation in Python

后端 未结 2 805
盖世英雄少女心
盖世英雄少女心 2021-01-24 08:29

I have used interp2 in Matlab, such as the following code, that is part of @rayryeng\'s answer in: Three dimensional (3D) matrix interpolation in Matlab:



        
2条回答
  •  南方客
    南方客 (楼主)
    2021-01-24 09:07

    You might be interested in scipy.ndimage.zoom. If you are interpolating from one regular grid to another, it is much faster and easier to use than scipy.interpolate.interp2d.

    See this answer for an example: https://stackoverflow.com/a/16984081/1295595

    You'd probably want something like:

    import scipy.ndimage as ndimage
    M2D = ndimage.zoom(volume_image, (1, scaleCoeff[0], scaleCoeff[1])
    

提交回复
热议问题