function myLoretaExecuter(currentData) {
    return new Promise(function (resolve, reject) {
        let options = { 
            mode: 'text',
            args: ['-l nyL.mat', '-v nyvert.mat', '-f nyface.mat', '-c nyCh.mat', '-d nyEEG_R.txt'] 
        };
        let loretaShell = new PythonShell('/backend/pythonscripts/loreta-new/loretaFilter.py',options);
        let results={};
        // channels are sent through stdin as text for avoid string limits
        loretaShell.send(JSON.stringify(currentData.channels));  
        loretaShell.on('message',(message) => { 
            results = message      
        });
        loretaShell.end((err,code,signal) =>{
            if (err) reject(err);
            resolve ({r: results, c: code, s: signal});
        });
    });
}
/**  
 * async loreta executer generalization 
 * @param {currentData}   
 * @returns {Promise} PythonShell execution of loreta filter
 */
async loreta executer generalization
@param {currentData}
@returns {Promise} PythonShell execution of loreta filter
async loreta executer generalization @param { currentData } @returns { Promise } PythonShell execution of loreta filter
function myLoretaExecuter(currentData) {
    return new Promise(function (resolve, reject) {
        let options = { 
            mode: 'text',
            args: ['-l nyL.mat', '-v nyvert.mat', '-f nyface.mat', '-c nyCh.mat', '-d nyEEG_R.txt'] 
        };
        let loretaShell = new PythonShell('/backend/pythonscripts/loreta-new/loretaFilter.py',options);
        let results={};
        loretaShell.send(JSON.stringify(currentData.channels));  
        loretaShell.on('message',(message) => { 
            results = message      
        });
        loretaShell.end((err,code,signal) =>{
            if (err) reject(err);
            resolve ({r: results, c: code, s: signal});
        });
    });
}
function myLoretaExecuter ( currentData ) { return new Promise ( function ( resolve , reject ) { let options = { mode : 'text' , args : [ '-l nyL.mat' , '-v nyvert.mat' , '-f nyface.mat' , '-c nyCh.mat' , '-d nyEEG_R.txt' ] } ; let loretaShell = new PythonShell ( '/backend/pythonscripts/loreta-new/loretaFilter.py' , options ) ; let results = { } ; loretaShell . send ( JSON . stringify ( currentData . channels ) ) ; loretaShell . on ( 'message' , ( message ) => { results = message } ) ; loretaShell . end ( ( err , code , signal ) => { if ( err ) reject ( err ) ; resolve ( { r : results , c : code , s : signal } ) ; } ) ; } ) ; }
async loreta executer generalization
 @param {currentData}
 @returns {Promise} PythonShell execution of loreta filter
async loreta executer generalization @param { currentData } @returns { Promise } PythonShell execution of loreta filter
// channels are sent through stdin as text for avoid string limits