File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ ENV NEURON_HOME=/opt/conda
5757# For lfpykit 0.4
5858# RUN wget -P $(pip show LFPykit | grep "Location:" | awk '{print $2"/lfpykit"}') https://www.parralab.org/nyhead/sa_nyhead.mat
5959# For lpfykit 0.5
60+
6061RUN wget --no-check-certificate -P ${FOLDER}/workspace https://www.parralab.org/nyhead/sa_nyhead.mat
6162
6263USER $NB_UID
Original file line number Diff line number Diff line change 1111 "https://d8bf7e40eec34cb9891f6dd8207b5e83@sentry.metacell.us/6"
1212)
1313
14-
15-
14+ HEAD_MODEL_FILE = os .getenv ("NP_LFPYKIT_HEAD_FILE" , "sa_nyhead.mat" )
15+
16+ def init_eeg ():
17+ import sys
18+ from netpyne_ui .constants import HERE
19+ # FIXES library asking for input to download
20+ sys .stdin = open (os .path .join (HERE , "resources/stdin.txt" ),'r' )
21+ from lfpykit .eegmegcalc import NYHeadModel
22+ try :
23+ NYHeadModel (HEAD_MODEL_FILE ) # Downloads the model if does not exist
24+ except :
25+ logging .error ("Error initializing the EEG head model" , exc_info = True )
26+
27+ if not os .path .exists (HEAD_MODEL_FILE ):
28+ from multiprocessing import Process
29+ thread = Process (target = init_eeg )
30+ thread .start ()
1631
1732RouteManager .add_controller (api .NetPyNEController )
1833
You can’t perform that action at this time.
0 commit comments