{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "7e865722-e4ad-4c38-8d2f-12c65c79b0ec", "metadata": {}, "outputs": [], "source": [ "from skimage.io import imread\n", "import stackview\n", "import numpy as np" ] }, { "cell_type": "code", "execution_count": 2, "id": "fe939c02-bfa5-4a76-9e31-8bb4b2f172f0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(298, 298, 3)" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "image = imread(\"images/biapol.png\")\n", "image.shape" ] }, { "cell_type": "code", "execution_count": null, "id": "454ce886-c4eb-4b95-b7bf-ee64e3e02211", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 3, "id": "ce9130f7-2187-43fa-a4ab-e19638e8b32a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
shape(298, 298, 3)
dtypeuint8
size260.2 kB
min0
max255
\n", "\n", "
" ], "text/plain": [ "StackViewNDArray([[[255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " ...,\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255]],\n", "\n", " [[255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " ...,\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255]],\n", "\n", " [[255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " ...,\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255]],\n", "\n", " ...,\n", "\n", " [[255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " ...,\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255]],\n", "\n", " [[255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " ...,\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255]],\n", "\n", " [[255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " ...,\n", " [255, 255, 255],\n", " [255, 255, 255],\n", " [255, 255, 255]]], dtype=uint8)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stackview.insight(image)" ] }, { "cell_type": "code", "execution_count": 4, "id": "96a02f63-5a77-4cc2-9eff-f91468ec6f37", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(6, 298, 298, 3)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list_images = np.asarray([image * 0.2, image * 0.4, image * 0.6, image * 0.8, image * 0.9, image])\n", "list_images.shape" ] }, { "cell_type": "code", "execution_count": 5, "id": "b5616bee-5d21-48a3-b783-5a196d7bd30d", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "779b8ad117b041a1b84a0da63108ce59", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HBox(children=(VBox(children=(ImageWidget(height=298, width=298),)),)), IntSlider(value=3, desc…" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stackview.slice(list_images)" ] } ], "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.9.16" } }, "nbformat": 4, "nbformat_minor": 5 }