Skip to content

Commit b8f4129

Browse files
committed
Fix bug channel display
1 parent c466f23 commit b8f4129

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

phys2bids/phys2bids.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ def phys2bids(
540540
),
541541
)
542542

543-
# Only generate report if specified by the user
544-
if make_report:
545-
generate_report(outdir, conversion_path, logname, phys_out[key])
543+
# Only generate report if specified by the user
544+
if make_report:
545+
generate_report(outdir, conversion_path, logname, phys_out[key])
546546

547547

548548
def _main(argv=None):

phys2bids/reporting/html_report.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44
from distutils.dir_util import copy_tree
5-
from os.path import join
5+
from os.path import join, basename
66
from pathlib import Path
77
from string import Template
88

@@ -159,7 +159,11 @@ def _generate_bokeh_plots(phys_in, figsize=(250, 500)):
159159
if ch_num > len(colors):
160160
colors *= 2
161161

162-
downsample = int(phys_in.freq / 100)
162+
if phys_in.freq > 100:
163+
downsample = int(phys_in.freq / 100)
164+
else:
165+
downsample = None
166+
163167
plot_list = []
164168
for row, timeser in enumerate(phys_in.timeseries.T[1:]):
165169
# build a data source for each plot, with only the data + index (time)
@@ -224,9 +228,9 @@ def generate_report(out_dir, conversion_path, log_path, phys_in):
224228
log_content = f.read()
225229

226230
log_content = log_content.replace("\n", "<br>")
227-
log_html_path = join(conversion_path, "phys2bids_report_log.html")
228-
qc_html_path = join(conversion_path, "phys2bids_report.html")
229-
231+
log_html_path = join(conversion_path, basename(phys_in.filename) + ".html")
232+
qc_html_filename = "_".join(basename(phys_in.filename).split("_")[:-1])+"_desc-log_physio.html"
233+
qc_html_path = join(conversion_path, qc_html_filename)
230234
html = _save_as_html(log_html_path, log_content, qc_html_path)
231235

232236
with open(log_html_path, "wb") as f:

0 commit comments

Comments
 (0)