Skip to content

Commit 92201a3

Browse files
author
Brendan Mark Whelan
committed
fix #237 and #238
1 parent 106c5b6 commit 92201a3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mri_distortion_toolkit/Reports.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def _get_template(self):
558558

559559
# public methods
560560

561-
def write_html_report(self, output_folder=None):
561+
def write_html_report(self, output_folder=None, report_name=None):
562562
"""
563563
Generates a html report encompassing available acquisition information, test results, and intercative
564564
plotly figures
@@ -572,6 +572,11 @@ def write_html_report(self, output_folder=None):
572572
self.output_folder = Path(output_folder)
573573
self._set_up_directory_structure()
574574

575+
if report_name is None:
576+
report_name = 'MR_QA_report.html'
577+
else:
578+
report_name = str(Path(report_name).with_suffix('html'))
579+
575580
# save plots and update jinja_dict
576581

577582
distortion_v_r_save_name = self._unique_name_generator(self.output_folder / 'plots', 'distortion_v_r.html')
@@ -596,7 +601,7 @@ def write_html_report(self, output_folder=None):
596601
# set up template
597602
self._jinja_dict['html_theme_loc'] = self._html_theme
598603
j2_template = self._get_template()
599-
report_name = self._unique_name_generator(self.output_folder, 'MR_QA_report.html', rel_path=False)
604+
report_name = self._unique_name_generator(self.output_folder, report_name, rel_path=False)
600605
report_code = os.path.split(report_name)[1] # for printing
601606
report_code = os.path.splitext(report_code)[0]
602607
report_code = report_code.replace('MR_QA_report_','')

0 commit comments

Comments
 (0)