Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit da6b4d4

Browse files
author
Antonio Ulloa
committed
Removed WilsonCowanPositive Class
1 parent 740f6bc commit da6b4d4

32 files changed

+4140
-163
lines changed

analysis/avg_FC_TVB_ROIs_across_subjects.py

Lines changed: 364 additions & 139 deletions
Large diffs are not rendered by default.

simulation/sim.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,6 @@ def on_myStream_message(self, message):
357357
self.runTextEdit.moveCursor(QtGui.QTextCursor.End)
358358
self.runTextEdit.insertPlainText(message)
359359

360-
class WilsonCowanPositive(models.WilsonCowan):
361-
"Declares a class of Wilson-Cowan models that use the default TVB parameters but"
362-
"only allows values between 0 and 1 at integration time. In other words, it clips state"
363-
"variables to the range [0,1] when a stochastic integration is used"
364-
def dfun(self, state_variables, coupling, local_coupling=0.0):
365-
state_variables[state_variables < 0.0] = 0.0
366-
state_variables[state_variables > 1.0] = 1.0
367-
return super(WilsonCowanPositive, self).dfun(state_variables, coupling, local_coupling)
368-
369360
class TaskThread(QtCore.QThread):
370361

371362
def __init__(self):
@@ -433,6 +424,7 @@ def run(self):
433424

434425
# now load white matter connectivity (998 ROI matrix from TVB demo set, AKA Hagmann's connectome)
435426
if useTVBConnectome == True:
427+
WC = models.WilsonCowan()
436428
white_matter = connectivity.Connectivity.from_file("connectivity_998.zip")
437429

438430
# Define the transmission speed of white matter tracts (4 mm/ms)
@@ -450,7 +442,7 @@ def run(self):
450442
what_to_watch = monitors.Raw()
451443

452444
# Initialize a TVB simulator
453-
sim = simulator.Simulator(model=WilsonCowanPositive(), connectivity=white_matter,
445+
sim = simulator.Simulator(model=WC, connectivity=white_matter,
454446
coupling=white_matter_coupling,
455447
integrator=euler_int, monitors=what_to_watch)
456448

@@ -686,7 +678,7 @@ def run(self):
686678
# now we decide whether the weights will be multiplied by a random amount
687679
# varying between that amount and 1.0 in order to generate a new subject
688680
if generateSubject == True:
689-
connectionWeight = destination[1] * random.uniform(subject_variation, 1)
681+
connectionWeight = destination[1] * rdm.uniform(subject_variation, 1)
690682
else:
691683
connectionWeight = destination[1]
692684

@@ -1005,7 +997,7 @@ def run(self):
1005997
in_value = in_value - threshold
1006998

1007999
# now compute a random value between -0.5 and 0.5
1008-
r_value = random.uniform(0,1) - 0.5
1000+
r_value = rdm.uniform(0,1) - 0.5
10091001

10101002
# multiply it by the noise parameter and add it to input value
10111003
in_value = in_value + r_value * noise
@@ -1147,7 +1139,7 @@ def run(self):
11471139
in_value = in_value - threshold
11481140

11491141
# now compute a random value between -0.5 and 0.5
1150-
r_value = random.uniform(0,1) - 0.5
1142+
r_value = rdm.uniform(0,1) - 0.5
11511143

11521144
# multiply it by the noise parameter and add it to input value
11531145
in_value = in_value + r_value * noise
-104 KB
Binary file not shown.
-113 KB
Binary file not shown.
-117 KB
Binary file not shown.

visual_model/circle_tvb_rs_fc.png

-118 KB
Binary file not shown.
52 KB
Loading

visual_model/corr_RS_PV_DMS.png

47 KB
Loading
49.6 KB
Loading
1.92 KB
Loading

0 commit comments

Comments
 (0)