PythonScripting: question about OVStimulationSet object

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
pwierzgala
Posts: 22
Joined: Tue Nov 26, 2013 3:43 pm

PythonScripting: question about OVStimulationSet object

Post by pwierzgala »

Hi,

I'm trying to understand your Python scripting interface and I have a couple of questions:
  • Is there any documentation for python scripting interface or I have to figure everyting out from source code?
  • There is a class OVStimulationSet. It looks like a list of stimulations. Could you tell me why it's contructor takes two time type parameters?

    Code: Select all

    stimSet = OVStimulationSet(self.getCurrentTime(), self.getCurrentTime()+1./self.getClock())
  • What's the difference between self.getCurrentTime() and self.getClock()?

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: PythonScripting: question about OVStimulationSet object

Post by jtlindgren »

Hello,

there's a small tutorial here,

http://openvibe.inria.fr/tutorial-using ... -openvibe/

Additionally, I'd hazard a guess that the parameters of the Stimulation Set are the current kernel time and the end time, respectively. getClock() likely returns the clock frequency of the box. You can find these out by looking at the Python box source codes under contrib/plugins/processing/python/.


Good luck,
Jussi

pwierzgala
Posts: 22
Joined: Tue Nov 26, 2013 3:43 pm

Re: PythonScripting: question about OVStimulationSet object

Post by pwierzgala »

@jtlindgren thanks, your answer has helped me a lot.

I still don't understand why do I need to provide OVStimulationSet with start time and end time so I'll leave the question opened. For me it looks like OVStimulation has all required data to represent a stimulation and there's no need for any extra times.

Code: Select all

stim_set = OVStimulationSet(self.getCurrentTime(), self.getCurrentTime()+1./self.getClock())
stim = OVStimulation(self.stim_code, self.getCurrentTime(), 0.) 
stim_set.append(stim)
self.output[0].append(stim_set)
Maybe I'll figure it out when I record some signal and stimulations with my scenario. I'll wirite a solution if I find one.

pwierzgala
Posts: 22
Joined: Tue Nov 26, 2013 3:43 pm

Re: PythonScripting: question about OVStimulationSet object

Post by pwierzgala »

I've abandoned writing application in python and decided to write it in c++ so just for note: it looks like I won't answer the question from previous post.

Post Reply