ihgumilar / Hyperscanning2-redesign

Experiment of hyperscanning2-redesign is adding questionnaire inside VR and also improved the UNITY that is used for the experiment.
1 stars 1 forks source link

Documentation of phd_codes #57

Open ihgumilar opened 1 year ago

ihgumilar commented 1 year ago

Start from here f7913b2.

ihgumilar commented 1 year ago
""" * Extract experimental data from raw EEG data which is in csv format.\
            Every raw csv file of EEG data must contain 48 markers in total (opening & closing).\
            Basically, there are 24 markers. However, experimental data is from marker 7 to 24.\
            (36 markers if including opening & closing markers).

        :param path_2_csv_files: path to raw EEG file (csv format).
        :type path_2_csv_files: str
        :param path_2_save_experimental_file: path to save extracted experimental data of EEG (which is in *.fif).
        :type path_2_save_experimental_file: str
        :param labelsequence_experiment: order of label sequence.
        :type labelsequence_experiment: list
        :param bad_files: raw EEG file(s) that want to be skipped to be processed by the script, defaults to []
        :type bad_files: list, optional
        :raises IndexError: _description_
        :raises ValueError: _description_

        .. note:: * returns: :literal:`*.fif` files  
                       * File name format :
                       * EEG-Subject no_EyeCondition__TrainingCondition_HandCondition_raw.fif
                           * **EEG-S01-averted_left_tracking_raw**.
                       * There are 18 files in total for each participant.

        """
ihgumilar commented 1 year ago
""" * Extract experimental data from raw EEG data which is in csv format.\
            Every raw csv file of EEG data must contain 48 markers in total (opening & closing).\
            Basically, there are 24 markers. However, experimental data is from marker 7 to 24.\
            (36 markers if including opening & closing markers).

        :param path_2_csv_files: path to raw EEG file (csv format).
        :type path_2_csv_files: str
        :param path_2_save_experimental_file: path to save extracted experimental data of EEG (which is in *.fif).
        :type path_2_save_experimental_file: str
        :param labelsequence_experiment: order of label sequence.
        :type labelsequence_experiment: list
        :param bad_files: raw EEG file(s) that want to be skipped to be processed by the script, defaults to []
        :type bad_files: list, optional
        :raises IndexError: _description_
        :raises ValueError: _description_

        .. note:: * returns: :literal:`*.fif` files  
                       * File name format :
                       * EEG-Subject no_EyeCondition__TrainingCondition_HandCondition_raw.fif
                           * **EEG-S01-averted_left_tracking_raw**.
                       * There are 18 files in total for each participant.

        """
ihgumilar commented 1 year ago
""" * After the data of EEG has been extracted, it is separated between left and right hand data. \
            Due to that, we need to combine both data by using this function. During pre-training, participants need to point \
            their hands with right and left alternatively. It is 1 minute for each hand. Since there are two hands, \
            then it was 2 minutes for both hands. Similarly, during post-training, they need to do the same thing for both hands.

        :param path2data: path to separated raw EEG file (*fif).
        :type path2data: str
        :param path2storedata: path to save combined experimental data of EEG (*.fif).
        :type path2storedata: str
        :returns: EEG file
        :rtype: *.fif (mne)

        .. note:: * Each pair needs to point with the opposite hand. For example, if S1 points with right hand, \
                    then S2 needs to point with left hand.
                  * Odd subjects (1,3,5..) point with RIGHT-LEFT order.
                  * Even subjects(2,4,6..) point with LEFT-RIGHT order.
                  * The function has taken into consideration the above orders

                  * returns: 
                       * EEG file in :literal:`*.fif` format has the following name formatting :
                          * **SubjectNo_EyeCondition_TrainingCondition_HandCondition_raw.fif**

                       * In total, there are 6 files that will be resulted from each participant.\
                         e.g. :
                          #. S01-averted_post_left_right_point_combined_raw.fif
                          #. S01-averted_pre_right_left_point_combined_raw.fif
                          #. S01-direct_post_left_right_point_combined_raw.fif
                          #. S01-direct_pre_right_left_point_combined_raw.fif
                          #. S01-natural_post_left_right_point_combined_raw.fif
                          #. S01-natural_pre_right_left_point_combined_raw.fif

                       * Make sure the subject number that is written in file names begins with a leading zero, eg. 01, 02, 03.

        """
ihgumilar commented 1 year ago
"""
        **Objective** :

        - After the data of EEG has been extracted, it is separated between left and right hand data
          Due to that, we need to combine both data by using this function.
          Before the experiment (pre-training session), participants need to point their hands
          with right and left alternatively.  It is 1 minute for each hand. Since there are two hands, \n
          then it was 2 minutes for both hands. Participant watched white screen while doing this.

        **Parameters** :

        :param path2data: path to separated raw EEG file (*fif).
        :param path2storedata: path to save combined experimental data of EEG (output file in *.fif).

        :type path2data: str
        :type path2storedata: str

        :returns: EEG file
        :rtype: *.fif (mne)

        .. note:: - Each pair needs to point with the opposite hand. For example, if S1 points with right hand \n
                    then S2 needs to point with left hand.

                  - Odd subjects (1,3,5..) point with RIGHT-LEFT order.
                  - Even subjects(2,4,6..) point with LEFT-RIGHT order.
                  - The function has taken into consideration the above orders
                  - Make sure the subject number that is written in file names begins with a leading zero, eg. 01, 02, 03.

                  - Related to path2data parameter
                        Format of file name :
                                        - EEG-SubjectNo-EyeCondition_HandCondition_raw.fif
                                        e.g., EEG-S01-averted_left_point_raw.fif
                                        - EyeCondition is ONLY AVERTED . Read below

                                        Note : This function combines only hand pointing NOT TRACKING.
                                                Because we are interested in pre vs post training.
                                                Hand tracking is in training condition

                                                - The eye condition is ONLY averted.
                                                Basically, each participant sees only white screen. So whatever eye condition
                                                does not really matter. For the sake of coherence. We just put it averted
                                                During recording, the eye condition is set to averted in UNITY  .

                  - OUTPUT
                        EEG file in *.fif format with the following name formatting :

                        SubjectNo_EyeCondition_TrainingCondition_HandCondition_raw.fif

                        In total, there are 2 files that will be resulted from each participant.
                        e.g. :
                            1. S01-averted_post_left_right_point_combined_raw.fif
                            2. S01-averted_pre_right_left_point_combined_raw.fif

        """