Exemplo n.º 1
0
#plt.show(block=True)
plt.gcf().savefig('../data/barim2-1.png')
np.save(fixed,im1)

#plt.imshow(im2, interpolation='nearest')
#plt.show(block=True)
#plt.gcf().savefig('../data/barim2-2.png')
#np.save(moving,im2)

# imm transform
imm = np.load(moving)
[Nx,Ny] = np.shape(imm)
center = np.array([[Nx/2.,Ny/2.]])
def T(XY):
    phi = 2*np.pi*0.09
    R = np.array([[np.cos(phi),-np.sin(phi)],[np.sin(phi),np.cos(phi)]])
    res = np.dot(R,XY.T-np.kron(np.ones((1,XY.shape[0])),center.T))+np.kron(np.ones((1,XY.shape[0])),center.T)
    return res.T
immT = T

sim = imsim.get(pointsPerAxis, immname=moving, imfname=fixed, immT=immT, border=border, normalize=True, visualize=visualize, order=order, smoothscaleFactor=smoothing, SIGMAF=SIGMAF, h=h, splineS=splineS)

logging.info("initial point configuration: %s",sim['initial'])

(fstate,res) = match.match(sim,sim['SIGMA'],weights,initial=sim['initial'],gradTol=gradTol,order=order,scalegrad=scalegrad,maxIter=maxIter,visualize=visualize, visualizeIterations=visualizeIterations)

#print res

if True: # res.success:
    match.genStateData(fstate,sim)