Merge pull request #658 from iillyyaa/py3-examples-division

examples: use integer division in indexing
This commit is contained in:
Luke Campagnola 2018-04-25 16:21:37 -07:00 committed by GitHub
commit 3f0a13d170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -26,9 +26,9 @@ data += pg.gaussianFilter(np.random.normal(size=shape), (15,15,15))*15
## slice out three planes, convert to RGBA for OpenGL texture
levels = (-0.08, 0.08)
tex1 = pg.makeRGBA(data[shape[0]/2], levels=levels)[0] # yz plane
tex2 = pg.makeRGBA(data[:,shape[1]/2], levels=levels)[0] # xz plane
tex3 = pg.makeRGBA(data[:,:,shape[2]/2], levels=levels)[0] # xy plane
tex1 = pg.makeRGBA(data[shape[0]//2], levels=levels)[0] # yz plane
tex2 = pg.makeRGBA(data[:,shape[1]//2], levels=levels)[0] # xz plane
tex3 = pg.makeRGBA(data[:,:,shape[2]//2], levels=levels)[0] # xy plane
#tex1[:,:,3] = 128
#tex2[:,:,3] = 128
#tex3[:,:,3] = 128

View File

@ -17,7 +17,7 @@ app = QtGui.QApplication([])
frames = 200
data = np.random.normal(size=(frames,30,30), loc=0, scale=100)
data = np.concatenate([data, data], axis=0)
data = pg.gaussianFilter(data, (10, 10, 10))[frames/2:frames + frames/2]
data = pg.gaussianFilter(data, (10, 10, 10))[frames//2:frames + frames//2]
data[:, 15:16, 15:17] += 1
win = pg.GraphicsLayoutWidget(show=True)