fix isosurface/isocurve for numpy API change

This commit is contained in:
Luke Campagnola 2016-01-30 10:06:58 -08:00
parent f279988916
commit 3f03622a02

View File

@ -1578,7 +1578,7 @@ def isocurve(data, level, connected=False, extendToEdge=False, path=False):
#vertIndex = i - 2*j*i + 3*j + 4*k ## this is just to match Bourk's vertex numbering scheme
vertIndex = i+2*j
#print i,j,k," : ", fields[i,j,k], 2**vertIndex
index += fields[i,j] * 2**vertIndex
np.add(index, fields[i,j] * 2**vertIndex, out=index, casting='unsafe')
#print index
#print index
@ -2094,7 +2094,7 @@ def isosurface(data, level):
for k in [0,1]:
fields[i,j,k] = mask[slices[i], slices[j], slices[k]]
vertIndex = i - 2*j*i + 3*j + 4*k ## this is just to match Bourk's vertex numbering scheme
index += fields[i,j,k] * 2**vertIndex
np.add(index, fields[i,j,k] * 2**vertIndex, out=index, casting='unsafe')
### Generate table of edges that have been cut
cutEdges = np.zeros([x+1 for x in index.shape]+[3], dtype=np.uint32)
@ -2163,7 +2163,7 @@ def isosurface(data, level):
### expensive:
verts = faceShiftTables[i][cellInds]
#profiler()
verts[...,:3] += cells[:,np.newaxis,np.newaxis,:] ## we now have indexes into cutEdges
np.add(verts[...,:3], cells[:,np.newaxis,np.newaxis,:], out=verts[...,:3], casting='unsafe') ## we now have indexes into cutEdges
verts = verts.reshape((verts.shape[0]*i,)+verts.shape[2:])
#profiler()