Page 1 of 1

Graz visualization Box with 4 classes

Posted: Thu Oct 05, 2017 11:38 pm
by hkn1304
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.

Question Regarding the Graz visualization Box

Posted: Sat Oct 14, 2017 8:02 pm
by Luciano
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!!!

Re: Graz visualization Box with 4 classes

Posted: Mon Oct 16, 2017 8:09 am
by tgaugry
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,

Re: Graz visualization Box with 4 classes

Posted: Wed Nov 01, 2017 8:53 am
by hkn1304
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!

Re: Graz visualization Box with 4 classes

Posted: Wed Nov 01, 2017 8:58 am
by hkn1304
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.

Re: Graz visualization Box with 4 classes

Posted: Thu Nov 02, 2017 10:00 am
by tgaugry
Hi,
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,

Re: Graz visualization Box with 4 classes

Posted: Mon Sep 24, 2018 12:09 am
by amitpbarde
Hello!

Has anyone got the 4 classes running? If anyone's managed to integrate two more classes in, it'll be great to get hold of the code. Alternatively, it would be nice to know how chnages can be affected to the code to get this running.

Thanks,

Amit.