{"name":"tomopari","display_name":"tomopari","visibility":"public","icon":"","categories":[],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"tomopari.make_reconstruct_widget","title":"Reconstruct OPT data with ToMoDL","python_name":"tomopari._reconstruction_widget:ReconstructionWidget","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"tomopari.make_reconstruct_widget","display_name":"tomopari","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"tomopari","version":"0.1.5","dynamic":null,"platform":null,"supported_platform":null,"summary":"A plugin for accelerated tomographic reconstruction.","description":"# tomopari\n\n[![License MIT](https://img.shields.io/pypi/l/tomopari.svg?color=green)](https://github.com/obandomarcos/ToMoDL/blob/nhattm/tomopari/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/tomopari.svg?color=green)](https://pypi.org/project/tomopari)\n[![Python Version](https://img.shields.io/pypi/pyversions/tomopari.svg?color=green)](https://python.org)\n<!-- [![tests](https://github.com/marcoso96/tomopari/workflows/tests/badge.svg)](https://github.com/marcoso96/tomopari/actions) -->\n<!-- [![codecov](https://codecov.io/gh/marcoso96/tomopari/branch/main/graph/badge.svg)](https://codecov.io/gh/marcoso96/tomopari) -->\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/tomopari)](https://napari-hub.org/plugins/tomopari)\n\nA plugin for accelerated tomographic reconstruction.\n\n----------------------------------\n\nThis [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.\n\n<!--\nDon't miss the full getting started guide to set up your new package:\nhttps://github.com/napari/cookiecutter-napari-plugin#getting-started\n\nand review the napari docs for plugin developers:\nhttps://napari.org/stable/plugins/index.html\n-->\n## 🔬 Introduction\n\n**tomopari** is a [napari](https://napari.org/) plugin that enables users to easily reconstruct tomography images directly from raw projection data. Simply load an ordered stack of projection files into the napari viewer, and the plugin takes care of reconstructing the corresponding tomographic volume.  \n\n## 🚀 Usage\n\n1. **Load ordered stack**  \n![plot](https://raw.githubusercontent.com/obandomarcos/ToMoDL/refs/heads/nhattm/tomopari/figures/stack_image.png)\n\nGo to **File → Open Files as Stack...** and load the angular projections for parallel beam optical tomography reconstruction.\n\nAfter loading, the stack of `θ`-angular projection images should have shape `(N_angles × H × W)`\n\nwhere:\n\n- `N_angles`: number of projection views (one image per rotation angle `θ`),\n- `H`: detector height (vertical pixel dimension),\n- `W`: detector width (horizontal pixel dimension).\n\n2. **Select image layer**  \n![plot](https://raw.githubusercontent.com/obandomarcos/ToMoDL/refs/heads/nhattm/tomopari/figures/select_layer.png)\n\nIn the dropdown menu, click **Select image layer** and choose the loaded volume.\n\n---\n\n### <span style=\"font-size:1.2em;\"><strong>From here you can choose between two reconstruction modes: Basic and Advanced.</strong></span>\n\n### 🔹 Basic Mode\n![plot](https://raw.githubusercontent.com/obandomarcos/ToMoDL/refs/heads/nhattm/tomopari/figures/basic_mode.png)\n\n3. **Half-rotation**  \n- Click **Half rotation** if your projection data were acquired from 0° to 180°.  \n- Leave it unchecked if data were acquired from 0° to 360°.\n\n4. **Automatic axis alignment**  \nIf the rotation axis is not correctly aligned during acquisition, enable **Automatic axis alignment**. This aligns the sinogram to the detector center using the [Wall-method].\n\n5. **Compression**  \n   Compression affects the detector dimension differently depending on the acquisition mode:\n\n   - Vertical-axis mode → the `W` will be resized\n   - Horizontal-axis mode → the `H` will be resized\n\n   Available compression levels:\n   - **HIGH** → resize to 100  \n   - **MEDIUM** → resize to 256  \n   - **LOW** → resize to 512  \n   - **NO** → no compression  \n  \n\n\n6. **Reconstruction method**  \n   - **FBP CPU / FBP GPU** → from the [QBI_radon] library  \n   - **TOMODL CPU / TOMODL GPU / UNET CPU / UNET GPU** → proposed in our [ToMoDL-paper]  \n\n7. **Smoothing level**  \n   Select smoothing strength (only applies to **TOMODL** methods). Can be more fine tuned in the **Advanced mode**.\n    - **LOW** → 2  \n    - **MEDIUM** → 4  \n    - **HIGH** → 6 \n\n8. **Rotation axis**  \n   Select how your data is organized with respect to the rotation axis:\n   - **Vertical** → rotation axis parallel to `H`\n   - **Horizontal** → rotation axis parallel to `W`\n---\n\n### 🔹 Advanced Mode\n![plot](https://raw.githubusercontent.com/obandomarcos/ToMoDL/refs/heads/nhattm/tomopari/figures/advanced_mode.png)\n\n9. **Manual axis alignment**  \n   Shift the object along `W` in vertical mode, and along `H` in horizontal mode. \n   - Negative values → shift left (toward lower pixel indices)\n   - Positive values → shift right (toward higher pixel indices)\n\n10. **Reshape volume**  \n    Select a reconstruction size (alternative to compression levels from Basic mode).\n\n11. **Flat-field correction**  \n    Apply flat-field correction to projection data before reconstruction.\n\n12. **Clip to circle**  \n    Constrain the reconstructed object inside a circular region.\n\n13. **Filter (FBP only)**  \n    Choose the filter to apply when using FBP methods. \n\n14. **Full volume mode**  \n    - Enabled → reconstruct the whole volume.  \n\n16. **One Slice mode**  \n    - Enabled → reconstruct only a single slice at **Slice #** index. \n\n17. **Slices mode**\n    - Enabled → reconstruct from index 0  up to the chosen slice index defined in **Slice #**.\n\n18. **Batch size**  \n    Number of slices processed simultaneously:  \n    - Higher values → faster reconstruction but greater GPU memory usage.  \n    - On CPU → limited to processing **1 slice at a time**.  \n\n19. **Invert colors**  \n    Invert grayscale values in the reconstructed volume.\n\n20. **16-bit conversion**  \n   The reconstructed volume is always generated in **32-bit float** precision. Enable this option to convert the final volume to **16-bit**, which significantly improves 3D rendering performance in napari.\n   Leave it unchecked if you prefer to keep the full 32-bit float output.\n---\n\n21. **Reconstruct!** \n\n![plot](https://raw.githubusercontent.com/obandomarcos/ToMoDL/refs/heads/nhattm/tomopari/figures/reconstruct_button.png)\n\n   A new layer will appear on top of the projections stack with the reconstructed volume.\n\n\n## 💻 Installation Guide *(No Code — Highly Recommended)*\n\n### 🧩 **Step 1: Install Napari (Bundled App)**\n\n> 💡 *Skip this step if you already installed Napari via `pip`.*\n\nYou can directly download the official Napari **bundled installer** for your operating system:\n\n* 🪟 **Windows (.exe):**\n  👉 [napari-0.6.5-Windows-x86_64.exe](https://github.com/napari/napari/releases/download/v0.6.5/napari-0.6.5-Windows-x86_64.exe)\n\n* 🐧 **Ubuntu (.sh):**\n  👉 [napari-0.6.5-Linux-x86_64.sh](https://github.com/napari/napari/releases/download/v0.6.5/napari-0.6.5-Linux-x86_64.sh)\n\n📘 **Official Guide:**\nFollow the Napari documentation for detailed installation steps:\n🔗 [Napari Installation Guide (Bundled App)](https://napari.org/0.6.5/tutorials/fundamentals/installation_bundle_conda.html)\n\n---\n\n### ⚙️ **Step 2: Install PyTorch Inside Napari’s Bundled Environment**\n\n> 💡 *Skip this step if PyTorch is already installed in your Napari environment.*\n\nThis step ensures **PyTorch** is properly installed within Napari’s internal Conda environment for full compatibility.\n\n#### 🪟 **Windows Users**\n\n1. Download the installer:\n   🔗 [install_torch2napari_windows.bat](https://github.com/obandomarcos/ToMoDL/releases/download/v0.1.0/install_torch2napari_windows.bat)\n2. Double-click the `.bat` file to run it.\n   *(It will automatically detect Napari’s environment and install PyTorch.)*\n\n#### 🐧 **Linux Users**\n\n1. Download the installer:\n   🔗 [install_torch2napari_linux.sh](https://github.com/obandomarcos/ToMoDL/releases/download/v0.1.0/install_torch2napari_linux.sh)\n2. Run it in your terminal:\n\n   ```bash\n   bash install_torch2napari_linux.sh\n   ```\n\n---\n\n### 3️⃣ Install our plugin — **tomopari**\n\nOur plugin is available on the [napari-hub](https://napari-hub.org/plugins/tomopari.html).\n---\n🔹 Option 1: Install directly from napari\n1. Open **napari**.  \n2. Go to **Plugins → Install/Uninstall Plugins**.  \n3. Search for **tomopari** and click **Install**.\n---\n🔹 Option 2: Install via pip (from Napari Console)\nOpen napari’s **Python Console** and type:\n\n```bash\npip install tomopari\n```\n\n> After installation, **restart napari** to apply the changes. 😊\n\n## 🤝 Contributing\n\nContributions are very welcome. Tests can be run with [tox], please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n## 📜 License\n\nDistributed under the terms of the [MIT] license,\n\"tomopari\" is free and open source software\n\n## 🐛Issues\n\nIf you encounter any problems, please [file an issue] along with a detailed description.\n\n[napari]: https://github.com/napari/napari\n[Cookiecutter]: https://github.com/audreyr/cookiecutter\n[@napari]: https://github.com/napari\n[MIT]: http://opensource.org/licenses/MIT\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\n[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin\n\n[QBI_radon]: https://github.com/QBioImaging/QBI_radon\n[Wall-method]: https://doi.org/10.1088/0031-9155/50/19/015\n[ToMoDL-paper]: https://doi.org/10.1038/s41598-023-47650-3\n[napari]: https://github.com/napari/napari\n[tox]: https://tox.readthedocs.io/en/latest/\n[pip]: https://pypi.org/project/pip/\n[PyPI]: https://pypi.org/\n","description_content_type":"text/markdown","keywords":null,"home_page":null,"download_url":null,"author":"Marcos Antonio Obando, Minh Nhat Trinh, David Palecek, Germán Mato, Teresa Correia","author_email":"marcos.obando@ib.edu.ar","maintainer":null,"maintainer_email":null,"license":"MIT","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: MIT License","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3.9","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["magicgui","qtpy","scikit-image","scipy","qbi-radon"],"requires_python":">=3.9","requires_external":null,"project_url":null,"provides_extra":null,"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}