Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -110,6 +110,7 @@ def predict_brain_age(nifti_file, actual_age, sex):
|
|
110 |
predicted_brain_age + (actual_age * 0.062) - 2.96 if actual_age > 18 else predicted_brain_age
|
111 |
)
|
112 |
|
|
|
113 |
# Determine color: Red if positive, Green if negative
|
114 |
color = "red" if brain_age_difference > 0 else "green"
|
115 |
bad_output_html = f"<span style='color:{color}; font-weight:bold;'>Brain Age Difference (BAD): {brain_age_difference:.2f} years</span>"
|
@@ -123,7 +124,7 @@ with gr.Blocks() as demo:
|
|
123 |
# 🧠 BrainAgeNeXt: Advancing Brain Age Modeling
|
124 |
Upload a preprocessed T1w MRI scan (.nii.gz), enter the age and sex of the subject, and get a brain age prediction.
|
125 |
|
126 |
-
The following preprocessing are required.
|
127 |
1. Skull-stripping using [SynthStrip](https://surfer.nmr.mgh.harvard.edu/docs/synthstrip/) with the `--no-csf` flag for optimal results.
|
128 |
2. N4 bias field correction using [ANTs](https://github.com/ANTsX/ANTs/wiki/N4BiasFieldCorrection).
|
129 |
3. Affine registration to the MNI 1mm isotropic template space.
|
|
|
110 |
predicted_brain_age + (actual_age * 0.062) - 2.96 if actual_age > 18 else predicted_brain_age
|
111 |
)
|
112 |
|
113 |
+
brain_age_difference = predicted_brain_age - actual_age
|
114 |
# Determine color: Red if positive, Green if negative
|
115 |
color = "red" if brain_age_difference > 0 else "green"
|
116 |
bad_output_html = f"<span style='color:{color}; font-weight:bold;'>Brain Age Difference (BAD): {brain_age_difference:.2f} years</span>"
|
|
|
124 |
# 🧠 BrainAgeNeXt: Advancing Brain Age Modeling
|
125 |
Upload a preprocessed T1w MRI scan (.nii.gz), enter the age and sex of the subject, and get a brain age prediction.
|
126 |
|
127 |
+
The following preprocessing steps are required.
|
128 |
1. Skull-stripping using [SynthStrip](https://surfer.nmr.mgh.harvard.edu/docs/synthstrip/) with the `--no-csf` flag for optimal results.
|
129 |
2. N4 bias field correction using [ANTs](https://github.com/ANTsX/ANTs/wiki/N4BiasFieldCorrection).
|
130 |
3. Affine registration to the MNI 1mm isotropic template space.
|