some questions, need help

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
jamesLocal
Posts: 27
Joined: Sun Jun 27, 2010 3:44 pm

some questions, need help

Post by jamesLocal »

I got a few questions; can some one help me solve it;

1.) I found out that openvibe do support GDF, BCI competition lib files, brainamp format, scv, and openvibe native format. and i know that GDF files uses the GDF file reader/write as its box. and Openvibe native format uses the generic file reader box. So what about the other file types, what boxes do they use ?

brainamp format -
scv -
BCI competition lib files -

Are there any example scenarios that you'l have used using the above file types ?

2.) What are .OV files ? where can i find additional information about that file type ? do you know a possible converter where i can convert gdf to ov file type ?

3.) This is about the graz visualisation box. The Red arrow is the visual cue , and the blue bar is the current classification. (am i right here ?) . when the user is asked to do a right hand motor imaginary why does it always start first with the arrow pointing to the right side followed by the blue bar ?

4.) There's an example 'Motor-Imagery-bci-2-Classifier-Training.xml' that trains the program for right hand and left hand motor imaginary. then when i ran the example 'Motor-Imagery-bci4_reply.xml' (in offline mode) with the configuration file created in the 'Motor-Imagery-bci-2-Classifier-Training.xml' it identifies right and left hand motor imaginary.
a.) what i need to do is to train the program to identify up and down(instead of left and right). So how do i modify the 'Motor-Imagery-bci-2-Classifier-Training.xml' and 'Motor-Imagery-bci4_reply.xml' to do it. (in brief > the arrows and the blue bar should move UP when the user is doing a right hand motor imaginary and Down to a left hand motor imaginary)

(i tried editing stimulation based epoching property stimulation to epoch from to OVTK_GDF_UP and OVTK_GDF_DOWN (in the trainer) and in the classifier processor i edited class 1 label and class 2 label to OVTK_GDF_UP and OVTK_GDF_DOWN respectly, but it didn't change the directions) What should i do ?

5.) in the code of ovpCGrazVisualization.cpp ;

Code: Select all

if(m_f64BarScale<0)
			{
				l_iRectangleTopLeftX -= l_iRectangleWidth;

				gdk_pixbuf_render_to_drawable(m_pLeftBar, m_pDrawingArea->window, NULL,
						gdk_pixbuf_get_width(m_pLeftBar)-l_iRectangleWidth, 0,
						l_iRectangleTopLeftX, l_iRectangleTopLeftY, l_iRectangleWidth, l_iRectangleHeight,
						GDK_RGB_DITHER_NONE, 0, 0);

			}
			else
			{
				gdk_pixbuf_render_to_drawable(m_pRightBar, m_pDrawingArea->window, NULL, 0, 0, l_iRectangleTopLeftX, l_iRectangleTopLeftY, l_iRectangleWidth, l_iRectangleHeight, GDK_RGB_DITHER_NONE, 0, 0);


			}
When

Code: Select all

m_f64BarScale
is less than 0, the blue bar (current classification resolved) will move to the left side, and when its greater than 0 the blue bar (current classification resolved) will move to the right side. So what about Up and Down directions ? how are those resolved in the code ?


6.) I was given a few GDF files, and i tried to use them in an openvibe application. i got the following error message.
[WARNING] At time 0 (0x0)<Box algorithm::GDF file reader> Can't handle GDF files
with channels having different sampling rates!
[WARNING] Box algorithm <GDF file reader> has been deactivated because initializ
ation phase returned bad status

7.) Finally a very humble request. does anyone have a right left foot movement GDF file ? that works with openvibe GDF file reader box?

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: some questions, need help

Post by yrenard »

Dear jamesLocal,

looks like you got a lot of questions and are really interested in the motor imagery paradigm. Here are the first answers, tell me if that helps.
jamesLocal wrote: 1.) I found out that openvibe do support GDF, BCI competition lib files, brainamp format, scv, and openvibe native format. and i know that GDF files uses the GDF file reader/write as its box. and Openvibe native format uses the generic file reader box. So what about the other file types, what boxes do they use ?
brainamp format - Brainamp File Reader box
csv - CSV File Writer box
BCI competition lib files - BCI Competition IIIb Reader box
jamesLocal wrote: Are there any example scenarios that you'l have used using the above file types ?
No.
jamesLocal wrote: 2.) What are .OV files ? where can i find additional information about that file type ? do you know a possible converter where i can convert gdf to ov file type ?
.ov files are raw openvibe streams encapsulated in an EBML container. A short stream documentation can be found at the OpenViBE streams page. You may also be interested in the pages about EBML :
What is EBML, Parsing EBML Streams and Formating EBML Streams.

I'm not sure it will help anyway.

As you expected, you'd better convert .ov files to whatever format is easier to read for you, e.g. csv files (coma separated text files). You can do this simply connecting a Generic Stream Reader to a CSV File Writer
jamesLocal wrote: 3.) This is about the graz visualisation box. The Red arrow is the visual cue , and the blue bar is the current classification. (am i right here ?) . when the user is asked to do a right hand motor imaginary why does it always start first with the arrow pointing to the right side followed by the blue bar ?
Correct.
The arrow is the instruction, the blue bar is the feedback.
jamesLocal wrote: 4.) There's an example 'Motor-Imagery-bci-2-Classifier-Training.xml' that trains the program for right hand and left hand motor imaginary. then when i ran the example 'Motor-Imagery-bci4_reply.xml' (in offline mode) with the configuration file created in the 'Motor-Imagery-bci-2-Classifier-Training.xml' it identifies right and left hand motor imaginary.
a.) what i need to do is to train the program to identify up and down(instead of left and right). So how do i modify the 'Motor-Imagery-bci-2-Classifier-Training.xml' and 'Motor-Imagery-bci4_reply.xml' to do it. (in brief > the arrows and the blue bar should move UP when the user is doing a right hand motor imaginary and Down to a left hand motor imaginary)

(i tried editing stimulation based epoching property stimulation to epoch from to OVTK_GDF_UP and OVTK_GDF_DOWN (in the trainer) and in the classifier processor i edited class 1 label and class 2 label to OVTK_GDF_UP and OVTK_GDF_DOWN respectly, but it didn't change the directions) What should i do ?
As far as I remember, the Graz Visualization box is ready for up and down instructions, but not for up and down feedback.
This should be checked in the code. You may find a patched version in wip-flotte branch that supports the 4 directions.
jamesLocal wrote: 5.) in the code of ovpCGrazVisualization.cpp ;

Code: Select all

if(m_f64BarScale<0)
			{
				l_iRectangleTopLeftX -= l_iRectangleWidth;

				gdk_pixbuf_render_to_drawable(m_pLeftBar, m_pDrawingArea->window, NULL,
						gdk_pixbuf_get_width(m_pLeftBar)-l_iRectangleWidth, 0,
						l_iRectangleTopLeftX, l_iRectangleTopLeftY, l_iRectangleWidth, l_iRectangleHeight,
						GDK_RGB_DITHER_NONE, 0, 0);

			}
			else
			{
				gdk_pixbuf_render_to_drawable(m_pRightBar, m_pDrawingArea->window, NULL, 0, 0, l_iRectangleTopLeftX, l_iRectangleTopLeftY, l_iRectangleWidth, l_iRectangleHeight, GDK_RGB_DITHER_NONE, 0, 0);


			}
When

Code: Select all

m_f64BarScale
is less than 0, the blue bar (current classification resolved) will move to the left side, and when its greater than 0 the blue bar (current classification resolved) will move to the right side. So what about Up and Down directions ? how are those resolved in the code ?
See previous answer.
jamesLocal wrote: 6.) I was given a few GDF files, and i tried to use them in an openvibe application. i got the following error message.
[WARNING] At time 0 (0x0)<Box algorithm::GDF file reader> Can't handle GDF files
with channels having different sampling rates!
[WARNING] Box algorithm <GDF file reader> has been deactivated because initializ
ation phase returned bad status
Indeed, GDF files can contain multiple streams with different sampling frequencies. This can not be handled by OpenViBE.
jamesLocal wrote: 7.) Finally a very humble request. does anyone have a right left foot movement GDF file ? that works with openvibe GDF file reader box?
Generally, it's more about left/right hand movements. You have some sample .ov files in the OpenViBE release that you can convert to .gdf files as described in a previous answer.

I hope this helps,
Yann

jamesLocal
Posts: 27
Joined: Sun Jun 27, 2010 3:44 pm

Re: some questions, need help

Post by jamesLocal »

Thankyou yrenard, your answers were very helpful. yet i got 2 more questions;

1.)
As far as I remember, the Graz Visualization box is ready for up and down instructions, but not for up and down feedback.
This should be checked in the code. You may find a patched version in wip-flotte branch that supports the 4 directions.
I went through ovpCGrazVisualization4Classes.cpp, and saw the changes you guys had made for up & down feedbacks. Do you know the names of the files i should apply the patch for ? (how could i add and test in my code)

2.) Now in Motor-Imagery-bci-2-Classifier-Training.xml , the program is trained to recognise right hand and left hand movements. To move the arrow to the Left when a left hand movement is made and move the arrow to the right when the right hand movement is made. Can you help me modify the Motor-Imagery-bci-2-Classifier-Training.xml and Motor-Imagery-bci4_reply.xml to train and process it self as;

When a right hand movement is made - move the arrow UP (instead showing the arrow to the right)
when a left hand movement is made - move the arrow Down (instead showing the arrow to the left)

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: some questions, need help

Post by yrenard »

Dear jamesLocal,
jamesLocal wrote: 1.) I went through ovpCGrazVisualization4Classes.cpp, and saw the changes you guys had made for up & down feedbacks. Do you know the names of the files i should apply the patch for ? (how could i add and test in my code)
The ovpCGrazVisualization4Classes.cpp your pointed out is just branched from the original ovpCGrazVisualization.cpp file. So you could diff them two and check what the differences are.
jamesLocal wrote: 2.) Now in Motor-Imagery-bci-2-Classifier-Training.xml , the program is trained to recognise right hand and left hand movements. To move the arrow to the Left when a left hand movement is made and move the arrow to the right when the right hand movement is made. Can you help me modify the Motor-Imagery-bci-2-Classifier-Training.xml and Motor-Imagery-bci4_reply.xml to train and process it self as;

When a right hand movement is made - move the arrow UP (instead showing the arrow to the right)
when a left hand movement is made - move the arrow Down (instead showing the arrow to the left)
The arrow can be easily changed editing the graz_stimulation_scenario.xml file that is used in the XML Stimulation Scenario Player box replacing

Code: Select all

	<Variable name="LeftCue"             value="769"></Variable>
	<Variable name="RightCue"            value="770"></Variable>
with

Code: Select all

	<Variable name="LeftCue"             value="774"></Variable> <!-- down -->
	<Variable name="RightCue"            value="780"></Variable>  <!-- up -->
Of course, you will have to update your training / online / replay scenarios accordingly.

For information, all stim codes can be found in the dedicated documentation page.

Hope this helps,
Yann

jamesLocal
Posts: 27
Joined: Sun Jun 27, 2010 3:44 pm

Re: some questions, need help

Post by jamesLocal »

hello yrenard :mrgreen:

Got 2 questions;

1.) According to a forum ( viewtopic.php?f=10&t=237 ) , it says you guys has tried for 3 control commands.

I would like to try it out too, Can you please provide me with the files, to run the example?

2. ) I did as you told in the previous reply
The ovpCGrazVisualization4Classes.cpp your pointed out is just branched from the original ovpCGrazVisualization.cpp file. So you could diff them two and check what the differences are.
a.) According to the code these values are initialised, with incorrect values [l_sMaxStateLabel and l_f64MaxState ] (i think its not completed yet)

Code: Select all

		//identifying the maximum absolute classification output
						CString l_sMaxStateLabel = ""; //the label associated with the maximum absolute classification state
						float64 l_f64MaxState = 0.0; //the maximum absolute classification state
and in the for loop; the line below l_sCurrentStateLabel does not get initialised with a value (i think there's some error here )

Code: Select all

for(uint32 i=0; i < m_oStateInputHandle->getDimensionSize(0); i++)
						{
							float64 l_f64CurrentState = fabs(m_oStateInputHandle->getBuffer()[i]);
							CString l_sCurrentStateLabel = CString(m_oStateInputHandle->getDimensionLabel(0,i));
therefore; when the code flows , it will always satisfy this if condition

Code: Select all

if(l_sMaxStateLabel == m_s64LeftLabel)
						{
							m_eCurrentFeedbackBarDirection = EFeedbackBarDirection_Left;
						}
and the blue bar will remain favouring Only the LEFT side. any idea how to initialise those values, it would probably solve this issue :(

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: some questions, need help

Post by yrenard »

jamesLocal wrote: 1.) According to a forum ( viewtopic.php?f=10&t=237 ) , it says you guys has tried for 3 control commands.

I would like to try it out too, Can you please provide me with the files, to run the example?
No, this has not been fully integrated in the official release, and the museum application can not be redistributed with OpenViBE because it uses proprietary technologies.
jamesLocal wrote: 2. ) I did as you told in the previous reply
The ovpCGrazVisualization4Classes.cpp your pointed out is just branched from the original ovpCGrazVisualization.cpp file. So you could diff them two and check what the differences are.
a.) According to the code these values are initialised, with incorrect values [l_sMaxStateLabel and l_f64MaxState ] (i think its not completed yet)

< ... >

and the blue bar will remain favouring Only the LEFT side. any idea how to initialise those values, it would probably solve this issue :(
I think everything is fine in the part of Fabien's code you are pointing out.
l_sMaxStateLabel is initialized with an invalid value making later tests fallback to the else block :

Code: Select all

m_eCurrentFeedbackBarDirection = EFeedbackBarDirection_None;
l_sCurrentStateLabel is actually initialized at line 381 for each iteration of the loop :

Code: Select all

CString l_sCurrentStateLabel = CString(m_oStateInputHandle->getDimensionLabel(0,i));
Everything here looks reasonable to me.

Hope this helps,
Yann

jamesLocal
Posts: 27
Joined: Sun Jun 27, 2010 3:44 pm

Re: some questions, need help

Post by jamesLocal »

Sorry i'm not clear here
_sMaxStateLabel is initialized with an invalid value making later tests fallback to the else block :
according to my file it never goes in to the else block :(, because

Code: Select all

							CString l_sCurrentStateLabel = CString(m_oStateInputHandle->getDimensionLabel(0,i));
l_sCurrentStateLabel gets initialise to an EMPTY string :( . Therefore when
l_sMaxStateLabel = ""; and l_sCurrentStateLabel are EMPTY strings it always satisfies

Code: Select all

if(l_sMaxStateLabel == m_s64LeftLabel)
						{
							m_eCurrentFeedbackBarDirection = EFeedbackBarDirection_Left;
						}
If i'm correct you will find the blue bar only onto the left side of the window. (most of the time i am wrong so this might not happen either)

I have attached my version of the ovpGrazVisualization.cpp file. if time persist could you tell what i did wrong?
Attachments
ovpCGrazVisualization.cpp
(30.49 KiB) Downloaded 285 times

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: some questions, need help

Post by yrenard »

Dear jamesLocal,

m_s64LeftLabel is initialized from a box setting at line 220 in your file. It is most likely not an empty string. So the if(l_sMaxStateLabel == m_s64LeftLabel) should fail if l_sMaxStateLabel is empty.

About the fact that l_sCurrentStateLabel is also emtpy, I guess that is because Fabien used this box with a different classifier. This classifier probably had some labels on its output. I'm sorry I can not help much about those boxes as I don't know exactly how they worked.

What you could do is update that 4 classes graz visualization box to consider the values based on their indices instead of dimension labels (which should not be used anywhere else than for "human readable" information)

Hope this helps,
Yann

Post Reply