hlnicholls commited on
Commit
fb8bb17
1 Parent(s): 94a397a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -60,12 +60,13 @@ if os.path.exists(multiple_images_directory):
60
  # Read all DICOM images (sorted)
61
  dicom_images = [pydicom.dcmread(file).pixel_array for file in multiple_image_files]
62
 
63
- # Interactive slider to select image index
64
- st.sidebar.header("Image Slider")
65
- image_index = st.sidebar.slider("Select Image Index", 0, len(dicom_images) - 1, 0)
66
-
67
  # Display the selected DICOM image dynamically
68
- st.header(f"Displaying Image {image_index + 1} of {len(dicom_images)} from folder 00007FA6")
 
 
 
 
 
69
  fig, ax = plt.subplots()
70
  ax.imshow(dicom_images[image_index], cmap='gray')
71
  ax.axis('off')
 
60
  # Read all DICOM images (sorted)
61
  dicom_images = [pydicom.dcmread(file).pixel_array for file in multiple_image_files]
62
 
 
 
 
 
63
  # Display the selected DICOM image dynamically
64
+ st.header(f"Displaying Images from folder 00007FA6")
65
+
66
+ # Interactive slider to select image index (below the image)
67
+ image_index = st.slider("Select Image Index", 0, len(dicom_images) - 1, 0)
68
+
69
+ # Display the image based on the slider position
70
  fig, ax = plt.subplots()
71
  ax.imshow(dicom_images[image_index], cmap='gray')
72
  ax.axis('off')