function myOcularExecuter(currentData) {
    return new Promise(function (resolve, reject) {
        var options = {
            mode: 'binary',
            args: [] 
        };  
        let results ={};
        var ocularShell = new PythonShell('/backend/pythonscripts/ocularArtifact/ocularFilter.py');
        ocularShell.send(JSON.stringify(currentData.channels));
        ocularShell.on('message', function (message) {
            results['channels'] = JSON.parse(message)['channels']  
            results['debug'] = currentData.debug;
            results['annotations']=currentData.annotations;
            results['patientInfo']=currentData.patientInfo;
        });  
        // end the input stream and allow the process to exit
        ocularShell.end(function (err,code,signal) {
            if (err) reject(err);
            resolve ({r: results, c: code, s: signal});
        });
    });
}
/**  
 * ocular artifact executer, eturns a promise
 * @param {Object} currentData edf object structure 
 * @returns {Promise} PythonShell execution of ocular filter
 */
ocular artifact executer, eturns a promise
@param {Object} currentData edf object structure
@returns {Promise} PythonShell execution of ocular filter
ocular artifact executer eturns a promise @param { Object } currentData edf object structure @returns { Promise } PythonShell execution of ocular filter
function myOcularExecuter(currentData) {
    return new Promise(function (resolve, reject) {
        var options = {
            mode: 'binary',
            args: [] 
        };  
        let results ={};
        var ocularShell = new PythonShell('/backend/pythonscripts/ocularArtifact/ocularFilter.py');
        ocularShell.send(JSON.stringify(currentData.channels));
        ocularShell.on('message', function (message) {
            results['channels'] = JSON.parse(message)['channels']  
            results['debug'] = currentData.debug;
            results['annotations']=currentData.annotations;
            results['patientInfo']=currentData.patientInfo;
        });  
        ocularShell.end(function (err,code,signal) {
            if (err) reject(err);
            resolve ({r: results, c: code, s: signal});
        });
    });
}
function myOcularExecuter ( currentData ) { return new Promise ( function ( resolve , reject ) { var options = { mode : 'binary' , args : [ ] } ; let results = { } ; var ocularShell = new PythonShell ( '/backend/pythonscripts/ocularArtifact/ocularFilter.py' ) ; ocularShell . send ( JSON . stringify ( currentData . channels ) ) ; ocularShell . on ( 'message' , function ( message ) { results [ 'channels' ] = JSON . parse ( message ) [ 'channels' ] results [ 'debug' ] = currentData . debug ; results [ 'annotations' ] = currentData . annotations ; results [ 'patientInfo' ] = currentData . patientInfo ; } ) ; ocularShell . end ( function ( err , code , signal ) { if ( err ) reject ( err ) ; resolve ( { r : results , c : code , s : signal } ) ; } ) ; } ) ; }
ocular artifact executer, eturns a promise
 @param {Object} currentData edf object structure
 @returns {Promise} PythonShell execution of ocular filter
ocular artifact executer eturns a promise @param { Object } currentData edf object structure @returns { Promise } PythonShell execution of ocular filter
// end the input stream and allow the process to exit