OpenViBE forum

The OpenViBE community
It is currently Sat Dec 16, 2017 8:32 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Oct 05, 2017 11:38 pm 
Offline

Joined: Tue Apr 18, 2017 5:44 am
Posts: 13
Hello,

I am working on revising graz visualization box to show accuracy bar for 4 class(Left,Right,Down and Up)

Looking at the source code, i found following areas with notes:

// @fixme for >2 classes
void CGrazVisualization::updateConfusionMatrix(float64 f64VoteAggregate)
{
if(m_eCurrentDirection == EArrowDirection_Left || m_eCurrentDirection == EArrowDirection_Right)
{
const uint32 l_ui32TrueDirection = m_eCurrentDirection - 1;

const uint32 l_ui32ThisVote = (f64VoteAggregate < 0 ? 0 : 1);

(m_oConfusion.getBuffer())[l_ui32TrueDirection*2 + l_ui32ThisVote]++;


void CGrazVisualization::drawBar()
{
const gint l_iWindowWidth = m_pDrawingArea->allocation.width;
const gint l_iWindowHeight = m_pDrawingArea->allocation.height;

float64 l_f64UsedScale = m_f64BarScale;
if(m_bPositiveFeedbackOnly)
{
// @fixme for multiclass
const uint32 l_ui32TrueDirection = m_eCurrentDirection - 1;
const uint32 l_ui32ThisVote = (m_f64BarScale < 0 ? 0 : 1);
if(l_ui32TrueDirection != l_ui32ThisVote)
{
l_f64UsedScale = 0;
}
}

gint l_iRectangleWidth = static_cast<gint>(fabs(l_iWindowWidth * fabs(l_f64UsedScale) / 2));

l_iRectangleWidth = (l_iRectangleWidth>(l_iWindowWidth/2)) ? (l_iWindowWidth/2) : l_iRectangleWidth;

void CGrazVisualization::drawArrow(EArrowDirection eDirection)
{
gint l_iWindowWidth = m_pDrawingArea->allocation.width;
gint l_iWindowHeight = m_pDrawingArea->allocation.height;

gint l_iX = 0;
gint l_iY = 0;

switch(eDirection)
{
case EArrowDirection_None:
this->drawArrow(EArrowDirection_Left);
this->drawArrow(EArrowDirection_Right);
// this->drawArrow(EArrowDirection_Up);
// this->drawArrow(EArrowDirection_Down);
break;

I don't know c++. Can anybody help me with that?

Thanks.


Attachments:
ovpCGrazVisualization.cpp [25.59 KiB]
Downloaded 13 times
Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 14, 2017 8:02 pm 
Offline

Joined: Wed Aug 30, 2017 7:14 pm
Posts: 2
Hello,

I need to have a scenario on openvibe similar to "mi-csp-1-acquisition", but with 4 classes (both hands and both feet).

How can I'm modification the "Graz Motor Imagery BCI Stimulator" box or write the script .lua on "Lua Stimulator" box?

Thanks!!!


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 16, 2017 8:09 am 
Offline

Joined: Thu Feb 09, 2017 10:17 am
Posts: 65
Hello,

I took the liberty of merging the 2 post, are they are asking for more or less the same thing.
Currently if you want to have more than 2 classes with a graz visualisation, you'll have to do some coding.
hkn1304 is correct; this is the file that should be modified for 4 classes Graz visualization.

This feature is not in the Inria's immediate timeline. However, if anybody wishes to contribute a 4-class graz components and/or scenarios, we are happy to consider including them.

Cheers,


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 01, 2017 8:53 am 
Offline

Joined: Tue Apr 18, 2017 5:44 am
Posts: 13
Hello Luciano,

For the acquisition of more than 2 class, i managed to change Lua script for 4 class. Here is how:

1.Copy script in docx file and paste into original lua script file(website doesn't allow me to upload :? ) and then change the filename in openvibe as described by pointing where you saved.
2. Do the necessary changes described in step 2. This will bring you the 3rd and 4th class items in stimulator.

That should suffice and work.

PS: I don't know Lua either, i just evaluated the logic and changed it but it worked in my project. :P

Happy hacking!


Attachments:
lua4class_step2.png
lua4class_step2.png [ 34.25 KiB | Viewed 135 times ]
lua4class_step1.png
lua4class_step1.png [ 48.19 KiB | Viewed 135 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 01, 2017 8:58 am 
Offline

Joined: Tue Apr 18, 2017 5:44 am
Posts: 13
Hello tgaugry,

I evaluated the code with my friend who knows C++ but he said only changing Grazvisualization.cpp file couldn't solve the problem because it may be related with the other file. Is this correct?

If i fix only the Grazvisualization.cpp file, would that solve my problem?

Thanks.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 02, 2017 10:00 am 
Offline

Joined: Thu Feb 09, 2017 10:17 am
Posts: 65
Hi,

Quote:
it may be related with the other file.

Can you tell me which other file you are talking about ?

Anyway, there isn't many directly related file. Boxes are supposedly contained within their cpp/h files, so you will likely need to change the header ovpCGrazVisualization.h.
Other than that, there is the interface file openvibe-simple-visualisation-GrazVisualization.ui or the arrows openvibe-simple-visualisation-GrazVisualization-*.png; i don't see why you would want to modify these.
Juging from the headers, i don't think there is any other file that needs to be changed.

Can you tell me what your friend though needed modification ?

Cheers,


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.