-
Frame Nr. 74
+
diff -r a4c6fcf2c456 -r d5a4180410c4 SpyBOAT.xml
--- a/SpyBOAT.xml Thu Nov 26 16:40:47 2020 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,248 +0,0 @@
-
-wavelet transforms image stacks
-
- 0.1.1
-
-
-
- spyboat
-
- python $__tool_directory__/spyboat_cli.py --version
- $log
-
- ]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- save_preprocessed['selection'] == 'Yes'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- @article{monke2020optimal,
- title={Optimal time frequency analysis for biological data-pyBOAT},
- author={M{\"o}nke, Gregor and Sorgenfrei, Frieda A and Schmal, Christoph and Granada, Adri{\'a}n E},
- journal={bioRxiv},
- year={2020},
- publisher={Cold Spring Harbor Laboratory}
-}
-
-
-
diff -r a4c6fcf2c456 -r d5a4180410c4 __pycache__/output_report.cpython-38.pyc
Binary file __pycache__/output_report.cpython-38.pyc has changed
diff -r a4c6fcf2c456 -r d5a4180410c4 output_report.py
--- a/output_report.py Thu Nov 26 16:40:47 2020 +0000
+++ b/output_report.py Sat Nov 28 18:50:09 2020 +0000
@@ -1,28 +1,24 @@
-''' Produces plots and a summary html 'headless' '''
+""" Produces plots and a summary html 'headless' """
+import logging
+import os
-import os
import matplotlib
-# headless plotting and disable latex
-matplotlib.use('Agg')
-matplotlib.rcParams['text.usetex'] = False
import matplotlib.pyplot as ppl
-
-import logging
-
import spyboat.plotting as spyplot
+ppl.switch_backend('Agg')
+matplotlib.rcParams["text.usetex"] = False
logger = logging.getLogger(__name__)
# figure resolution
-DPI=250
+DPI = 250
-def produce_snapshots(input_movie, results, frame, Wkwargs,
- img_path='.'):
- '''
- Takes the *input_movie* and the
- *results* dictionary from spyboat.processing.run_parallel
- and produces phase, period and amplitude snapshot png's.
+def produce_snapshots(input_movie, results, frame, Wkwargs, img_path="."):
+ """
+ Takes the *input_movie* and the *results* dictionary
+ from spyboat.processing.run_parallel and produces phase,
+ period and amplitude snapshot png's.
For the period snapshot also the period range is needed,
hence the analysis dictionary 'Wkwargs' also gets passed.
@@ -32,103 +28,111 @@
and the storage location in *img_path*.
These get picked up by 'create_html'
- '''
-
+ """
spyplot.input_snapshot(input_movie[frame])
fig = ppl.gcf()
- out_path = os.path.join(img_path, f'input_frame{frame}.png')
+ out_path = os.path.join(img_path, f"input_frame{frame}.png")
+ fig.savefig(out_path, dpi=DPI)
+ ppl.close(fig)
+
+ spyplot.phase_snapshot(results["phase"][frame])
+ fig = ppl.gcf()
+ out_path = os.path.join(img_path, f"phase_frame{frame}.png")
fig.savefig(out_path, dpi=DPI)
ppl.close(fig)
-
- spyplot.phase_snapshot(results['phase'][frame])
+
+ spyplot.period_snapshot(
+ results["period"][frame], Wkwargs["Tmin"],
+ Wkwargs["Tmax"], time_unit="a.u."
+ )
+
fig = ppl.gcf()
- out_path = os.path.join(img_path, f'phase_frame{frame}.png')
+ out_path = os.path.join(img_path, f"period_frame{frame}.png")
+ fig.savefig(out_path, dpi=DPI)
+ ppl.close(fig)
+
+ spyplot.amplitude_snapshot(results["amplitude"][frame])
+ fig = ppl.gcf()
+ out_path = os.path.join(img_path, f"amplitude_frame{frame}.png")
fig.savefig(out_path, dpi=DPI)
ppl.close(fig)
- spyplot.period_snapshot(results['period'][frame],
- Wkwargs['Tmin'],Wkwargs['Tmax'],
- time_unit = 'a.u.')
-
- fig = ppl.gcf()
- out_path = os.path.join(img_path, f'period_frame{frame}.png')
- fig.savefig(out_path, dpi=DPI)
- ppl.close(fig)
-
- spyplot.amplitude_snapshot(results['amplitude'][frame])
- fig = ppl.gcf()
- out_path = os.path.join(img_path, f'amplitude_frame{frame}.png')
- fig.savefig(out_path, dpi=DPI)
- ppl.close(fig)
-
- logger.info(f'Produced 4 snapshots for frame {frame}..')
+ logger.info(f"Produced 4 snapshots for frame {frame}..")
+
+
+def produce_distr_plots(results, Wkwargs, img_path="."):
+ """
+ Output file names are:
-def produce_distr_plots(results, Wkwargs, img_path='.'):
-
- '''
- Output file names are:
-
- period_distr.png, power_distr.png and phase_distr.png
- '''
+ period_distr.png, power_distr.png and phase_distr.png
+ """
- spyplot.period_distr_dynamics(results['period'], Wkwargs)
+ spyplot.period_distr_dynamics(results["period"], Wkwargs)
fig = ppl.gcf()
- out_path = os.path.join(img_path, f'period_distr.png')
+ out_path = os.path.join(img_path, "period_distr.png")
fig.savefig(out_path, dpi=DPI)
-
- spyplot.power_distr_dynamics(results['power'], Wkwargs)
+
+ spyplot.power_distr_dynamics(results["power"], Wkwargs)
fig = ppl.gcf()
- out_path = os.path.join(img_path, f'power_distr.png')
+ out_path = os.path.join(img_path, "power_distr.png")
fig.savefig(out_path, dpi=DPI)
- spyplot.phase_coherence_dynamics(results['phase'], Wkwargs)
+ spyplot.phase_coherence_dynamics(results["phase"], Wkwargs)
fig = ppl.gcf()
- out_path = os.path.join(img_path, f'phase_distr.png')
+ out_path = os.path.join(img_path, "phase_distr.png")
fig.savefig(out_path, dpi=DPI)
-
- logger.info(f'Produced 3 distribution plots..')
+
+ logger.info("Produced 3 distribution plots..")
+
-
-def create_html(frame_nums, html_fname='OutputReport.html'):
-
- '''
- The html generated assumes the respective png's
+def create_html(frame_nums, html_fname="OutputReport.html"):
+ """
+ The html generated assumes the respective png's
have been created with 'produce_snapshots' and 'produce_distr_plots'
and can be found at the cwd (that's how Galaxy works..)
- '''
+ """
# -- create a gallery for every frame in frame_nums --
-
- galleries = ''
+
+ galleries = ""
for frame_num in frame_nums:
- new_gal =f'''
-
-
Frame Nr. {frame_num}
+ new_gal = f"""
+
+
+ Frame Nr. {frame_num}
- '''
+ """
galleries += new_gal
-
- html_string =f'''
+
+ html_string = f"""
SpyBOAT Output Report
@@ -152,7 +156,7 @@
text-align: center;
/* border: 1px dashed rgba(4, 4, 4, 0.35); */
grid-template-columns: repeat(3,1fr);
- grid-template-rows: 20vw;
+ grid-template-rows: 20vw;
grid-gap: 0px;
column-gap: 0px
}}
@@ -186,7 +190,7 @@
SpyBOAT Results Report
-
+
+
+
+
+
+
+
\ No newline at end of file
diff -r a4c6fcf2c456 -r d5a4180410c4 test-data/phase_out.tif
Binary file test-data/phase_out.tif has changed