Skip to content

Commit

Permalink
Update docs with renamed play* function names
Browse files Browse the repository at this point in the history
  • Loading branch information
sitic committed May 2, 2024
1 parent 00b77cf commit 00e294e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 43 deletions.
12 changes: 6 additions & 6 deletions docs/tutorials/activation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
},
"outputs": [],
"source": [
"om.video.play2(video, video_warped_norm, title1=\"original video\", title2=\"warped, normalized video\", interval=100);"
"om.show_video_pair(video, video_warped_norm, title1=\"original video\", title2=\"warped, normalized video\", interval=100);"
]
},
{
Expand All @@ -138,7 +138,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.play2(video, video_warped_norm, title1=\"original video\", title2=\"warped, normalized video\", interval=250))"
"render_ani_func(lambda: om.show_video_pair(video, video_warped_norm, title1=\"original video\", title2=\"warped, normalized video\", interval=250))"
]
},
{
Expand Down Expand Up @@ -324,7 +324,7 @@
},
"outputs": [],
"source": [
"om.video.play2(video, video_diff_norm, title1=\"original video\", title2=\"warped, frame-wise diff video\", interval=100);"
"om.show_video_pair(video, video_diff_norm, title1=\"original video\", title2=\"warped, frame-wise diff video\", interval=100);"
]
},
{
Expand All @@ -337,7 +337,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.play2(video, video_diff_norm, title1=\"original video\", title2=\"warped, frame-wise diff video\", interval=250))"
"render_ani_func(lambda: om.show_video_pair(video, video_diff_norm, title1=\"original video\", title2=\"warped, frame-wise diff video\", interval=250))"
]
},
{
Expand Down Expand Up @@ -374,7 +374,7 @@
},
"outputs": [],
"source": [
"om.video.play_with_overlay(video_warped, video_diff_norm, vmin_overlay=-1, vmax_overlay=1)"
"om.video.show_video_overlay(video_warped, video_diff_norm, vmin_overlay=-1, vmax_overlay=1)"
]
},
{
Expand All @@ -387,7 +387,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.play_with_overlay(video_warped, video_diff_norm, vmin_overlay=-1, vmax_overlay=1, interval=200))"
"render_ani_func(lambda: om.video.show_video_overlay(video_warped, video_diff_norm, vmin_overlay=-1, vmax_overlay=1, interval=200))"
]
},
{
Expand Down
32 changes: 16 additions & 16 deletions docs/tutorials/basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"\n",
"## Playing Videos\n",
"Videos can be viewed using either:\n",
"1. the built-in viewer {func}`play_video` based on matplotlib\n",
"1. the built-in viewer {func}`show_video` based on matplotlib\n",
"2. Monochrome, which is a more advanced and performant viewer with better interactive features\n",
"\n",
"### Using the built-in Viewer"
Expand All @@ -173,7 +173,7 @@
},
"outputs": [],
"source": [
"om.play_video(video, skip_frame=3);"
"om.show_video(video, skip_frame=3);"
]
},
{
Expand All @@ -187,16 +187,16 @@
"outputs": [],
"source": [
"video = video[:1000]\n",
"render_ani_func(lambda: om.video.play(video, interval=15))"
"render_ani_func(lambda: om.show_video(video, interval=15))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"See API documentation for {func}`play_video` for a list of available arguments. For instance, it is possible to specify a title, a range (vmin=0, vmax=1) and colormap:\n",
"See API documentation for {func}`show_video` for a list of available arguments. For instance, it is possible to specify a title, a range (vmin=0, vmax=1) and colormap:\n",
"```python\n",
"om.play_video(video, title='Example video', vmin=0, vmax=1, cmap='gray', interval=20)\n",
"om.show_video(video, title='Example video', vmin=0, vmax=1, cmap='gray', interval=20)\n",
"```\n",
"\n",
"\n",
Expand Down Expand Up @@ -356,7 +356,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The `video_warped` is the motion-stabilized version of the original video. The other parameters are explained in more detail in [](motion_compensation). You will also find further background information about the motion tracking and compensation routines in {cite}`Christoph2018a` and {cite}`Lebert2022`. Let's view the original video and the motion-compensated video side by side using {func}`optimap.video.play2`:"
"The `video_warped` is the motion-stabilized version of the original video. The other parameters are explained in more detail in [](motion_compensation). You will also find further background information about the motion tracking and compensation routines in {cite}`Christoph2018a` and {cite}`Lebert2022`. Let's view the original video and the motion-compensated video side by side using {func}`optimap.show_video_pair`:"
]
},
{
Expand All @@ -369,11 +369,11 @@
},
"outputs": [],
"source": [
"om.video.play2(video,\n",
" video_warped,\n",
" title1=\"with motion\",\n",
" title2=\"without motion\",\n",
" skip_frame=3);"
"om.show_video_pair(video,\n",
" video_warped,\n",
" title1=\"with motion\",\n",
" title2=\"without motion\",\n",
" skip_frame=3);"
]
},
{
Expand All @@ -386,7 +386,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.play2(video, video_warped, title1=\"with motion\", title2=\"without motion\", skip_frame=1))"
"render_ani_func(lambda: om.show_video_pair(video, video_warped, title1=\"with motion\", title2=\"without motion\", skip_frame=1))"
]
},
{
Expand Down Expand Up @@ -435,9 +435,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The optimap video-player functions such as {func}`optimap.video.play2` can also be exported to a video file:\n",
"The optimap video-player functions such as {func}`optimap.show_video_pair` can also be exported to a video file:\n",
"```python\n",
"animation = om.video.play2(video, video_warped, title1='Raw', title2='Compensated')\n",
"animation = om.show_video_pair(video, video_warped, title1='Raw', title2='Compensated')\n",
"animation.save('Example.mp4')\n",
"```\n",
"See {meth}`matplotlib.animation.Animation.save` for more details and [Tutorial 13](io.ipynb) for more information on how to export video files."
Expand Down Expand Up @@ -501,7 +501,7 @@
},
"outputs": [],
"source": [
"om.video.play(video_warped_normalized, interval=20);"
"om.show_video(video_warped_normalized, interval=20);"
]
},
{
Expand All @@ -514,7 +514,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.play(video_warped_normalized, interval=40))"
"render_ani_func(lambda: om.show_video(video_warped_normalized, interval=40))"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/io.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@
},
"outputs": [],
"source": [
"animated_plot = om.video.play2(video1, video2, title1='Video 1', title2='Video 2');\n",
"animated_plot = om.show_video_pair(video, video_waves, title1='Video 1', title2='Video 2');\n",
"animated_plot.save(\"Exported Animation with 2 Videos.mp4\")\n"
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/mask.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
},
"outputs": [],
"source": [
"om.play_video(video_warped)"
"om.show_video(video_warped)"
]
},
{
Expand All @@ -329,7 +329,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.play_video(video_warped))"
"render_ani_func(lambda: om.show_video(video_warped))"
]
}
],
Expand Down
24 changes: 12 additions & 12 deletions docs/tutorials/motion_compensation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
},
"outputs": [],
"source": [
"om.video.playn([video_VF, video_VF_compensated], titles=[\"original video\", \"compensated\"], figsize=(6, 3.5));"
"om.show_videos([video_VF, video_VF_compensated], titles=[\"original video\", \"compensated\"], figsize=(6, 3.5));"
]
},
{
Expand All @@ -141,7 +141,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.playn([video_VF, video_VF_compensated], titles=[\"original video\", \"compensated\"], figsize=(6, 3.5)))"
"render_ani_func(lambda: om.show_videos([video_VF, video_VF_compensated], titles=[\"original video\", \"compensated\"], figsize=(6, 3.5)))"
]
},
{
Expand Down Expand Up @@ -175,7 +175,7 @@
},
"outputs": [],
"source": [
"om.video.playn([video_VF_compensated_norm, video_VF_norm], titles=[\"compensated\", \"uncompensated\"], figsize=(6, 3.5));"
"om.show_videos([video_VF_compensated_norm, video_VF_norm], titles=[\"compensated\", \"uncompensated\"], figsize=(6, 3.5));"
]
},
{
Expand All @@ -188,7 +188,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.playn([video_VF_compensated_norm, video_VF_norm], titles=[\"compensated\", \"uncompensated\"], figsize=(6, 3.5)))"
"render_ani_func(lambda: om.show_videos([video_VF_compensated_norm, video_VF_norm], titles=[\"compensated\", \"uncompensated\"], figsize=(6, 3.5)))"
]
},
{
Expand Down Expand Up @@ -256,7 +256,7 @@
},
"outputs": [],
"source": [
"om.video.playn([video_sinus, video_sinus_compensated_ref40, video_sinus_compensated_ref0], titles=[\"original video\", \"compensated ref 40\", \"compensated ref 0\"], figsize=(8, 3.5));"
"om.show_videos([video_sinus, video_sinus_compensated_ref40, video_sinus_compensated_ref0], titles=[\"original video\", \"compensated ref 40\", \"compensated ref 0\"], figsize=(8, 3.5));"
]
},
{
Expand All @@ -269,7 +269,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.playn([video_sinus, video_sinus_compensated_ref40, video_sinus_compensated_ref0], titles=[\"original video\", \"compensated ref 40\", \"compensated ref 0\"], interval=20, figsize=(8, 3.5)))"
"render_ani_func(lambda: om.show_videos([video_sinus, video_sinus_compensated_ref40, video_sinus_compensated_ref0], titles=[\"original video\", \"compensated ref 40\", \"compensated ref 0\"], interval=20, figsize=(8, 3.5)))"
]
},
{
Expand Down Expand Up @@ -301,7 +301,7 @@
},
"outputs": [],
"source": [
"om.video.playn([video_sinus_norm, video_sinus_compensated_ref40_norm], titles=[\"original video\", \"compensated ref 40\"], figsize=(6.5, 3.5), interval=100);"
"om.show_videos([video_sinus_norm, video_sinus_compensated_ref40_norm], titles=[\"original video\", \"compensated ref 40\"], figsize=(6.5, 3.5), interval=100);"
]
},
{
Expand All @@ -314,7 +314,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.playn([video_sinus_norm, video_sinus_compensated_ref40_norm], titles=[\"original video\", \"compensated ref 40\"], figsize=(6.5, 3.5), interval=100))"
"render_ani_func(lambda: om.show_videos([video_sinus_norm, video_sinus_compensated_ref40_norm], titles=[\"original video\", \"compensated ref 40\"], figsize=(6.5, 3.5), interval=100))"
]
},
{
Expand Down Expand Up @@ -412,7 +412,7 @@
},
"outputs": [],
"source": [
"om.video.playn([video_sinus_contrast3, video_sinus_contrast5, video_sinus_contrast9],\n",
"om.show_videos([video_sinus_contrast3, video_sinus_contrast5, video_sinus_contrast9],\n",
" titles=[\"contrast kernel 3\", \"contrast kernel 5\", \"contrast kernel 9\"],\n",
" skip_frame=3,\n",
" figsize=(8, 3.5));"
Expand All @@ -429,7 +429,7 @@
"outputs": [],
"source": [
"def f():\n",
" return om.video.playn([video_sinus_contrast3, video_sinus_contrast5, video_sinus_contrast9], titles=[\"contrast kernel 3\", \"contrast kernel 5\", \"contrast kernel 9\"], skip_frame=1, figsize=(8, 3.5))\n",
" return om.show_videos([video_sinus_contrast3, video_sinus_contrast5, video_sinus_contrast9], titles=[\"contrast kernel 3\", \"contrast kernel 5\", \"contrast kernel 9\"], skip_frame=1, figsize=(8, 3.5))\n",
"render_ani_func(f)"
]
},
Expand Down Expand Up @@ -465,7 +465,7 @@
},
"outputs": [],
"source": [
"om.video.playn([video_sinus_compensated_nocontrast, video_sinus_compensated_contrast3, video_sinus_compensated_contrast9],\n",
"om.show_videos([video_sinus_compensated_nocontrast, video_sinus_compensated_contrast3, video_sinus_compensated_contrast9],\n",
" titles=[\"no contrast\", \"contrast kernel 3\", \"contrast kernel 9\"],\n",
" skip_frame=1, interval=10,\n",
" figsize=(8, 3.5));"
Expand All @@ -481,7 +481,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.playn([video_sinus_compensated_nocontrast, video_sinus_compensated_contrast3, video_sinus_compensated_contrast9],\n",
"render_ani_func(lambda: om.show_videos([video_sinus_compensated_nocontrast, video_sinus_compensated_contrast3, video_sinus_compensated_contrast9],\n",
" titles=[\"no contrast\", \"contrast kernel 3\", \"contrast kernel 9\"],\n",
" skip_frame=1, interval=10,\n",
" figsize=(8, 3.5)) )"
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorials/phase.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
},
"outputs": [],
"source": [
"om.video.play(video_warped_normalized, interval=40);"
"om.show_video(video_warped_normalized, interval=40);"
]
},
{
Expand All @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.play(video_warped_normalized, interval=40))"
"render_ani_func(lambda: om.show_video(video_warped_normalized, interval=40))"
]
},
{
Expand Down Expand Up @@ -182,7 +182,7 @@
},
"outputs": [],
"source": [
"om.video.play(video_phase, title='phase video', cmap='hsv', interval=40);"
"om.show_video(video_phase, title='phase video', cmap='hsv', interval=40);"
]
},
{
Expand All @@ -195,7 +195,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.play(video_phase, title='phase video', cmap='hsv', interval=40))"
"render_ani_func(lambda: om.show_video(video_phase, title='phase video', cmap='hsv', interval=40))"
]
},
{
Expand Down Expand Up @@ -249,7 +249,7 @@
},
"outputs": [],
"source": [
"om.video.play(video_phase_filtered, title='removed outliers', cmap='hsv', interval=40);"
"om.show_video(video_phase_filtered, title='removed outliers', cmap='hsv', interval=40);"
]
},
{
Expand All @@ -262,7 +262,7 @@
},
"outputs": [],
"source": [
"render_ani_func(lambda: om.video.play(video_phase_filtered, title='removed outliers', cmap='hsv', interval=40))"
"render_ani_func(lambda: om.show_video(video_phase_filtered, title='removed outliers', cmap='hsv', interval=40))"
]
},
{
Expand Down

0 comments on commit 00e294e

Please sign in to comment.