Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate graphic reports for phys2bids outputs #464

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: "ubuntu-20.04"
tools:
python: "3.7"
python: "3.9"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -20,3 +20,4 @@ python:
path: .
extra_requirements:
- doc
- reports
9 changes: 9 additions & 0 deletions phys2bids/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ def _get_parser():
help="Only print warnings to log file. Default is False.",
default=False,
)
optional.add_argument(
"-report",
"--report",
dest="make_report",
action="store_true",
help="Generate a report with the data and generated folder structure. "
"Default is False.",
default=False,
)
optional.add_argument("-v", "--version", action="version", version=("%(prog)s " + __version__))

parser._action_groups.append(optional)
Expand Down
6 changes: 6 additions & 0 deletions phys2bids/phys2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from phys2bids import _version, bids, utils, viz
from phys2bids.cli.run import _get_parser
from phys2bids.physio_obj import BlueprintOutput
from phys2bids.reporting.html_report import generate_report
from phys2bids.slice4phys import slice4phys

from . import __version__
Expand Down Expand Up @@ -145,6 +146,7 @@ def phys2bids(
pad=9,
ch_name=[],
yml="",
make_report=False,
debug=False,
quiet=False,
):
Expand Down Expand Up @@ -538,6 +540,10 @@ def phys2bids(
),
)

# Only generate report if specified by the user
if make_report:
generate_report(outdir, conversion_path, logname, phys_out[key])


def _main(argv=None):
options = _get_parser().parse_args(argv)
Expand Down
1 change: 1 addition & 0 deletions phys2bids/reporting/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Visual reporting tools for inspecting phys2bids workflow outputs."""
Binary file added phys2bids/reporting/assets/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions phys2bids/reporting/assets/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
html, body {
margin: 0;
padding: 0;
font-family: 'Lato', sans-serif;
overflow-x: hidden;
overflow-y: scroll;
}
* {
box-sizing: border-box;
}

.header {
background: linear-gradient(90deg, rgba(0,240,141,1) 0%, rgba(0,73,133,1) 100%);
height: 70px;
width: 100%;
position: fixed;
overflow: hidden;
margin: 0;
z-index: 100;
}

.header a, span {
color: white;
text-decoration: none;
font-weight: 700;
}

.header_logo {
display: inline-block;
float: left;
}

.header_logo img{
height: 50px;
top: 0;
left: 0;
padding-top: 15px;
}

.header_links {
top: 0;
left: 0;
padding-top: 25px;
margin-left: 20px;
margin-right: 20px;
float: left;
display: inline-block;
}
.clear {
clear: both;
}

.content {
margin-top: 100px;
display: flex;
width: 100%;
}

.tree {
margin-left: 50px;
margin-right: 50px;
flex: 0.5;
min-width: 300px;
float: left;
}

.tree_text {
margin-top: 10px;
margin-bottom: 70px;
width: 100%;
}

.bk-root {
display: inline-block;
margin-top: 10px;
width: 100%;
}

.bokeh_plots {
margin-left: 50px;
margin-right: 50px;
flex: 1;
min-width: 500px;
float: left;
}

@media screen and (max-width: 600px) {
.content {
flex-wrap: wrap;
}
.tree {
flex-basis: 100%;
}
.bokeh_plots {
flex-basis: 100%;
}
}

.main{
margin-top: 100px;
margin-left: 100px;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading