Skip to content

Commit

Permalink
WIP: fixing qc so flatfieldqc isn't enabled with prestitched
Browse files Browse the repository at this point in the history
- while I am at it, will change jinja rules to maybe use snakemake
built-in jinja
  • Loading branch information
akhanf committed Sep 8, 2024
1 parent ce66e0e commit d7a3543
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions resources/qc/subject_html_temp.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<title>{{ subject }} - {{ sample }} - {{ acq }}</title>
</head>
<body>
{% for link_path, link_description in zip(link_paths, link_descriptions) %}
<a href="{{ link_path }}">{{ link_description }}</a><br>
{% endfor %}
<a href="{{ back_link }}">Back</a><br>
<a href="{{ ffhtml }}">Flatfield Correction QC</a><br>
<a href="{{ wshtml }}">Whole Slice QC</a>
<br>
<a href="{{ volhtml }}">Volume Rendered Image</a>
</body>
</html>
</html>
14 changes: 7 additions & 7 deletions workflow/scripts/generate_subject_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
template = env.get_template(snakemake.input.subject_html)

# input html files
ws_html = snakemake.input.ws_html
ff_html = snakemake.input.ff_html
vol_html = snakemake.input.vol_html
in_htmls = snakemake.input.in_htmls
#ws_html = snakemake.input.ws_html
#ff_html = snakemake.input.ff_html
#vol_html = snakemake.input.vol_html

# output html files
sub_html = snakemake.output.sub_html
Expand All @@ -22,13 +23,12 @@

# Get relative path to the subjects QC htmls

ws_rel_path = Path(ws_html).relative_to(Path(sub_html).parent)
ff_rel_path = Path(ff_html).relative_to(Path(sub_html).parent)
vol_rel_path = Path(vol_html).relative_to(Path(sub_html).parent)
link_rel_paths = [ Path(link_path).relative_to(Path(sub_html).parent) for link_path in snakemake.input.link_paths]
link_descriptions = snakemake.params.link_descriptions

# Fill in jinja template for subject html and write it out
output = template.render(back_link="../qc_report.html",subject=subject,sample=sample,acq=acq,
ffhtml=ff_rel_path,wshtml=ws_rel_path, volhtml=vol_rel_path)
link_rel_paths, link_descriptions)
with open(sub_html, 'w') as f:
f.write(output)

0 comments on commit d7a3543

Please sign in to comment.