two node Jansen & Rit neural mass model

84 views
Skip to first unread message

David p

unread,
Jul 23, 2020, 4:01:04 PM7/23/20
to TVB Users
Hello everyone, 

I am very new to TVB and still learning the ropes. I would like to simulate a 2 node Jansen Rit neural mass model using similar setup as David and Friston 2003 to get the same output as the David and Friston paper. I have been going through the tutorials and demos and came across the JansenRIt demo script. What I don't understand is how to specific the number of nodes within the model so I only have two outputs  I am using Anaconda to run the script with the latest version of TVB ( I re-installed TVB yesterday). Any help thisthis would be greatly appreciated. 

Thank you, 
David 

WOODMAN Michael

unread,
Jul 24, 2020, 2:11:35 AM7/24/20
to tvb-...@googlegroups.com

hi David


The number of nodes is determined by your connectivity.  If you want two nodes, you can create the connectivity with 2x2 weights and tract lengths matrices. 


cheers,


Marmaduke Woodman, TVB Engineer, INS AMU; +33 4 91 32 42 38 +33 7 67 77 84 72


From: tvb-...@googlegroups.com <tvb-...@googlegroups.com> on behalf of David p <pre...@gmail.com>
Sent: Thursday, July 23, 2020 10:01:04 PM
To: TVB Users
Subject: [TVB] two node Jansen & Rit neural mass model
 
--
You received this message because you are subscribed to the Google Groups "TVB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tvb-users/27e42a71-de1e-43a2-837c-435d54677a1do%40googlegroups.com.

David p

unread,
Jul 28, 2020, 10:52:16 AM7/28/20
to TVB Users
Thank you for your response! I am now having an issue setting the weights. Right now I'm trying to set some basic values to get the handle on the setting up connectivity. I am using the connecivity.Connecitvity() function, but whenever i tried to set the values for the weights I get and error. 

TraitTypeError: Attribute can't be set to an instance of <class 'list'>
  attribute tvb.datatypes.connectivity.Connectivity.weights = NArray(label='Connection strengths', dtype=float64, default=None, dim_names=(), ndim=None, required=True)

Below is the code I am using. 

wm = connectivity.Connectivity (number_of_regions = 2, 
                                number_of_connections=4,
                                weights = [[0,1],[0.5,0]])

David Prete

On Friday, 24 July 2020 02:11:35 UTC-4, marmaduke.woodman wrote:

hi David


The number of nodes is determined by your connectivity.  If you want two nodes, you can create the connectivity with 2x2 weights and tract lengths matrices. 


cheers,


Marmaduke Woodman, TVB Engineer, INS AMU; +33 4 91 32 42 38 +33 7 67 77 84 72


From: tvb-...@googlegroups.com <tvb-...@googlegroups.com> on behalf of David p <pre...@gmail.com>
Sent: Thursday, July 23, 2020 10:01:04 PM
To: TVB Users
Subject: [TVB] two node Jansen & Rit neural mass model
 
Hello everyone, 

I am very new to TVB and still learning the ropes. I would like to simulate a 2 node Jansen Rit neural mass model using similar setup as David and Friston 2003 to get the same output as the David and Friston paper. I have been going through the tutorials and demos and came across the JansenRIt demo script. What I don't understand is how to specific the number of nodes within the model so I only have two outputs  I am using Anaconda to run the script with the latest version of TVB ( I re-installed TVB yesterday). Any help thisthis would be greatly appreciated. 

Thank you, 
David 

--
You received this message because you are subscribed to the Google Groups "TVB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-...@googlegroups.com.

John Griffiths

unread,
Jul 28, 2020, 4:23:14 PM7/28/20
to TVB Users

David, 

The error is telling you that the data type of weights array you have given is a list, and it doesn't like that

The solution is to use np.array to provide the numbers in a numpy array, rather than a list

Example doing this below. 

Note I also added in some additional components to the connectivity specification. 
These are the minimal information necessary for the .configure() method to run successfully,
which you also need when running simulations


wm = connectivity.Connectivity(number_of_regions = 2
                               number_of_connections=4,
                                weights = np.array([[0,1],[0.5,0]]),
                                tract_lengths = np.array([[0,100],[100,0]]),
                                region_labels=np.array(['region1','region2']),
                                centres=np.array([[0,0,0],[1,1,1]]))



wm.configure()
Reply all
Reply to author
Forward
0 new messages