FrancescoLR commited on
Commit
62e71f5
·
1 Parent(s): 9c5c250

Updated app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -42,6 +42,9 @@ def extract_middle_slice(nifti_path, output_image_path):
42
  # Get the middle slice along the z-axis
43
  middle_slice_index = data.shape[2] // 2
44
  slice_data = data[:, :, middle_slice_index]
 
 
 
45
 
46
  # Calculate aspect ratio
47
  height, width = slice_data.shape
 
42
  # Get the middle slice along the z-axis
43
  middle_slice_index = data.shape[2] // 2
44
  slice_data = data[:, :, middle_slice_index]
45
+
46
+ # Rotate the slice 90 degrees clockwise
47
+ slice_data = np.rot90(slice_data, k=-1)
48
 
49
  # Calculate aspect ratio
50
  height, width = slice_data.shape