{"name":"napari-time-slicer","display_name":"napari-time-slicer","visibility":"public","icon":"","categories":[],"schema_version":"0.2.0","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-time-slicer.napari_experimental_provide_function","title":"convert_to_2d_timelapse","python_name":"napari_time_slicer._function:napari_experimental_provide_function","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"napari-time-slicer.napari_experimental_provide_function","display_name":"convert_to_2d_timelapse","autogenerate":true}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"napari-time-slicer","version":"0.5.0","dynamic":null,"platform":null,"supported_platform":null,"summary":"A meta plugin for processing timelapse data in napari timepoint by timepoint","description":"# napari-time-slicer\n\n[![License](https://img.shields.io/pypi/l/napari-time-slicer.svg?color=green)](https://github.com/haesleinhuepf/napari-time-slicer/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-time-slicer.svg?color=green)](https://pypi.org/project/napari-time-slicer)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-time-slicer.svg?color=green)](https://python.org)\n[![tests](https://github.com/haesleinhuepf/napari-time-slicer/workflows/tests/badge.svg)](https://github.com/haesleinhuepf/napari-time-slicer/actions)\n[![codecov](https://codecov.io/gh/haesleinhuepf/napari-time-slicer/branch/main/graph/badge.svg)](https://codecov.io/gh/haesleinhuepf/napari-time-slicer)\n[![Development Status](https://img.shields.io/pypi/status/napari-time-slicer.svg)](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-time-slicer)](https://napari-hub.org/plugins/napari-time-slicer)\n\nA meta plugin for processing timelapse data timepoint by timepoint. It \nenables a list of napari plugins to process 2D+t or 3D+t data step by step when the user goes \nthrough the timelapse. Currently, these plugins are using `napari-time-slicer`:\n* [napari-segment-blobs-and-things-with-membranes](https://www.napari-hub.org/plugins/napari-segment-blobs-and-things-with-membranes)\n* [napari-cupy-image-processing](https://www.napari-hub.org/plugins/napari-cupy-image-processing)\n* [napari-pyclesperanto-assistant](https://www.napari-hub.org/plugins/napari-pyclesperanto-assistant)\n* [napari-accelerated-pixel-and-object-classification](https://www.napari-hub.org/plugins/napari-accelerated-pixel-and-object-classification)\n* [napari-simpleitk-image-processing](https://www.napari-hub.org/plugins/napari-simpleitk-image-processing)\n* [napari-stress](https://www.napari-hub.org/plugins/napari-stress)\n* [napari-process-points-and-surfaces](https://www.napari-hub.org/plugins/napari-process-points-and-surfaces)\n\n`napari-time-slicer` enables inter-plugin communication, e.g. allowing to combine the plugins listed above in \none image processing workflow for segmenting a timelapse dataset:\n\n![](https://github.com/haesleinhuepf/napari-time-slicer/raw/main/images/screencast1.gif)\n\nThe workflow can then also be exported as a script. The 'Generate Code' button can be found in the [Workflow Inspector](https://www.napari-hub.org/plugins/napari-workflow-inspector)\n\n\nIf you want to convert a 3D dataset into a 2D + time dataset, use the \nmenu `Tools > Utilities > Convert 3D stack to 2D timelapse (time-slicer)`. It will turn the 3D dataset to a 4D datset\nwhere the Z-dimension (index 1) has only 1 element, which will in napari be displayed with a time-slider. Note: It is \nrecommended to remove the original 3D dataset after this conversion.\n\n## Working with large on-the-fly processed datasets\n\nUsing the [napari-assistant](https://www.napari-hub.org/plugins/napari-assistant) complex image processing workflows on timelapse datasets can be setup. \nIn combination with the time-slicer it is possible to process time-lapse data that is larger than available computer memory.\nIn case the workflow only consists of images and label-images and out-of-memory issues arise, consider storing intermediate results on disk following this procedure: \nAfter setting up the workflow and testing it on a couple of selected frames, store the entire processed timelapse dataset to disk \nusing the menu `Tools > Utilities > Convert to file-backed timelapse data (time-slicer)`. It will open this dialog, where you can select \n![img.png](https://github.com/haesleinhuepf/napari-time-slicer/raw/main/images/convert_to_file_backed_timelapse.png)\n\nIt is recommended to enter a folder location in the text field. \nIf not provided, a temporary folder will be created, typically in the User's temp folder in the home directory. \nThe user is responsible for emptying this folder from time to time.\nThe data stored in this folder can also be loaded into napari using its `File > Open Folder...` menu.\n\nExecuting this operation can take time as every timepoint of the timelapse is computed. \nAfterwards, there will be another layer available in napari, which is typically faster to navigate through. \nConsider removing the layer(s) that were only needed to determine the new file-backed layer.\n\n![img.png](https://github.com/haesleinhuepf/napari-time-slicer/raw/main/images/new_file_backed_layer.png)\n\n## Usage for plugin developers\n\nPlugins which implement the `napari_experimental_provide_function` hook can make use of the `@time_slicer`. At the moment,\nonly functions which take `napari.types.ImageData`, `napari.types.LabelsData` and basic python types such as `int` \nand `float` are supported. If you annotate such a function with `@time_slicer` it will internally convert any 4D dataset\nto a 3D dataset according to the timepoint currently selected in napari. Furthermore, when the napari user changes the\ncurrent timepoint or the input data of the function changes, a re-computation is invoked. Thus, it is recommended to \nonly use the `time_slicer` for functions which can provide [almost] real-time performance. Another constraint is that \nthese annotated functions have to have a `viewer` parameter. This is necessary to read the current timepoint from the \nviewer when invoking the re-computions.\n\nExample\n```python\nimport napari\nfrom napari_time_slicer import time_slicer\n\n@time_slicer\ndef threshold_otsu(image:napari.types.ImageData, viewer: napari.Viewer = None) -> napari.types.LabelsData:\n # ...\n```\n\nYou can see a full implementations of this concept in the napari plugins listed above.\n\nIf you want to combine slicing in time and processing z-stack images slice-by-slice, you can use the `@slice_by_slice` annotation.\nMake sure, to insert it after `@time_slicer` as shown below and implemented in [napari-pillow-image-processing](https://github.com/haesleinhuepf/napari-pillow-image-processing/blob/4d846b226739843124953f16059241d917cde8e1/src/napari_pillow_image_processing/__init__.py#L151)\n\n```python\nfrom napari_time_slicer import slice_by_slice\n\n@time_slicer\n@slice_by_slice\ndef blur_2d(image:napari.types.ImageData, sigma:float = 1, viewer: napari.Viewer = None) -> napari.types.LabelsData:\n # ...\n```\n\n----------------------------------\n\nThis [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.\n\n## Installation\n\nYou can install `napari-time-slicer` via [pip]:\n\n pip install napari-time-slicer\n\n\n\nTo install latest development version :\n\n pip install git+https://github.com/haesleinhuepf/napari-time-slicer.git\n\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 [BSD-3] license,\n\"napari-time-slicer\" 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[file an issue]: https://github.com/haesleinhuepf/napari-time-slicer/issues\n\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":"https://github.com/haesleinhuepf/napari-time-slicer","download_url":null,"author":"Robert Haase","author_email":"robert.haase@tu-dresden.de","maintainer":null,"maintainer_email":null,"license":"BSD-3-Clause","classifier":["Development Status :: 3 - Alpha","Intended Audience :: Developers","Framework :: napari","Topic :: Scientific/Engineering :: Image Processing","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3.8","Programming Language :: Python :: 3.9","Programming Language :: Python :: 3.10","Operating System :: OS Independent","License :: OSI Approved :: BSD License"],"requires_dist":["napari-plugin-engine >=0.1.4","numpy","toolz","napari-tools-menu","napari-workflows"],"requires_python":">=3.8","requires_external":null,"project_url":["Bug Tracker, https://github.com/haesleinhuepf/napari-time-slicer/issues","Documentation, https://github.com/haesleinhuepf/napari-time-slicer#README.md","Source Code, https://github.com/haesleinhuepf/napari-time-slicer","User Support, https://github.com/haesleinhuepf/napari-time-slicer/issues"],"provides_extra":null,"provides_dist":null,"obsoletes_dist":null},"npe1_shim":true}