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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -23,7 +23,7 @@ def get_slice_location(dicom_file):
23
  return 0 # Default to 0 if neither tag is available
24
 
25
  # Display the single DICOM image from the first folder
26
- st.header("Single DICOM Image")
27
 
28
  # Check if the directory exists
29
  if os.path.exists(single_image_directory):
@@ -46,7 +46,7 @@ else:
46
  st.write("Directory 00002067 does not exist.")
47
 
48
  # Display the multiple DICOM images from the second folder using a slider
49
- st.header("Browse Multiple DICOM Images")
50
 
51
  # Check if the directory exists
52
  if os.path.exists(multiple_images_directory):
@@ -64,7 +64,7 @@ if os.path.exists(multiple_images_directory):
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
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')
 
23
  return 0 # Default to 0 if neither tag is available
24
 
25
  # Display the single DICOM image from the first folder
26
+ st.header("Single DICOM Image from 00002067")
27
 
28
  # Check if the directory exists
29
  if os.path.exists(single_image_directory):
 
46
  st.write("Directory 00002067 does not exist.")
47
 
48
  # Display the multiple DICOM images from the second folder using a slider
49
+ st.header("Browse Multiple DICOM Images from 00007FA6")
50
 
51
  # Check if the directory exists
52
  if os.path.exists(multiple_images_directory):
 
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')