vincentgao95 commited on
Commit
6c5575c
1 Parent(s): f374339

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -58,9 +58,9 @@ def update_slider(file_obj, view):
58
  num_slices = data.shape[1]
59
  elif view == "Sagittal":
60
  num_slices = data.shape[0]
61
- # Set slider to start in the middle
62
- middle_slice = num_slices // 2
63
- return gr.update(maximum=num_slices-1, value=middle_slice)
64
 
65
  with gr.Blocks() as app:
66
  gr.Markdown("## NRRD Slice Visualizer")
 
58
  num_slices = data.shape[1]
59
  elif view == "Sagittal":
60
  num_slices = data.shape[0]
61
+
62
+ middle_slice = num_slices // 2 # Calculate the middle slice
63
+ return gr.update(maximum=num_slices-1, value=middle_slice) # Set the slider to start in the middle
64
 
65
  with gr.Blocks() as app:
66
  gr.Markdown("## NRRD Slice Visualizer")