Exemplo n.º 1
0
def test_explore(): 
    I = Image(make_data_int16())
    J = Image(make_data_int16())
    IM = IconicMatcher(I.array, J.array, I.toworld, J.toworld)
    T = np.eye(4)
    T[0:3,3] = np.random.rand(3)
    simi, params = IM.explore(ux=[-1,0,1],uy=[-1,0,1])
Exemplo n.º 2
0
matcher = IconicMatcher(I.get_data(), J.get_data(), 
                        I.get_affine(), J.get_affine()) ## I: source, J: target

# Params
size = 5
nsimu = 1
depth = 10

import pylab as pl

# Simulations 
for i in range(nsimu): 

    # Select random block
    x0 = np.random.randint(I.array.shape[0]-size)
    y0 = np.random.randint(I.array.shape[1]-size)
    z0 = np.random.randint(I.array.shape[2]-size)
    matcher.set(corner=[x0,y0,z0], size=[size,size,size])

    # Explore neighborhood
    tx = I.voxsize[0] * (np.arange(2*depth + 1)-depth)
    s, p = matcher.explore(tx=tx)

    # Display
    pl.plot(p[:,0],(1-s)**(-.5*size**3)) 



pl.show()