Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions examples/add_timestamp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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\")"
]
},
{
Expand All @@ -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"
},
Expand All @@ -66,7 +58,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.5"
"version": "3.14.0"
}
},
"nbformat": 4,
Expand Down
19 changes: 13 additions & 6 deletions examples/make_trails.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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)"
]
Expand All @@ -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)"
]
},
{
Expand All @@ -98,7 +105,7 @@
"outputs": [],
"source": [
"# Preview the created video\n",
"wts.show_video_array(video_array)"
"wts.show_video_array(time_encoded_array)"
]
},
{
Expand All @@ -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\")"
]
}
],
Expand Down