{ "cells": [ { "cell_type": "markdown", "id": "94e6bb0c-c0ff-445a-abb4-f80e77f607e6", "metadata": {}, "source": [ "# Interactive histogram\n", "In this notebook we will create a histogram shown next to an image. By dragging the mouse in the image, one can create a new histogram of the intensities in the specified region." ] }, { "cell_type": "code", "execution_count": 1, "id": "f85a9c99-dd9b-4adf-8fde-1e74c942694b", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import stackview \n", "from skimage.io import imread\n", "\n", "image = imread(\"data/Haase_MRT_tfl3d1.tif\")" ] }, { "cell_type": "code", "execution_count": 2, "id": "28034b4b-2393-4930-ad80-60b6c38b549d", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8e4ef033adff4193a5bef60299f7b41a", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(VBox(children=(HBox(children=(VBox(children=(HBox(children=(VBox(children=(ImageWidget(height=2…" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stackview.histogram(image, zoom_factor=1.5)" ] }, { "cell_type": "code", "execution_count": null, "id": "661d2ad6-c80c-4357-84ba-4e530a8f62e5", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "fa383f8c-767f-4003-ab8e-b10bec4463b5", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.11" } }, "nbformat": 4, "nbformat_minor": 5 }