johnbachman / py-fcm

Automatically exported from code.google.com/p/py-fcm
0 stars 1 forks source link

Could not use Polygate because of TypeError #27

Open hiroalchem opened 6 years ago

hiroalchem commented 6 years ago

I would like to use Polygate however if I use same as tutorial, I got TypeError

import fcm import matplotlib.pyplot as plt data = fcm.loadFCS('/Users/hiroki/facs/facs2/facs/Tube1_10000_20171010_113638.fcs') gate1 = fcm.PolyGate([(40000,100),(10000,300),(40000,30000),(10000,10000)], (0,1))

apply the gate

gate1.gate(data)

TypeError Traceback (most recent call last)

in () 1 #apply the gate ----> 2 gate1.gate(data) /Users/user/facs/facs2/lib/python2.7/site-packages/fcm/core/gate.py in gate(self, fcm, chan, invert, name) 54 if name is None: 55 name = self.name ---> 56 idxs = points_in_poly(self.vert, fcm.view()[:, chan]) 57 58 if invert: /Users/user/facs/facs2/lib/python2.7/site-packages/fcm/core/gate.py in points_in_poly(vs, ps) 302 303 for i, v in enumerate(vs): --> 304 inPoly[i, :] |= ((v[0] < ps[:, 0]) & (vs[j, 0] >= ps[:, 0])) | ((vs[j, 0] < ps[:, 0]) & (v[0] >= ps[:, 0])) 305 inPoly[i, :] &= (v[1] + (ps[:, 0] - v[0]) / ((vs[j, 0] - v[0]) * (vs[j, 1] - v[1])) < ps[:, 1]) 306 j = i TypeError: list indices must be integers, not tuple --------------------------------- MacOS Sierra python2.7.10