{ "cells": [ { "cell_type": "markdown", "id": "3cdf478e", "metadata": {}, "source": [ "# Cell Nuclei\n", "\n", "In this example, we will use a cellular image from the Allen Cell WTC-11 hiPSC Single-Cell Image Dataset ([Viana et al. 2023](https://doi.org/10.1038/s41586-022-05563-7))." ] }, { "cell_type": "code", "execution_count": 1, "id": "59e8a2c3", "metadata": { "execution": { "iopub.execute_input": "2025-05-13T11:30:25.120269Z", "iopub.status.busy": "2025-05-13T11:30:25.120166Z", "iopub.status.idle": "2025-05-13T11:30:25.533939Z", "shell.execute_reply": "2025-05-13T11:30:25.533481Z" }, "vscode": { "languageId": "plaintext" } }, "outputs": [], "source": [ "import libcarna\n", "import numpy as np\n", "import scipy.ndimage as ndi" ] }, { "cell_type": "markdown", "id": "a3157707", "metadata": {}, "source": [ "Get the data:" ] }, { "cell_type": "code", "execution_count": 2, "id": "97c2c4ed", "metadata": { "execution": { "iopub.execute_input": "2025-05-13T11:30:25.535447Z", "iopub.status.busy": "2025-05-13T11:30:25.535270Z", "iopub.status.idle": "2025-05-13T11:30:25.596255Z", "shell.execute_reply": "2025-05-13T11:30:25.595909Z" }, "vscode": { "languageId": "plaintext" } }, "outputs": [ { "data": { "text/plain": [ "((60, 256, 256), dtype('uint16'))" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = libcarna.data.nuclei()\n", "data.shape, data.dtype" ] }, { "cell_type": "markdown", "id": "fff4fac6", "metadata": {}, "source": [ "The data is 60 × 256 × 256 pixels (uint16).\n", "\n", "## Maximum Intensity Projection\n", "\n", "In the code below, we use `normals=True` on the `volume` node; albeit this doesn't make any difference for the *Maximum\n", "Intensity Projection* (MIP), it is benefitial for other rendering modes, [discussed below](#Direct-Volume-Rendering)." ] }, { "cell_type": "code", "execution_count": 3, "id": "ed16156a", "metadata": { "execution": { "iopub.execute_input": "2025-05-13T11:30:25.597390Z", "iopub.status.busy": "2025-05-13T11:30:25.597224Z", "iopub.status.idle": "2025-05-13T11:30:26.469406Z", "shell.execute_reply": "2025-05-13T11:30:26.469030Z" }, "vscode": { "languageId": "plaintext" } }, "outputs": [ { "data": { "text/html": [ "\n", "