Example #1
0
    def init(self):
        """
        Global Constants
        """
        # 1.INIT Parent Class
        initbciclass.init(self)
        # 2.Alter or add other vars

        #INIT SAVING
        self.TASK = 'PRIME'  #
        self.subtask = "ALLTASKS"  #ALL TASKs in same FILE

        #INIT PRESENTATION VARS

        #Presentation PROTOCOL VARS
        self.PROTOCOL_TYPE = "prime"  #
        self.PROTOCOL_DESIGN = "normal"  #normal, test
        #presentation init screen
        self.INIT_TEXT = "Vamos iniciar a tarefa de Pre-treino:"

        self.STIM_TIME = 60 * 3  #s

        ##EXPERIMENT VARS

        #INIT prime Stimulus
        #random seed
        self.random_seed = None  #None or no argument seeds from current time or from an operating system specific randomness source if available
        #STIMULUS LIST
        self.audiostimulus_l = [
            "breathingv6.ogg", "imageryv6.ogg"
        ]  #stimulus file name from maincode.stimulus folder
        self.videostimulus_l = None
        self.imagestimulus_l = None
Example #2
0
    def init(self):
        """
        Global Constants
        """
        #1.INIT Parent Class
        initbciclass.init(self)
        #2.Alter or add other functions

        #INIT SAVING
        self.TASK = "REST"
        self.subtask = ""

        #INIT PRESENTATION VARS
        #Presentation PROTOCOL VARS- TODO: randomize protocol_feature
        self.PROTOCOL_TYPE = "REST"  #NFT or REST the functions will change it accordingly
        self.PROTOCOL_DESIGN = "normal"  #ABA or Normal -
        self.STIM_TIME = 60 * 3  #60*2
Example #3
0
    def init(self):
        """
        Global Constants
        """
        #1.INIT Parent Class
        initbciclass.init(self)
        #2.Alter or add other functions

        #INIT SAVING
        self.TASK = 'REPORT'
        self.subtask = ""
        self.SAVE=False #always

        #INIT PRESENTATION VARS
        #Presentation PROTOCOL VARS- TODO: randomize protocol_feature
        self.PROTOCOL_TYPE = "REPORT" # report
        self.PROTOCOL_DESIGN = "normal" #ABA or Normal -
        #presentation init screen
        self.INIT_TEXT = "TAREFA: RESPONDER AOS QUESTIONÁRIOS \n\n\nPor favor, pegue nos questionários indicados e preencha. \n\n\nAssim que preencher, continue com as tarefas neste computador após clicar no enter."
        #stimulus screen(No Stim)
        self.STIMULUS_TEXT ="\n\n\n\n\n\n\n\n\nCarregando tarefa....."
        self.STIM_TIME = 0.5 #s
Example #4
0
    def init(self):
        """
        Global Constants
        """
        #1.INIT Parent Class
        initbciclass.init(self)
        #2.Alter or add other functions

        #INIT SAVING
        self.TASK = 'NFT'  # NFT
        self.subtask = ""  #ALL TASKs in same FILE

        #INIT PRESENTATION VARS
        #Presentation PROTOCOL VARS- TODO: randomize protocol_feature
        self.PROTOCOL_TYPE = ""  #NFT or REST the functions will change it accordingly
        self.PROTOCOL_DESIGN = "normal"  #ABA or Normal -
        #presentation init screen
        self.INIT_TEXT = ""

        self.STIM_TIME = 30  #s

        ##EXPERIMENT VARS
        self.datatdir = my.get_test_folder(foldername="e2_data")
        self.subjectdir = "EG/S001"  #
        self.fileid = "online_result"  #id that identifies the file

        #protocol features of NFT
        self.PROTOCOL_FEATURES_L = ["SMR", "upper_alpha"]  #List
        self.PROTOCOL_FEATURE = "SMR"  #SMR or upper_alpha
        self.random_seed = None  #None or no argument seeds from current time or from an operating system specific randomness source if available

        #OFFLINE PROCESSING -
        #reward and inhibit bands - dict objects to buffer band features
        self.initial_reward_bands, self.initial_inhibit_bands = {}, {
        }  #initial bands
        self.reward_bands, self.inhibit_bands = {}, {
        }  #state bands - updated during online neurofeedback
Example #5
0
    def init(self):
        """
        Global Constants
        """
        #1.INIT Parent Class
        initbciclass.init(self)
        #2.Alter or add other functions

        #INIT SAVING
        self.TASK = 'NFT'  # NFT
        self.subtask = ""  #ALL TASKs in same FILE

        #INIT PRESENTATION VARS
        #Presentation PROTOCOL VARS- TODO: randomize protocol_feature
        self.PROTOCOL_TYPE = ""  #NFT or REST the functions will change it accordingly
        self.PROTOCOL_DESIGN = "normal"  #ABA or Normal -
        #presentation init screen
        self.INIT_TEXT = ""

        self.STIM_TIME = 30  #s

        ##EXPERIMENT VARS

        #protocol features of NFT
        self.PROTOCOL_FEATURES_L = ["SMR", "upper_alpha"]  #List
        self.PROTOCOL_FEATURE = "SMR"  #SMR or upper_alpha
        self.random_seed = None  #None or no argument seeds from current time or from an operating system specific randomness source if available

        #OFFLINE PROCESSING -
        self.get_baseline_thresholds = False  #play
        self.acquire_baseline_data = False  #True, get data or False, simulate
        #reward and inhibit bands - dict objects to buffer band features
        self.initial_reward_bands, self.initial_inhibit_bands = {}, {
        }  #initial bands
        self.reward_bands, self.inhibit_bands = {}, {
        }  #state bands - updated during online neurofeedback

        #ONLINE PROCESSING

        #INIT PARAMETERS of nftalgorithm
        #for advanced edition go to nftalgorithm.py
        self.window_time = 1024  #ms window in ms to segment the data and process - NOTE:2^8 is better for n_fft (window to segment and epoching)
        self.sampleRate = 1000  #Hz sample rate of the EEG amplifier
        self.blocktime = 50  #ms multiple of block to add in window ring buffer (multiples of this value will be added) #NOTE: Because of online routine is ~250ms it will put >200ms online, and it's not constant
        self.calculate_iaf = False  #True/False - activate Individual Alpha Frequency calculation
        self.show_inhibit_bands = False  #True/False - show or not inhibit bands in feedback(goes to presentation)

        #PREPROCESSING (https://en.wikipedia.org/wiki/Electroencephalography)
        self.l_freq = 40  #hz - for limit see bands used for feature - Till 40 we let pass some muscle artifacts
        self.h_freq = 1  #Hz - NOTE:Removes DC offset= constant freqs
        self.subsample = None  #None | hz  - it interferes with fft
        self.select_chs = [
            'Fp1', 'Fp2', 'Fz', 'Pz'
        ]  #chs used throught the processing #NOTE: Include Fp1 and Fp2 for rejection of blinks and saccades
        self.ref_channels = [
        ]  #rereferencing ; ref_channels= "average"  |  [] No-rereferencing | ['CH'] for rereference - WARNING:online is better to be Cz or Pz, not average
        self.rej_max_peaktopeak = 100e-6  #V
        self.rej_min_peaktopeak = 0.5e-6  #V

        #PROCESSING
        self.n_fft = 1024  #samples, window_time * sampleRAte
        self.n_per_seg = self.n_fft * 1  #fft window size percentage
        self.n_overlap = int(math.ceil(self.n_per_seg * 0.25))
        self.pink_max_r2 = None  #None  #0.95 , None - doesnt check for noise in signal (#WARNING: if used it stops program)
        self.threshold_reward_level = -0.38  #std (-0.38*std => 65% above)
        self.threshold_inhibit_level = 1
        self.feedback_reward_level = 0
        self.feedback_inhibit_level = 0

        #additional processing
        self.adaptative_threshold_intask = None  #s None| int seconds #update during task
        self.adaptative_threshold_aftertask = True  #update threshold at the end of the nfttask