From c3a5875c01aecc3a33217298ea50571763d27f5b Mon Sep 17 00:00:00 2001 From: 7anooch Date: Tue, 18 Nov 2025 11:20:40 -0800 Subject: [PATCH 1/2] fixed varaible naming issue, notebook now runs start-end without problem --- examples/make_trails.ipynb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/make_trails.ipynb b/examples/make_trails.ipynb index 702f381..b28786e 100644 --- a/examples/make_trails.ipynb +++ b/examples/make_trails.ipynb @@ -58,8 +58,12 @@ "source": [ "# Create and save your visualization\n", "# In this case, an early and late timepoint are shown overlaid in different colors\n", - "early = wts.create_time_encoded_frame(average_subtracted_array, colormap=np.array([[255,0,0]]), window=20, start_time=60*10, scale_factor=30, offset=-30, light_background=True)\n", - "late = wts.create_time_encoded_frame(average_subtracted_array, colormap=np.array([[0,0,255]]), window=20, start_time=60*30, scale_factor=30, offset=-30, light_background=True)\n", + "early = wts.create_time_encoded_frame(average_subtracted_array, colormap=np.array([[255,0,0]]), \n", + " window=20, start_time=60*10, scale_factor=30, offset=-30, \n", + " light_background=True)\n", + "late = wts.create_time_encoded_frame(average_subtracted_array, colormap=np.array([[0,0,255]]), \n", + " window=20, start_time=60*30, scale_factor=30, offset=-30, \n", + " light_background=True)\n", "early_and_late = np.min(np.array([early, late]), axis=0)\n", "wts.show_frame(early_and_late)\n", "cv2.imwrite(\"./early_and_late.png\", early_and_late)" @@ -73,7 +77,9 @@ "outputs": [], "source": [ "# In this example, one timepoint is shown with fading trails\n", - "t_10_minutes = wts.create_time_encoded_frame(average_subtracted_array, colormap=wts.white_to_black, window=20, start_time=60*10, scale_factor=30, offset=-30, light_background=True)\n", + "t_10_minutes = wts.create_time_encoded_frame(average_subtracted_array, colormap=wts.white_to_black, \n", + " window=20, start_time=60*10, scale_factor=30, \n", + " offset=-30, light_background=True)\n", "wts.show_frame(t_10_minutes)\n", "cv2.imwrite(\"./t_10_minutes.png\", t_10_minutes)" ] @@ -87,7 +93,8 @@ "source": [ "# This example creates a video instead of a single frame\n", "# Processing may take up to 15 minutes\n", - "time_encoded_array = wts.create_time_encoded_array(average_subtracted_array, colormap=wts.white_to_black, window=20, scale_factor=30, offset=-30)" + "time_encoded_array = wts.create_time_encoded_array(average_subtracted_array, colormap=wts.white_to_black, \n", + " window=20, scale_factor=30, offset=-30)" ] }, { @@ -98,7 +105,7 @@ "outputs": [], "source": [ "# Preview the created video\n", - "wts.show_video_array(video_array)" + "wts.show_video_array(time_encoded_array)" ] }, { @@ -109,7 +116,7 @@ "outputs": [], "source": [ "# Save the video\n", - "wts.write_mp4(video_array, \"fading_trails.mp4\")" + "wts.write_mp4(time_encoded_array, \"fading_trails.mp4\")" ] } ], From 51b404187136c92e5dedfb2eb68d53305cdbb058 Mon Sep 17 00:00:00 2001 From: 7anooch Date: Tue, 18 Nov 2025 11:29:13 -0800 Subject: [PATCH 2/2] edit to use same same video used in the other notebook --- examples/add_timestamp.ipynb | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/examples/add_timestamp.ipynb b/examples/add_timestamp.ipynb index 8a53762..6357bad 100644 --- a/examples/add_timestamp.ipynb +++ b/examples/add_timestamp.ipynb @@ -14,11 +14,11 @@ { "cell_type": "code", "execution_count": null, - "id": "f6b4af83-7501-45d4-9b8f-42856480ea84", + "id": "15b4568f", "metadata": {}, "outputs": [], "source": [ - "video_array = wts.read_video_file(\"/Users/dante/Desktop/scripts/motionVis/motionVis/600mm_rep2_w20_c40_n60_postVignetteCorrection.avi\")" + "video_array = wts.read_video_file(\"./chemotaxis_control.mp4\")" ] }, { @@ -36,23 +36,15 @@ "execution_count": null, "id": "33717d12-e584-434e-b44b-df513fed7871", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Video successfully written to /Users/dante/Desktop/scripts/motionVis/motionVis/600mm_rep2_w20_c40_n60_postVignetteCorrection_timestamped.mp4\n" - ] - } - ], + "outputs": [], "source": [ - "wts.write_mp4(video_array, \"/Users/dante/Desktop/scripts/motionVis/motionVis/600mm_rep2_w20_c40_n60_postVignetteCorrection_timestamped.mp4\")" + "wts.write_mp4(video_array, \"./chemotaxis_control_timestamped.mp4\")" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "wormtails", "language": "python", "name": "python3" }, @@ -66,7 +58,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.13.5" + "version": "3.14.0" } }, "nbformat": 4,