Skip to content

Commit

Permalink
Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
gurayerus committed Sep 13, 2024
1 parent dbdf31d commit 8dc6de2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
19 changes: 8 additions & 11 deletions src/NiChart_Viewer/src/pages/view_plot_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions src/NiChart_Viewer/src/pages/workflow_sMRI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8dc6de2

Please sign in to comment.