Github上的一个开源框架
im_warped = vxm.layers.SpatialTransformer()([im_keras, aff_keras])
vxm.layers.SpatialTransformer()是一个类,内容大体如下:
class SpatialTransformer(Layer):
"""
ND spatial transformer layer
Applies affine and dense transforms to images. A dense transform gives
displacements (not absolute locations) at each voxel.
If you find this layer useful, please cite:
Unsupervised Learning for Fast Probabilistic Diffeomorphic Registration
Adrian V. Dalca, Guha Balakrishnan, John Guttag, Mert R. Sabuncu
MICCAI 2018.
Originally, this code was based on voxelmorph code, which
was in turn transformed to be dense with the help of (affine) STN code
via https://github.com/kevinzakka/spatial-transformer-network.
Since then, we've re-written the code to be generalized to any
dimensions, and along the way wrote grid and interpolation functions.
"""
def __init__(self,
interp_method='linear',
indexing='ij',
single_transform=False,
fill_value=None,
shift_center=True,
**kwargs):
为什么调用这个类,后面有使用括号单独放入两个参数,这样做的目的是什么?
PS:后面两个参数都是尺寸为(1, 48, 48, 1)的两个矩阵
这种的看它的forward函数,一般是网络层的前向传播的参数