{ "cells": [ { "cell_type": "markdown", "metadata": { "tags": [] }, "source": [ "# Inspect 3D dataset with napari\n", "[napari](https://napari.org/stable/) is a Python library for n-dimensional image visualisation, annotation, and analysis." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Load `HDF5` dataset" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:dxchange.reader:Data successfully imported: /mnt/PETRA/SED/BEATS/IH/BEATS_first_scan-20230511T170626/BEATS_first_scan-20230511T170626.h5\n", "INFO:dxchange.reader:Data successfully imported: /mnt/PETRA/SED/BEATS/IH/BEATS_first_scan-20230511T170626/BEATS_first_scan-20230511T170626.h5\n", "INFO:dxchange.reader:Data successfully imported: /mnt/PETRA/SED/BEATS/IH/BEATS_first_scan-20230511T170626/BEATS_first_scan-20230511T170626.h5\n", "ERROR:dxchange.reader:Unrecognized hdf5 dataset: \"exchange/theta\"\n", "INFO:dxchange.reader:Data successfully imported: /mnt/PETRA/SED/BEATS/IH/BEATS_first_scan-20230511T170626/BEATS_first_scan-20230511T170626.h5\n", "INFO:dxchange.reader:Data successfully imported: /mnt/PETRA/SED/BEATS/IH/BEATS_first_scan-20230511T170626/BEATS_first_scan-20230511T170626.h5\n", "INFO:dxchange.reader:Data successfully imported: /mnt/PETRA/SED/BEATS/IH/BEATS_first_scan-20230511T170626/BEATS_first_scan-20230511T170626.h5\n", "WARNING:dxchange.exchange:num_angles(2001) is not the same as tomo.shape[0](200)\n" ] } ], "source": [ "h5file = \"/mnt/PETRA/SED/BEATS/IH/BEATS_first_scan-20230511T170626/BEATS_first_scan-20230511T170626.h5\"\n", "projs, _, _, _ = dxchange.read_aps_32id(h5file, sino=(800, 820, 1), proj=(500, 700, 1), exchange_rank=0)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import napari" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "viewer = napari.view_image(projs)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "
napari image viewer - first BEATS scan
" ] } ], "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.3" } }, "nbformat": 4, "nbformat_minor": 4 }