← 返回首页
Iw refactor by kushalkolar · Pull Request #482 · fastplotlib/fastplotlib · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ipynb  (2) .png  (3) .py  (1) .rst  (1) All 4 file types selected Viewed files
Conversations
Failed to load comments. Retry
Loading
Jump to
Jump to file
Failed to load files. Retry
Loading
Diff view
Unified
Split
Hide whitespace
Apply and reload
Show whitespace
Diff view
Unified
Split
Hide whitespace
Apply and reload
4 changes: 3 additions & 1 deletion docs/source/api/widgets/ImageWidget.rst
Show comments View file Edit file Delete file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ Properties
ImageWidget.cmap
ImageWidget.current_index
ImageWidget.data
ImageWidget.dims_order
ImageWidget.frame_apply
ImageWidget.gridplot
ImageWidget.managed_graphics
ImageWidget.n_img_dims
ImageWidget.n_scrollable_dims
ImageWidget.ndim
ImageWidget.slider_dims
ImageWidget.sliders
Expand Down
1 change: 0 additions & 1 deletion examples/notebooks/image_widget.ipynb
Show comments View file Edit file Delete file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
"source": [
"iw_movie = ImageWidget(\n",
" data=gray_movie, \n",
" slider_dims=[\"t\"],\n",
" cmap=\"gray\"\n",
")"
]
Expand Down
63 changes: 51 additions & 12 deletions examples/notebooks/image_widget_test.ipynb
Show comments View file Edit file Delete file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "07019035-83f2-4753-9e7c-628ae439b441",
"metadata": {
"tags": []
Expand All @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "10b8ab40-944d-472c-9b7e-cae8a129e7ce",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -130,7 +130,6 @@
"source": [
"iw_movie = ImageWidget(\n",
" data=gray_movie, \n",
" slider_dims=[\"t\"],\n",
" cmap=\"gray\",\n",
" grid_plot_kwargs={\"size\": (900, 600)},\n",
")"
Expand Down Expand Up @@ -275,9 +274,6 @@
"execution_count": null,
"id": "76535d56-e514-4c16-aa48-a6359f8019d5",
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -444,23 +440,66 @@
"iw_z.close()"
]
},
{
"cell_type": "markdown",
"id": "6716f255-44c2-400d-a2bf-254683e4cd9d",
"metadata": {},
"source": [
"# Test Mixed Shapes, RGB (and set data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "870627ef-09d8-44e4-8952-aedb702d1526",
"execution_count": 30,
"id": "ed783360-992d-40f8-bb6f-152a59edff43",
"metadata": {},
"outputs": [],
"source": [
"notebook_finished()"
"zfish_data = np.load(\"./zfish_test.npy\")\n",
"zfish_frame_1 = zfish_data[0, 0, :, :]\n",
"zfish_frame_2 = zfish_data[20, 3, :, :]\n",
"movie = iio.imread(\"imageio:cockatoo.mp4\")\n",
"\n",
"iw_mixed_shapes = ImageWidget(\n",
" data=[zfish_frame_1, movie], # you can also provide a list of tzxy arrays\n",
" rgb=[False, True],\n",
" histogram_widget=True,\n",
" cmap=\"gnuplot2\", \n",
" grid_plot_kwargs = {\"controller_ids\": None},\n",
")\n",
"\n",
"iw_mixed_shapes.show()"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "274c67b4-aa07-4fcf-a094-1b1e70d0378a",
"metadata": {},
"outputs": [],
"source": [
"iw_mixed_shapes.sliders[\"t\"].value = 50\n",
"plot_test(\"image-widget-zfish-mixed-rgb-cockatoo-frame-50\", iw_mixed_shapes.gridplot)\n",
"\n",
"#Set the data, changing the first array and also the size of the \"T\" slider\n",
"iw_mixed_shapes.set_data([zfish_frame_2, movie[:200, :, :, :]], reset_indices=True)\n",
"plot_test(\"image-widget-zfish-mixed-rgb-cockatoo-set-data\", iw_mixed_shapes.gridplot)\n",
"\n",
"#Check how a window function might work on the RGB data\n",
"iw_mixed_shapes.window_funcs = {\"t\": (np.mean, 4)}\n",
"iw_mixed_shapes.sliders[\"t\"].value = 20\n",
"plot_test(\"image-widget-zfish-mixed-rgb-cockatoo-windowrgb\", iw_mixed_shapes.gridplot)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b8fff1a6-119e-4f03-ba3a-4c7b9e8c212b",
"id": "870627ef-09d8-44e4-8952-aedb702d1526",
"metadata": {},
"outputs": [],
"source": []
"source": [
"notebook_finished()"
]
}
],
"metadata": {
Expand All @@ -479,7 +518,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
Loading
Toggle all file notes Toggle all file annotations

Footer

© 2026 GitHub, Inc.