Spaces:
Runtime error
Runtime error
Upload app.py
Browse files472 unmodified lines4734744754764774784794804814821 unmodified line484485486487488489490491492493494495496497498499500501502503504472 unmodified lineswith gr.Blocks() as demo:gr.Markdown("# Map My Sections\n### This GUI is part of the submission to the Allen Institute's Map My Sections tool by Tibbling Technologies.")gr.Markdown("### Step 1: Upload your sample and choose type")with gr.Row():nifti_file = gr.File(label="File Upload")with gr.Column():sample_type = gr.Dropdown(choices=["CCF registered Sample", "Custom Sample"], value="CCF registered Sample", label="Sample Type")data_type = gr.Radio(choices=["2D", "3D"], value="3D", label="Data Type")1 unmodified linewith gr.Row(visible=False) as slice_row:with gr.Column(scale=1):gr.Markdown("### Step 2: Visualizing your uploaded sample")image_display = gr.Image(height=450)slice_slider = gr.Slider(minimum=0, maximum=0, value=0, step=1, label="Slices", visible=False)with gr.Column(scale=1):gr.Markdown("### Step 3: Visualizing Allen Brain Cell Types Atlas")gallery = gr.Gallery(label="ABC Atlas", value = gallery_images,columns = 5, height = 450)gr.Markdown("**Step 4: Run cell type mapping**")with gr.Row():run_button = gr.Button("Run Mapping")reg_button = gr.Button("Run Registration", visible=False)with gr.Column(visible=False) as plot_row:gr.Markdown("### Step 5: Quantitative results of the mapping model.")prob_plot = gr.BarPlot(prob_df, x="labels", y="values", title="Cell Type Probabilities", scroll_to_output=True, x_label_angle=-90, height=400)download_step = gr.Markdown("### Step 6: Download Results.", visible = False)download_button = gr.DownloadButton(label="Download Results", visible = False)nifti_file.change(472 unmodified lines4734744754764774784794804814824831 unmodified line485486487488489490491492493494495496497498499500501502503504505472 unmodified lineswith gr.Blocks() as demo:gr.Markdown("# Map My Sections\n### This GUI is part of the submission to the Allen Institute's Map My Sections tool by Tibbling Technologies.")gr.Markdown("### Step 1: Upload your sample, currently only .nii.gz and .png supported")with gr.Row():nifti_file = gr.File(label="File Upload")with gr.Column():gr.Markdown("### Step 2: Select your sample and data type.")sample_type = gr.Dropdown(choices=["CCF registered Sample", "Custom Sample"], value="CCF registered Sample", label="Sample Type")data_type = gr.Radio(choices=["2D", "3D"], value="3D", label="Data Type")1 unmodified linewith gr.Row(visible=False) as slice_row:with gr.Column(scale=1):gr.Markdown("### Step 3: Visualizing your uploaded sample")image_display = gr.Image(height=450)slice_slider = gr.Slider(minimum=0, maximum=0, value=0, step=1, label="Slices", visible=False)with gr.Column(scale=1):gr.Markdown("### Step 4: Visualizing Allen Brain Cell Types Atlas")gallery = gr.Gallery(label="ABC Atlas", value = gallery_images,columns = 5, height = 450)gr.Markdown("### Step 5: Run cell type mappin and/or registeration. ")with gr.Row():run_button = gr.Button("Run Mapping")reg_button = gr.Button("Run Registration", visible=False)with gr.Column(visible=False) as plot_row:gr.Markdown("### Step 6: Quantitative results of the mapping model.")prob_plot = gr.BarPlot(prob_df, x="labels", y="values", title="Cell Type Probabilities", scroll_to_output=True, x_label_angle=-90, height=400)download_step = gr.Markdown("### Step 7: Download Results.", visible = False)download_button = gr.DownloadButton(label="Download Results", visible = False)nifti_file.change(
app.py+7-6