FreeSurfer: Group Report

Summary

  • Date and time: {{ timestamp }}.
  • Number of subjects: {{ num_subjects }}.
  • Outlier detection threshold: {{ sd_threshold }} standard deviations.
  • {% if groups %}
  • Groups compared: {% for group_name, group_subjects in groups.items() %} {{ group_name }} ({{ group_subjects|length }}){% if not loop.last %}, {% endif %} {% endfor %}
  • Comparison significance threshold: p < {{ alpha }}.
  • {% endif %}

Suspicious / Outlier Subjects

{% if outlier_subjects %}

{{ outlier_subjects|length }} subject(s) flagged as outliers within the cohort.

    {% for subject in outlier_subjects %}
  • {{ subject.subject_id }} ({{ subject.outlier_count }} finding{{ "s" if subject.outlier_count != 1 else "" }})
      {% for finding in subject.findings %}
    • {{ finding }}
    • {% endfor %}
  • {% endfor %}
{% else %}

No outlier subjects detected.

{% endif %}

Quality Summary

{% if quality_summary %} {% for metric_name, metric_data in quality_summary.items() %}

{{ metric_name.replace('_', ' ').title() }}

{% for region, result in metric_data.items() %} {% if result.status == "no_data" %}

{{ region }}: {{ result.message }}

{% elif result.status == "outliers_detected" %}

{{ region }}: {{ result.message }}

Mean: {{ "%.2f"|format(result.mean) }}, Std: {{ "%.2f"|format(result.std) }}, Range: {{ "%.2f"|format(result.lower_bound) }} to {{ "%.2f"|format(result.upper_bound) }}

{% if result.outlier_subjects %}

Outlier Subjects:

    {% for outlier in result.outlier_subjects %}
  • {{ outlier.subject_id }}: {{ "%.2f"|format(outlier.value) }}
  • {% endfor %}
{% endif %} {% elif result.status == "passed" %}

{{ region }}: {{ result.message }}

Mean: {{ "%.2f"|format(result.mean) }}, Std: {{ "%.2f"|format(result.std) }}, Range: {{ "%.2f"|format(result.lower_bound) }} to {{ "%.2f"|format(result.upper_bound) }}

{% endif %} {% endfor %}
{% endfor %} {% else %}

No quality metrics available.

{% endif %}
{% if groups and group_comparison %}

Group Comparison

{% for metric_name, metric_data in group_comparison.items() %}

{{ metric_name.replace('_', ' ').title() }}

{% for region, result in metric_data.items() %}

{{ region }}

    {% for group_name, group_stats in result.items() %} {% if group_name != "comparison" %}
  • {{ group_name }}: n={{ group_stats.n }}{% if group_stats.mean is not none %}, mean={{ "%.2f"|format(group_stats.mean) }}{% endif %}{% if group_stats.std is not none %}, std={{ "%.2f"|format(group_stats.std) }}{% endif %}
  • {% endif %} {% endfor %}
{% if result.comparison and result.comparison.message %}

{{ result.comparison.message }}

{% endif %}
{% endfor %}
{% endfor %}
{% endif %} {% if groups and comparison_plots %}

Group Comparison Plots

{% for plot_html in comparison_plots %}
{{ plot_html|safe }}
{% endfor %}
{% endif %}

Outlier Plots

{% if plots %}
{% for plot_html in plots %}
{{ plot_html|safe }}
{% endfor %}
{% else %}

No plots available.

{% endif %}