728x90
반응형

python neuron library 3

[neuron][파이썬] 17. 링 네트워크 시뮬레이션 실행 및 출력

🙆‍♂️ 세포 작동여부 확인 아직 자극은 주지 않았지만 만든 cell이 작동하는지 확인해보겠습니다. recording_cell = my_cells[0] soma_v = h.Vector().record(recording_cell.soma(0.5)._ref_v) dend_v = h.Vector().record(recording_cell.dend(0.5)._ref_v) t = h.Vector().record(h._ref_t) 기록하고 h.finitialize(-65) h.continuerun(25) 값 지정해주고 %matplotlib inline import matplotlib.pyplot as plt plt.plot(t, soma_v, label='soma(0.5)') plt.plot(t, dend_v, l..

AI/neuron 2022.07.22

[neuron][파이썬] 16. 링 네트워크 구성을 위한 초기 구성 - Initial configuration for build a ring network

🙆‍♂️ 일반 cell과 고유 cell class 나누기 from neuron import h, gui from neuron.units import ms, mV h.load_file('stdrun.hoc') 먼저 라이브러리들을 import 합니다. class Cell: def __init__(self, gid): self._gid = gid self._setup_morphology() self.all = self.soma.wholetree() self._setup_biophysics() def __repr__(self): return '{}[{}]'.format(self.name, self._gid) 일반 cell의 class는 이렇구 class BallAndStick(Cell): name = 'Ball..

AI/neuron 2022.07.22

[neuron][파이썬] 15. 여러 개 시뮬레이션2 - Run the simulations

🙆‍♂️ 전류 진폭의 역할 - Role of current amplitude(amp) 전류 진폭의 차이를 확인하기 위해서 for문을 통해 값과 색을 변경하여 그래프를 확인해보겠습니다. from bokeh.io import output_notebook import bokeh.plotting as plt output_notebook() f = plt.figure(x_axis_label='t (ms)', y_axis_label='v (mV)') amps = [0.075 * i for i in range(1, 5)] colors = ['green', 'blue', 'red', 'black'] for amp, color in zip(amps, colors): stim.amp = amp h.finitialize(-..

AI/neuron 2022.07.22
728x90
반응형