Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.
brainprep.reporting.generate_qc_report¶
- brainprep.reporting.generate_qc_report(title, docstring, version, date, data)[source]¶
Generate a quality control (QC) report as an interactive HTML document.
This function compiles visual and tabular data into a structured HTML report using a predefined template. It is useful for documenting and reviewing steps in a data processing workflow.
- Parameters:
- titlestr
The title displayed at the top of the report.
- docstringstr
A descriptive introduction or summary of the report’s purpose.
- versionstr
Version identifier for the report or associated software.
- datestr
Timestamp indicating when the report was generated.
- datalist[dict]
A list of dictionaries, each representing a workflow step. Each dictionary must contain the following keys: - name (str): Title of the step. - content (Path or list of Path): Image(s) to display. - overlay (Path): Image(s) to show on hover. - tables (DataFrame or list of DataFrame): Tabular data to include.
- Returns:
- reportHTMLReport
An instance of HTMLReport containing the rendered HTML content.
Notes
Images are converted to base64 for inline embedding.
Tables are rendered as HTML using dataframe_to_html.
Examples
>>> from pathlib import Path >>> from pandas import DataFrame >>> >>> data = [{ ... "name": "Step 1", ... "content": Path("/tmp/image1.png"), ... "overlay": Path("/tmp/image1_overlay.png"), ... "tables": DataFrame({"A": [1, 2], "B": [3, 4]}) ... }] >>> report = generate_qc_report( ... title="QC Summary", ... docstring="Overview of preprocessing steps.", ... version="1.0", ... date="2025-10-03", ... data=data ... ) >>> report.save_as_html("/tmp/qc_report.html")