audrey06100 commited on
Commit
f994ab3
·
verified ·
1 Parent(s): b1a6869

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -12
app.py CHANGED
@@ -24,7 +24,7 @@ readme = """
24
  The following steps will guide you through the process of mapping your EEG channels to our template channels.
25
 
26
  ### Step1: Initial Matching and Scaling
27
- After clicking on ``Mapping`` button, we will first match your channels to our template channels by their names. Using the matched channels as reference points, we will apply Thin Plate Spline (TPS) transformation to scale your montage to align with our template's dimensions. The template montage and your scaled montage will be displayed side by side for comparison. Channels that do not have a match in our template will be **highlighted in red**.
28
  - If your data includes all the 30 template channels, you will be directed to **Mapping Results**.
29
  - If your data doesn't include all the 30 template channels and you have some channels that do not match the template, you will be directed to **Step2**.
30
  - If all your channels are included in our template but you have fewer than 30 channels, you will be directed to **Step3**.
@@ -233,7 +233,7 @@ with gr.Blocks() as demo:
233
  # --------------------input----------------------
234
  in_loc_file = gr.File(label="Channel locations (.loc, .locs, .xyz, .sfp, .txt)",
235
  file_types=[".loc", "locs", ".xyz", ".sfp", ".txt"])
236
- map_btn = gr.Button("Mapping")
237
  # -------------------mapping---------------------
238
  desc_md = gr.Markdown(visible=False)
239
  # step1 : initial matching and scaling
@@ -344,8 +344,8 @@ with gr.Blocks() as demo:
344
  "input_data" : "",
345
  "output_data" : ""
346
  },
347
- "totalBatchNum" : None,
348
- "sampleRate" : None
349
  }
350
  }
351
  return {app_info_json : app_info,
@@ -370,7 +370,7 @@ with gr.Blocks() as demo:
370
  in_samplerate : gr.Textbox(value=None),
371
  run_btn : gr.Button(interactive=False),
372
  batch_md : gr.Markdown(visible=False),
373
- out_data_file : gr.File(visible=False)}
374
 
375
 
376
  # +========================================================================================+
@@ -491,9 +491,7 @@ with gr.Blocks() as demo:
491
  elif in_num == matched_num:
492
  md = """
493
  ### Step3: Filling Remaining Template Channels
494
- To run the model successfully, we need to ensure that all 30 template channels are filled.
495
- In this step, you are required to select one of the methods provided below to fill the
496
- remaining empty template channels.
497
  """
498
  stage1_info["state"] = "step3-select-method"
499
  app_info["stage1"] = stage1_info
@@ -528,7 +526,6 @@ with gr.Blocks() as demo:
528
  # update the list of missingTemplates to exclude those filled in step2
529
  stage1_info["missingTemplates"] = app_utils.get_empty_templates(channel_info["templateOrder"],
530
  channel_info["templateDict"])
531
-
532
  # -----------------------------determine the next step------------------------------
533
  # step2 to step4
534
  # all the unmatched tpl_channels were filled
@@ -557,9 +554,7 @@ with gr.Blocks() as demo:
557
  else:
558
  md = """
559
  ### Step3: Filling Remaining Template Channels
560
- To run the model successfully, we need to ensure that all 30 template channels are filled.
561
- In this step, you are required to select one of the methods provided below to fill the
562
- remaining empty template channels.
563
  """
564
  stage1_info["state"] = "step3-select-method"
565
  app_info["stage1"] = stage1_info
 
24
  The following steps will guide you through the process of mapping your EEG channels to our template channels.
25
 
26
  ### Step1: Initial Matching and Scaling
27
+ After clicking on ``Map`` button, we will first match your channels to our template channels by their names. Using the matched channels as reference points, we will apply Thin Plate Spline (TPS) transformation to scale your montage to align with our template's dimensions. The template montage and your scaled montage will be displayed side by side for comparison. Channels that do not have a match in our template will be **highlighted in red**.
28
  - If your data includes all the 30 template channels, you will be directed to **Mapping Results**.
29
  - If your data doesn't include all the 30 template channels and you have some channels that do not match the template, you will be directed to **Step2**.
30
  - If all your channels are included in our template but you have fewer than 30 channels, you will be directed to **Step3**.
 
233
  # --------------------input----------------------
234
  in_loc_file = gr.File(label="Channel locations (.loc, .locs, .xyz, .sfp, .txt)",
235
  file_types=[".loc", "locs", ".xyz", ".sfp", ".txt"])
236
+ map_btn = gr.Button("Map")
237
  # -------------------mapping---------------------
238
  desc_md = gr.Markdown(visible=False)
239
  # step1 : initial matching and scaling
 
344
  "input_data" : "",
345
  "output_data" : ""
346
  },
347
+ "sampleRate" : None,
348
+ "totalBatchNum" : None
349
  }
350
  }
351
  return {app_info_json : app_info,
 
370
  in_samplerate : gr.Textbox(value=None),
371
  run_btn : gr.Button(interactive=False),
372
  batch_md : gr.Markdown(visible=False),
373
+ out_data_file : gr.File(value=None, visible=False)}
374
 
375
 
376
  # +========================================================================================+
 
491
  elif in_num == matched_num:
492
  md = """
493
  ### Step3: Filling Remaining Template Channels
494
+ Select one of the methods provided below to fill the remaining empty template channels.
 
 
495
  """
496
  stage1_info["state"] = "step3-select-method"
497
  app_info["stage1"] = stage1_info
 
526
  # update the list of missingTemplates to exclude those filled in step2
527
  stage1_info["missingTemplates"] = app_utils.get_empty_templates(channel_info["templateOrder"],
528
  channel_info["templateDict"])
 
529
  # -----------------------------determine the next step------------------------------
530
  # step2 to step4
531
  # all the unmatched tpl_channels were filled
 
554
  else:
555
  md = """
556
  ### Step3: Filling Remaining Template Channels
557
+ Select one of the methods provided below to fill the remaining empty template channels.
 
 
558
  """
559
  stage1_info["state"] = "step3-select-method"
560
  app_info["stage1"] = stage1_info