From 8dc6de26373f9e60e8fe6accbc13bac39e4f2d8c Mon Sep 17 00:00:00 2001 From: gurayerus Date: Thu, 12 Sep 2024 22:58:04 -0400 Subject: [PATCH] Edit --- .../src/pages/view_plot_data.py | 19 ++++++++----------- src/NiChart_Viewer/src/pages/workflow_sMRI.py | 8 -------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/NiChart_Viewer/src/pages/view_plot_data.py b/src/NiChart_Viewer/src/pages/view_plot_data.py index e3c5dabf..dd97408b 100644 --- a/src/NiChart_Viewer/src/pages/view_plot_data.py +++ b/src/NiChart_Viewer/src/pages/view_plot_data.py @@ -20,14 +20,10 @@ def browse_file_folder(is_file, init_dir): root = tk.Tk() # root.withdraw() # Hide the main window if is_file == True: - out_path = filedialog.askopenfilenames(initialdir = init_dir, multiple=0) + out_path = filedialog.askopenfilename(initialdir = init_dir, multiple=0) else: out_path = filedialog.askdirectory(initialdir = init_dir) - - print('aaaaaa') - print(out_path[0:5]) - input() - + root.destroy() return out_path #hide_pages(["Image Processing", "Data Analytics"]) @@ -228,11 +224,12 @@ def filter_dataframe(df: pd.DataFrame, pid) -> pd.DataFrame: # Input file name (user can enter either using the file browser or type full path) default_spare_name = '' - fname_spare = st.sidebar.button("Select input file", on_click = browse_file_folder, key = 'fname_spare_btn', args=[True, dir_root]) - if fname_spare == False: - fname_spare = default_spare_name - spare_csv = st.sidebar.text_input("Enter the name of the ROI csv file:", value = fname_spare, - label_visibility="collapsed") + fname_spare = default_spare_name + if st.sidebar.button("Select input file"): + fname_spare = browse_file_folder(True, dir_root) + spare_csv = st.sidebar.text_input("Enter the name of the ROI csv file:", + value = fname_spare, + label_visibility="collapsed") if os.path.exists(spare_csv): df = pd.read_csv(spare_csv) diff --git a/src/NiChart_Viewer/src/pages/workflow_sMRI.py b/src/NiChart_Viewer/src/pages/workflow_sMRI.py index bfd83730..adeee88c 100644 --- a/src/NiChart_Viewer/src/pages/workflow_sMRI.py +++ b/src/NiChart_Viewer/src/pages/workflow_sMRI.py @@ -21,15 +21,7 @@ def browse_file_folder(is_file, init_dir): out_path = filedialog.askopenfilename(initialdir = init_dir) else: out_path = filedialog.askdirectory(initialdir = init_dir) - - print('bb') - print(out_path) - root.destroy() - - print('aaa') - print(out_path) - return out_path st.markdown(