def tensor_of_warp_volumes_by_ddf(input_, ddf): grid_warped = util.get_reference_grid( ddf.shape[1:4] ) + ddf #这种情况ddf会被转化为tf.constant https://stackoverflow.com/questions/49239136/what-happens-when-you-add-a-tensor-with-a-numpy-array warped = util.resample_linear(tf.cast(input_, dtype=tf.float32), grid_warped) return warped
def warp_FIX_image(self, input_): return util.resample_linear(input_, self.grid_warped_FIX_MV)
def warp_image(self,image,ddf): return util.resample_linear(image, ddf)