Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def calculate_magnitude_and_axis(j0, j45):
|
|
60 |
|
61 |
# Apply the conditional logic
|
62 |
if j0 > 0:
|
63 |
-
if j45
|
64 |
final_axis = Z
|
65 |
else:
|
66 |
final_axis = Z + 180
|
@@ -70,7 +70,7 @@ def calculate_magnitude_and_axis(j0, j45):
|
|
70 |
# Ensure the final axis is between 0 and 180
|
71 |
final_axis = final_axis % 180
|
72 |
|
73 |
-
return magnitude, final_axis
|
74 |
|
75 |
def main():
|
76 |
st.set_page_config(page_title='Astigmatism Prediction', page_icon=':eyeglasses:', layout='wide')
|
@@ -91,7 +91,7 @@ def main():
|
|
91 |
new_j0, new_j45 = predict_new_j0_j45(age, aca_magnitude, aca_axis)
|
92 |
|
93 |
# Calculate predicted magnitude and axis
|
94 |
-
predicted_magnitude, predicted_axis
|
95 |
|
96 |
st.success(f'Predicted Total Corneal Astigmatism Magnitude: {predicted_magnitude:.2f} D')
|
97 |
st.success(f'Predicted Total Corneal Astigmatism Axis: {predicted_axis:.1f}°')
|
@@ -99,7 +99,6 @@ def main():
|
|
99 |
# Display intermediate values for verification
|
100 |
st.info(f'Initial J0: {initial_j0:.2f}, Initial J45: {initial_j45:.2f}')
|
101 |
st.info(f'Predicted J0: {new_j0:.2f}, Predicted J45: {new_j45:.2f}')
|
102 |
-
st.info(f'Intermediate Z: {Z:.2f}°')
|
103 |
st.info(f'ACA Axis (Degrees): {aca_axis:.2f}°, ACA Axis (Radians): {math.radians(aca_axis):.4f}')
|
104 |
else:
|
105 |
st.error('Please ensure all inputs are within the specified ranges.')
|
|
|
60 |
|
61 |
# Apply the conditional logic
|
62 |
if j0 > 0:
|
63 |
+
if j45 > 0:
|
64 |
final_axis = Z
|
65 |
else:
|
66 |
final_axis = Z + 180
|
|
|
70 |
# Ensure the final axis is between 0 and 180
|
71 |
final_axis = final_axis % 180
|
72 |
|
73 |
+
return magnitude, final_axis
|
74 |
|
75 |
def main():
|
76 |
st.set_page_config(page_title='Astigmatism Prediction', page_icon=':eyeglasses:', layout='wide')
|
|
|
91 |
new_j0, new_j45 = predict_new_j0_j45(age, aca_magnitude, aca_axis)
|
92 |
|
93 |
# Calculate predicted magnitude and axis
|
94 |
+
predicted_magnitude, predicted_axis = calculate_magnitude_and_axis(new_j0, new_j45)
|
95 |
|
96 |
st.success(f'Predicted Total Corneal Astigmatism Magnitude: {predicted_magnitude:.2f} D')
|
97 |
st.success(f'Predicted Total Corneal Astigmatism Axis: {predicted_axis:.1f}°')
|
|
|
99 |
# Display intermediate values for verification
|
100 |
st.info(f'Initial J0: {initial_j0:.2f}, Initial J45: {initial_j45:.2f}')
|
101 |
st.info(f'Predicted J0: {new_j0:.2f}, Predicted J45: {new_j45:.2f}')
|
|
|
102 |
st.info(f'ACA Axis (Degrees): {aca_axis:.2f}°, ACA Axis (Radians): {math.radians(aca_axis):.4f}')
|
103 |
else:
|
104 |
st.error('Please ensure all inputs are within the specified ranges.')
|