How to use the pulse2percept.electrode2currentmap.Retina function in pulse2percept

To help you get started, we’ve selected a few pulse2percept examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulse2percept / pulse2percept / scripts / CalculateChronaxies.py View on Github external
for x in np.arange(-1, 1, e_spacing):  
    for y in np.arange(-1, 1, e_spacing):
        xlist.append(x)
        ylist.append(y)
        rlist.append(100) # electrode radiues
        hlist.append(0); #179.6) # electrode lift from retinal surface,      
        # epiretinal array - distance to the ganglion layer
        # subretinal array - distance to the bipolar layer
        # in Argus 1 179.6 is a good approx of height in a better patient
        
e_all = e2cm.ElectrodeArray(rlist,xlist,ylist,hlist, ptype='epiretinal') 
                
# create retina, input variables include the sampling and how much of the retina is simulated, in microns   
# (0,0 represents the fovea) 
retinaname='SmallL80S75WL500'
r = e2cm.Retina(axon_map=None,sampling=75, ylo=-500, yhi=500, xlo=-500, xhi=500, axon_lambda=8)     

# the effective current spread that incorporates axonal stimulation    
    
myout=[]
d=.1
fps=30
pt=[]
inl_out=[]
nfl_out=[]

modelver='Krishnan' 

#for d in [.1, .2, .45, .75, 1., 2., 4., 8., 16., 32.]:
tm = ec2b.TemporalModel() 
rsample=int(np.round((1/tm.tsample) / 60 )) # resampling of the output to fps
# at 0 off the retinal surface a 0.45 pulse in the nfl gives a response of 1
github pulse2percept / pulse2percept / pulse2percept / effectivecurrent2brightness.py View on Github external
tm = TemporalModel(pt_list[0].tsample)
    elif not isinstance(tm, TemporalModel):
        raise TypeError("`tm` must be of type ec2b.TemporalModel")

    # Generate a retina if necessary
    if retina is None:
        # Make sure implant fits on retina
        round_to = 500  # round to nearest (microns)
        cspread = 500  # expected current spread (microns)
        xs = [a.x_center for a in implant]
        ys = [a.y_center for a in implant]
        xlo = np.floor((np.min(xs) - cspread) / round_to) * round_to
        xhi = np.ceil((np.max(xs) + cspread) / round_to) * round_to
        ylo = np.floor((np.min(ys) - cspread) / round_to) * round_to
        yhi = np.ceil((np.max(ys) + cspread) / round_to) * round_to
        retina = e2cm.Retina(xlo=xlo, xhi=xhi, ylo=ylo, yhi=yhi,
                             save_data=False)
    elif not isinstance(retina, e2cm.Retina):
        raise TypeError("`retina` object must be of type e2cm.Retina")

    # Perform any necessary calculations per electrode
    pt_list = utils.parfor(tm.calc_per_electrode, pt_list, engine=engine,
                           n_jobs=n_jobs)

    # Which layer to simulate is given by implant type.
    # For now, both implant types process the same two layers. In the
    # future, these layers might differ. Order doesn't matter.
    if implant.etype == 'epiretinal':
        dolayers = ['NFL', 'INL']  # nerve fiber layer
    elif implant.etype == 'subretinal':
        dolayers = ['NFL', 'INL']  # inner nuclear layer
    else:
github pulse2percept / pulse2percept / scripts / SingleElectrode.py View on Github external
for x in np.arange(-252, 500, e_spacing):  
    for y in np.arange(-252, 500, e_spacing):
        xlist.append(x)
        ylist.append(y)
        rlist.append(100) # electrode radiues
        hlist.append(0); #179.6) # electrode lift from retinal surface,      
        # epiretinal array - distance to the ganglion layer
        # subretinal array - distance to the bipolar layer
        # in Argus 1 179.6 is a good approx of height in a better patient
e_all = e2cm.ElectrodeArray(rlist,xlist,ylist,hlist, ptype='epiretinal') 

                
# create retina, input variables include the sampling and how much of the retina is simulated, in microns   
# (0,0 represents the fovea) 
retinaname='SmallL80S75WL500'
r = e2cm.Retina(axon_map=None,sampling=75, ylo=-500, yhi=500, xlo=-500, xhi=500, axon_lambda=8)     

# the effective current spread that incorporates axonal stimulation    
    
myout=[]
d=.1
fps=30
pt=[]
inl_out=[]
nfl_out=[]

modelver='Krishnan' 

tm = ec2b.TemporalModel(lweight= (1 / (3.16 * (10 ** 6))))
#for d in [.1, .2, .45, .75, 1., 2., 4., 8., 16., 32.]:
scFac =  2.41 * (10**3)
# at 0 off the retinal surface a 0.45 pulse in the nfl gives a response of 1
github pulse2percept / pulse2percept / scripts / Find_INL_NFL_weighting.py View on Github external
for x in np.arange(-1, 1, e_spacing):  
    for y in np.arange(-1, 1, e_spacing):
        xlist.append(x)
        ylist.append(y)
        rlist.append(100) # electrode radiues
        hlist.append(0); #179.6) # electrode lift from retinal surface,      
        # epiretinal array - distance to the ganglion layer
        # subretinal array - distance to the bipolar layer
        # in Argus 1 179.6 is a good approx of height in a better patient
        
e_all = e2cm.ElectrodeArray(rlist,xlist,ylist,hlist, ptype='epiretinal') 
                
# create retina, input variables include the sampling and how much of the retina is simulated, in microns   
# (0,0 represents the fovea) 
retinaname='SmallL80S75WL500'
r = e2cm.Retina(axon_map=None,sampling=75, ylo=-500, yhi=500, xlo=-500, xhi=500, axon_lambda=8)     

# the effective current spread that incorporates axonal stimulation    
    
myout=[]
d=.1
fps=30
pt=[]
inl_out=[]
nfl_out=[]

modelver='Krishnan' 


#for d in [.1, .2, .45, .75, 1., 2., 4., 8., 16., 32.]:
tm = ec2b.TemporalModel() 
rsample=int(np.round((1/tm.tsample) / 60 )) # resampling of the output to fps