Getting Bold signal from Jansen Rit output

68 views
Skip to first unread message

ja.sta...@gmail.com

unread,
Jul 12, 2021, 8:37:44 AM7/12/21
to TVB Users
Hello fellow TVB Users,

I am using Jansen and Rit model in TVB (python 3) to simulate resting-state BOLD activity. 
My understanding is that the most reasonable way to do this with JR model is to take the output variables y1 and y2, subtract them to obtain the difference between the excitatory and inhibitory inputs to pyramidal cells. 
The next step for me is to apply the sigmoidal function to obtain the pulse density/firing rates and use them as the output to the fmri_ballon.py 

I have the simulation output coming from 
t_ssamp, ssamp = sim.run()

I am using a TimeSeriesRegion object as follows:
full_ssamp_tsr = TimeSeriesRegion(connectivity=s_conn,
                            data=ssamp,  time = ts_samp


                            sample_period=sim.monitors[0].period)
full_ssamp_tsr.configure()

which works and then I am trying to get the BOLD signal by using:
balloon_analyser = fmri_balloon.BalloonModel(time_series=full_ssamp_tsr., dt=.72, neural_input_transformation='abs_diff')
balloon_data = balloon_analyser.evaluate()
balloon_data.configure()

as a result I am getting error:

AttributeError: 'TimeSeriesRegion' object has no attribute 'connectivity'

This seems really strange, I have tried different inputs to the BalloonModel and neither raw time_series nor the newly created TimeSeriesRegion seem to work. Could it be because I am not using region labels?

LONG STORY SHORT: What would be the best way to get my BOLD output working?

I would very much appreciate any advice.
Best
Jan



WOODMAN Michael

unread,
Jul 12, 2021, 9:30:06 AM7/12/21
to tvb-...@googlegroups.com
On 7/12/2021 2:37 PM, ja.sta...@gmail.com wrote:

> /*AttributeError: 'TimeSeriesRegion' object has no attribute 'connectivity'*

Can you provide a traceback please?

> TimeSeriesRegion seem to work. Could it be because I am not using region

It could be, and you can generate a dummy set of labels with e.g.


np.array(['region%d'%i for i in range(len(conn.weights))])

cheers,
Marmaduke

ja.sta...@gmail.com

unread,
Jul 12, 2021, 9:43:00 AM7/12/21
to TVB Users
Thank you Marmaduke,

I am also trying to get the sigmoidal implemented within the Bold monitor class, so perhaps that will solve the issues as well.
Below is the requested traceback:

Best regards
Jan

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-73-952b7528b03a> in <module>
     13 balloon_analyser = fmri_balloon.BalloonModel(time_series=full_ssamp_ts, dt=.72, neural_input_transformation='abs_diff')
     14 balloon_data = balloon_analyser.evaluate()
---> 15 balloon_data.configure()


/Applications/tvb-2.1a1.app/Contents/Resources/lib/python3.7/tvb/basic/neotraits/_core.py in configure(self, *args, **kwargs)
    222         Override to compute uninitialized state of the class.
    223         """
--> 224         self.validate()


    214             # read all declarative attributes. This will trigger errors if they are
    215             # in an invalid state, like beeing required but not set
--> 216             getattr(self, k)


    167             if attr_name in self.space_labels:
    168                 return self.get_subspace_by_labels([attr_name])
--> 169         raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, attr_name))
    170 
    171     def _get_index_for_slice_label(self, slice_label, slice_idx):

AttributeError: 'TimeSeriesRegion' object has no attribute 'connectivity'

WOODMAN Michael

unread,
Jul 13, 2021, 1:37:23 AM7/13/21
to TVB Users

Hi


It looks like the configure call is not required for the time series object. I suggest commenting that line out, and just trying to use the balloon_data.data NumPy array for what you what to do next.


cheers,

Marmaduke


From: tvb-...@googlegroups.com <tvb-...@googlegroups.com> on behalf of ja.sta...@gmail.com <ja.sta...@gmail.com>
Sent: Monday, July 12, 2021 3:43:00 PM
To: TVB Users
Subject: Re: [TVB] Getting Bold signal from Jansen Rit output
 
--
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/cf8d6880-747d-4973-8422-9dc49fc26771n%40googlegroups.com.

ja.sta...@gmail.com

unread,
Jul 13, 2021, 12:07:31 PM7/13/21
to TVB Users
Thank you Marmaduke. I will give it a go.
Reply all
Reply to author
Forward
0 new messages