{ "cells": [ { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "# Batch convert voxel data to APR." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "import paprica" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "First we define the path where the data is located, you can use the data used for testing or your own data." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "path = '../../../data/synthetic/tif'" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false, "pycharm": { "name": "#%% md\n" } }, "source": [ "We then parse this data using the parser:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "tiles = paprica.tileParser(path, frame_size=2048, ftype='tiff3D')" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "Next, we batch convert the data. Please refer to the original paper to understand and set correctly the conversion parameters. The parameters that do not appear below are automatically determined but can also be set by the user:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "converter = paprica.tileConverter(tiles)\n", "converter.batch_convert_to_apr(Ip_th=120, # Intensity thresholding parameter\n", " rel_error=0.2, # Relative error parameter\n", " gradient_smoothing=5, # Gradient smoothing parameters\n", " )" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "It is also possible to batch reconstruct data:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "tiles_tiff = paprica.tileParser(path='path_to_tiff_data', frame_size=2048)\n", "converter = paprica.tileConverter(tiles_tiff)\n", "converter.batch_reconstruct_pixel()" ] } ], "metadata": { "jupytext": { "formats": "ipynb,md:myst" }, "kernelspec": { "display_name": "Python 3.9.10 ('env': venv)", "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.10" }, "vscode": { "interpreter": { "hash": "996559e7c3af3717ab7f512df65efa103e5d1d52a1762ef1fac31796ff1d7bc1" } } }, "nbformat": 4, "nbformat_minor": 1 }