Skip to content

Commit

Permalink
Add help
Browse files Browse the repository at this point in the history
  • Loading branch information
gurayerus committed Dec 8, 2024
1 parent 12b41d0 commit 2307410
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
36 changes: 29 additions & 7 deletions src/viewer/pages/prep_sMRI_dicomtonifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,24 @@ def panel_wdir() -> None:
)
st.session_state.flags["dir_out"] = True

@st.dialog("Data organization") # type:ignore
def help_input_data():
@st.dialog("Working Directory") # type:ignore
def help_working_dir():
st.markdown(
"""
### Working Directory:
This is a .
- A NiChart pipeline executes a series of steps, with input/output files organized in a predefined folder structure, the **"working directory"**.
- Set an **"output path"** (desktop app only) and a **"dataset name"** to define the **working directory** for your analysis. You only need to set the working directory once.
- The **dataset name** can be any identifier that describes your analysis or data; it does not need to match the input study or data folder name.
- On the desktop app, you can initiate a NiChart pipeline by selecting the **working directory** from a previously completed task.
- On the cloud app, the results are deleted in regular intervals, so they may not be available.
"""
)
st.write('Example MUSE data file:')

if st.button('I need help 🤔'):
help_input_data()
if st.button('Get help 🤔', key='key_btn_working_dir'):
help_working_dir()


def panel_indicoms() -> None:
Expand Down Expand Up @@ -108,6 +114,22 @@ def panel_indicoms() -> None:
icon=":material/thumb_up:",
)

@st.dialog("DICOM Data") # type:ignore
def help_in_dicoms():
st.markdown(
"""
- Upload or select the input DICOM folder containing all DICOM files. Nested folders are supported.
- On the desktop app, a symbolic link named **"Dicoms"** will be created in the **working directory**, pointing to your input DICOM folder.
- On the cloud platform, you can directly drag and drop your DICOM files or folders and they will be uploaded to the **"Dicoms"** folder within the **working directory**.
- On the cloud, **we strongly recommend** compressing your DICOM data into a single ZIP archive before uploading. The system will automatically extract the contents of the ZIP file into the **"Dicoms"** folder upon upload.
"""
)

if st.button('Get help 🤔', key='key_btn_help_in_dicoms'):
help_in_dicoms()

def panel_detect() -> None:
"""
Expand Down
3 changes: 1 addition & 2 deletions src/viewer/pages/workflow_sMRI_MLScores.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ def help_input_data():
st.write('Example demographic data file:')
st.dataframe(df_demog)


if st.button('I need help 🤔'):
if st.button('Get help 🤔'):
help_input_data()

# Panel for running MLScore
Expand Down
8 changes: 4 additions & 4 deletions src/viewer/utils/utils_st.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ def util_panel_workingdir(app_type: str) -> None:
# Read output folder
if app_type == "desktop":
# Read output folder from the user
helpmsg = "Results will be saved to the output folder.\n\nChoose the path by typing it into the text field or using the file browser to browse and select it"
helpmsg = "Results will be saved to a dedicated folder at the output path.\n\nChoose the path by typing it into the text field or using the file browser to browse and select it"
dir_out = user_input_foldername(
"Select folder",
"btn_sel_dir_out",
"Output folder",
"Output path",
st.session_state.paths["file_search_dir"],
st.session_state.paths["dir_out"],
helpmsg,
Expand All @@ -204,10 +204,10 @@ def util_panel_workingdir(app_type: str) -> None:

# Read dataset name (used to create a folder where all results will be saved)
helpmsg = (
"Please provide a name for your task.\n\n A dedicated folder with this name will be created to store all input and output data associated with the analysis.\n\n The identifier can be any descriptive label; it doesn't need to match the input study or dataset name.\n\n Switch between tasks to run different pipelines or analyze new datasets."
"Please provide a unique name for your data/analysis (example: MyStudy1).\n\n A dedicated folder with this name will be created to store all input and output data associated with the analysis."
)
st.session_state.dset = user_input_textfield(
"Task Identifier", st.session_state.dset, helpmsg, False
"Dataset Name", st.session_state.dset, helpmsg, False
)

# Create results folder
Expand Down

0 comments on commit 2307410

Please sign in to comment.