Esempio n. 1
0
    fp = array([nd.getX(), nd.getY()], 'f')
    affine.transform(fp, 0, fp, 0, 1)
    x = fp[0] * calibration.pixelWidth
    y = fp[1] * calibration.pixelHeight
    z = nd.getLayer().getZ() * calibration.pixelWidth   # a TrakEM2 oddity
    # data may be a radius or a java.awt.geom.Area 
    coords.append(Matrix([[x, y, z]]))
  
  return coords

  
tree = Display.getFront().getActive()

m = Matrix( [ [1, 2, 3], [4, 5, 6], [ 7, 8, 10 ] ] )
print "m is:", m
m= m.append( [1,1,1] )
print m
#Calculate the center of mass
center = Matrix([[0,0,0]])
coords = getNodeCoordinates(tree)
for coord in coords:
  center += coord
center /= float(len(coords)) 
print center


#Define covvariance matrix
# [[row1], [row2], [row3]]
cova = Matrix([[0,0,0],[0,0,0],[0,0,0]])
for coord in coords:
  diff = coord - center