audrey06100 commited on
Commit
4216e76
·
verified ·
1 Parent(s): 06edee1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -42
app.py CHANGED
@@ -30,8 +30,11 @@ If your data doesn't contain all of the mentioned channels, we will:
30
  2. Use <u>Imputation</u> to fill the missing channels' value:
31
  - **zero**: fill the missing channels with zeros.
32
  - **adjacent**: fill the missing channels using neighboring channels' value.
 
33
  >Note: The imputed channels **need to be removed** after the data being reconstructed.
34
 
 
 
35
  ### Missing channels
36
  The channels displayed here are those for which the template didn't find suitable channels to use, and utilized <u>Imputation</u> to fill the missing values.
37
  Therefore, you need to
@@ -48,49 +51,7 @@ icunet = """
48
  Electroencephalography (EEG) signals are often contaminated with artifacts. It is imperative to develop a practical and reliable artifact removal method to prevent the misinterpretation of neural signals and the underperformance of brain–computer interfaces. Based on the U-Net architecture, we developed a new artifact removal model, IC-U-Net, for removing pervasive EEG artifacts and reconstructing brain signals. IC-U-Net was trained using mixtures of brain and non-brain components decomposed by independent component analysis. It uses an ensemble of loss functions to model complex signal fluctuations in EEG recordings. The effectiveness of the proposed method in recovering brain activities and removing various artifacts (e.g., eye blinks/movements, muscle activities, and line/channel noise) was demonstrated in a simulation study and four real-world EEG experiments. IC-U-Net can reconstruct a multi-channel EEG signal and is applicable to most artifact types, offering a promising end-to-end solution for automatically removing artifacts from EEG recordings. It also meets the increasing need to image natural brain dynamics in a mobile setting.
49
  """
50
 
51
- chk_html = """
52
- <form name="test" id="chs-form">
53
- <input type="checkbox" />
54
- </form>
55
- """
56
-
57
- chk_script = """
58
-
59
- let channels = document.getElementById("chs-checkbox");
60
-
61
- // init generate checkboxgroup
62
- let obj = document.getElementById("map-result").value; // emmm......
63
- let channels = obj.channels;
64
- let num = channels.length;
65
-
66
- for(i=0; i<num; i++){
67
- document.getElementById("gen-checkbox").
68
- innerHTML += '<input type="checkbox" class="channels" name="channel" value=channels[i].name />'
69
- }
70
 
71
- // check if mapping just finished
72
- const result = document.getElementById("map-result")
73
- result.addEventListener("change", function() {
74
- const res_obj = this.value;
75
-
76
- if(res_obj.fill_mode=="mean" && res_obj.missing_channels.length!=0 && !res_obj.start){
77
- gen_chkbox(res_obj.missing_channels);
78
- res_obj.start = True;
79
- }
80
- })
81
-
82
- function gen_chkbox(channels){
83
- let num = channels.length;
84
- let chs_form = document.getElementById("chs-form");
85
-
86
- chs_form.innerHTML = "";
87
- for(i=0; i<num; i++){
88
- chs_form.innerHTML += '<input type="checkbox" class="channels" name="channel" value=channels[i].name />'
89
- }
90
- }
91
-
92
-
93
- """
94
 
95
  with gr.Blocks() as demo:
96
 
 
30
  2. Use <u>Imputation</u> to fill the missing channels' value:
31
  - **zero**: fill the missing channels with zeros.
32
  - **adjacent**: fill the missing channels using neighboring channels' value.
33
+ - **mean**: you can choose this option to manually select which channels to impute the required one (averaging them).
34
  >Note: The imputed channels **need to be removed** after the data being reconstructed.
35
 
36
+ ### Mapping result
37
+
38
  ### Missing channels
39
  The channels displayed here are those for which the template didn't find suitable channels to use, and utilized <u>Imputation</u> to fill the missing values.
40
  Therefore, you need to
 
51
  Electroencephalography (EEG) signals are often contaminated with artifacts. It is imperative to develop a practical and reliable artifact removal method to prevent the misinterpretation of neural signals and the underperformance of brain–computer interfaces. Based on the U-Net architecture, we developed a new artifact removal model, IC-U-Net, for removing pervasive EEG artifacts and reconstructing brain signals. IC-U-Net was trained using mixtures of brain and non-brain components decomposed by independent component analysis. It uses an ensemble of loss functions to model complex signal fluctuations in EEG recordings. The effectiveness of the proposed method in recovering brain activities and removing various artifacts (e.g., eye blinks/movements, muscle activities, and line/channel noise) was demonstrated in a simulation study and four real-world EEG experiments. IC-U-Net can reconstruct a multi-channel EEG signal and is applicable to most artifact types, offering a promising end-to-end solution for automatically removing artifacts from EEG recordings. It also meets the increasing need to image natural brain dynamics in a mobile setting.
52
  """
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  with gr.Blocks() as demo:
57