Spaces:
Sleeping
Sleeping
updated app.py
Browse files
app.py
CHANGED
|
@@ -432,7 +432,7 @@ def plot_probabilities(probabilities):
|
|
| 432 |
if len(probabilities) < 1:
|
| 433 |
return None
|
| 434 |
prob_df = pd.DataFrame({"labels": cell_types, "values": probabilities})
|
| 435 |
-
prob_df.to_csv('Cell_types_predictions.csv', index=False)
|
| 436 |
return prob_df
|
| 437 |
|
| 438 |
def run_mapping():
|
|
@@ -456,7 +456,7 @@ def run_registration(data_type, selected_idx):
|
|
| 456 |
return "Registration complete!"
|
| 457 |
|
| 458 |
def download_csv():
|
| 459 |
-
return 'Cell_types_predictions.csv'
|
| 460 |
|
| 461 |
|
| 462 |
def handle_data_type_change(dt):
|
|
@@ -488,7 +488,7 @@ with gr.Blocks() as demo:
|
|
| 488 |
slice_slider = gr.Slider(minimum=0, maximum=0, value=0, step=1, label="Slices", visible=False)
|
| 489 |
with gr.Column(scale=1):
|
| 490 |
gr.Markdown("### Step 3: Visualizing Allen Brain Cell Types Atlas")
|
| 491 |
-
gallery = gr.Gallery(label="ABC Atlas", value = gallery_images,)
|
| 492 |
gr.Markdown("**Step 4: Run cell type mapping**")
|
| 493 |
with gr.Row():
|
| 494 |
run_button = gr.Button("Run Mapping")
|
|
@@ -498,7 +498,7 @@ with gr.Blocks() as demo:
|
|
| 498 |
gr.Markdown("### Step 5: Quantitative results of the mapping model.")
|
| 499 |
prob_plot = gr.BarPlot(prob_df, x="labels", y="values", title="Cell Type Probabilities", scroll_to_output=True, x_label_angle=-90, height=400)
|
| 500 |
gr.Markdown("### Step 6: Download Results.")
|
| 501 |
-
download_button = gr.DownloadButton(label="Download Results", value='Cell_types_predictions.csv')
|
| 502 |
|
| 503 |
nifti_file.change(
|
| 504 |
load_nifti_or_png,
|
|
|
|
| 432 |
if len(probabilities) < 1:
|
| 433 |
return None
|
| 434 |
prob_df = pd.DataFrame({"labels": cell_types, "values": probabilities})
|
| 435 |
+
prob_df.to_csv('./Cell_types_predictions.csv', index=False)
|
| 436 |
return prob_df
|
| 437 |
|
| 438 |
def run_mapping():
|
|
|
|
| 456 |
return "Registration complete!"
|
| 457 |
|
| 458 |
def download_csv():
|
| 459 |
+
return './Cell_types_predictions.csv'
|
| 460 |
|
| 461 |
|
| 462 |
def handle_data_type_change(dt):
|
|
|
|
| 488 |
slice_slider = gr.Slider(minimum=0, maximum=0, value=0, step=1, label="Slices", visible=False)
|
| 489 |
with gr.Column(scale=1):
|
| 490 |
gr.Markdown("### Step 3: Visualizing Allen Brain Cell Types Atlas")
|
| 491 |
+
gallery = gr.Gallery(label="ABC Atlas", value = gallery_images,columns = 5, height = 450)
|
| 492 |
gr.Markdown("**Step 4: Run cell type mapping**")
|
| 493 |
with gr.Row():
|
| 494 |
run_button = gr.Button("Run Mapping")
|
|
|
|
| 498 |
gr.Markdown("### Step 5: Quantitative results of the mapping model.")
|
| 499 |
prob_plot = gr.BarPlot(prob_df, x="labels", y="values", title="Cell Type Probabilities", scroll_to_output=True, x_label_angle=-90, height=400)
|
| 500 |
gr.Markdown("### Step 6: Download Results.")
|
| 501 |
+
download_button = gr.DownloadButton(label="Download Results", value='./Cell_types_predictions.csv')
|
| 502 |
|
| 503 |
nifti_file.change(
|
| 504 |
load_nifti_or_png,
|