napari-saveas-dtype 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. napari_saveas_dtype-0.0.1/.copier-answers.yml +18 -0
  2. napari_saveas_dtype-0.0.1/.github/ISSUE_TEMPLATE/bug_report.yml +87 -0
  3. napari_saveas_dtype-0.0.1/.github/ISSUE_TEMPLATE/documentation.md +11 -0
  4. napari_saveas_dtype-0.0.1/.github/ISSUE_TEMPLATE/feature_request.md +27 -0
  5. napari_saveas_dtype-0.0.1/.github/ISSUE_TEMPLATE/task.md +11 -0
  6. napari_saveas_dtype-0.0.1/.github/PULL_REQUEST_TEMPLATE.md +12 -0
  7. napari_saveas_dtype-0.0.1/.github/workflows/test_and_deploy.yml +89 -0
  8. napari_saveas_dtype-0.0.1/.gitignore +84 -0
  9. napari_saveas_dtype-0.0.1/.napari-hub/DESCRIPTION.md +9 -0
  10. napari_saveas_dtype-0.0.1/.napari-hub/config.yml +9 -0
  11. napari_saveas_dtype-0.0.1/LICENSE +28 -0
  12. napari_saveas_dtype-0.0.1/PKG-INFO +108 -0
  13. napari_saveas_dtype-0.0.1/README.md +77 -0
  14. napari_saveas_dtype-0.0.1/pyproject.toml +105 -0
  15. napari_saveas_dtype-0.0.1/setup.cfg +4 -0
  16. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype/__init__.py +10 -0
  17. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype/_version.py +24 -0
  18. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype/_writer.py +56 -0
  19. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype/napari.yaml +21 -0
  20. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype.egg-info/PKG-INFO +108 -0
  21. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype.egg-info/SOURCES.txt +26 -0
  22. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype.egg-info/dependency_links.txt +1 -0
  23. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype.egg-info/entry_points.txt +2 -0
  24. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype.egg-info/requires.txt +4 -0
  25. napari_saveas_dtype-0.0.1/src/napari_saveas_dtype.egg-info/top_level.txt +1 -0
  26. napari_saveas_dtype-0.0.1/tests/__init__.py +0 -0
  27. napari_saveas_dtype-0.0.1/tests/test_writer.py +7 -0
  28. napari_saveas_dtype-0.0.1/tox.ini +33 -0
@@ -0,0 +1,18 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: v2.1.0
3
+ _src_path: https://github.com/napari/napari-plugin-template
4
+ display_name: Export Data Type Selector
5
+ email: david.bauer@brc.hu
6
+ full_name: David Bauer
7
+ github_repository_url: https://github.com/bauerdavid/napari-saveas-dtype
8
+ github_username_or_organization: bauerdavid
9
+ include_reader_plugin: false
10
+ include_sample_data_plugin: false
11
+ include_widget_plugin: false
12
+ include_writer_plugin: true
13
+ install_dependabot: false
14
+ install_precommit: false
15
+ license: BSD-3
16
+ module_name: napari_saveas_dtype
17
+ plugin_name: napari-saveas-dtype
18
+ short_description: Adding writer which saves images and labels with the same dtype as the original data in napari.
@@ -0,0 +1,87 @@
1
+ name: "\U0001F41B Bug Report"
2
+ description: Report a bug encountered while using napari-saveas-dtype
3
+ labels:
4
+ - "bug"
5
+
6
+ body:
7
+ - type: markdown
8
+ attributes:
9
+ value: |
10
+ Thanks for taking the time to report this issue! 🙏🏼
11
+
12
+ Please fill out the sections below to help us reproduce the problem.
13
+
14
+ - type: textarea
15
+ id: bug-report
16
+ attributes:
17
+ label: "\U0001F41B Bug Report"
18
+ description: "Please provide a clear and concise description of the bug."
19
+ placeholder: "What went wrong? What did you expect to happen?"
20
+ validations:
21
+ required: true
22
+
23
+ - type: textarea
24
+ id: steps-to-reproduce
25
+ attributes:
26
+ label: "\U0001F4A1 Steps to Reproduce"
27
+ description: "Please provide a minimal code snippet or list of steps to reproduce the bug."
28
+ placeholder: |
29
+ 1. Go to '...'
30
+ 2. Click on '....'
31
+ 3. Scroll down to '....'
32
+ 4. See error
33
+ validations:
34
+ required: true
35
+
36
+ - type: textarea
37
+ id: expected-behavior
38
+ attributes:
39
+ label: "\U0001F4A1 Expected Behavior"
40
+ description: "Please provide a clear and concise description of what you expected to happen."
41
+ placeholder: "What did you expect to happen?"
42
+
43
+ - type: textarea
44
+ id: environment
45
+ attributes:
46
+ label: "\U0001F30E Environment"
47
+ description: |
48
+ Please provide detailed information regarding your environment. Please paste the output of `napari --info` here or copy the information from the "napari info" dialog in the napari Help menu.
49
+
50
+ Otherwise, please provide information regarding your operating system (OS), Python version, napari version, Qt backend and version, Qt platform, method of installation, and any other relevant information related to your environment.
51
+
52
+
53
+ placeholder: |
54
+ napari: 0.5.0
55
+ Platform: macOS-13.2.1-arm64-arm-64bit
56
+ System: MacOS 13.2.1
57
+ Python: 3.11.4 (main, Aug 7 2023, 20:34:01) [Clang 14.0.3 (clang-1403.0.22.14.1)]
58
+ Qt: 5.15.10
59
+ PyQt5: 5.15.10
60
+ NumPy: 1.25.1
61
+ SciPy: 1.11.1
62
+ Dask: 2023.7.1
63
+ VisPy: 0.13.0
64
+ magicgui: 0.7.2
65
+ superqt: 0.5.4
66
+ in-n-out: 0.1.8
67
+ app-model: 0.2.0
68
+ npe2: 0.7.2
69
+
70
+ OpenGL:
71
+ - GL version: 2.1 Metal - 83
72
+ - MAX_TEXTURE_SIZE: 16384
73
+
74
+ Screens:
75
+ - screen 1: resolution 1512x982, scale 2.0
76
+
77
+ Settings path:
78
+ - /Users/.../napari/napari_5c6993c40c104085444cfc0c77fa392cb5cb8f56/settings.yaml
79
+ validations:
80
+ required: true
81
+
82
+ - type: textarea
83
+ id: additional-context
84
+ attributes:
85
+ label: "\U0001F4A1 Additional Context"
86
+ description: "Please provide any additional information or context regarding the problem here."
87
+ placeholder: "Add any other context about the problem here."
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: "\U0001F4DA Documentation"
3
+ about: Report an issue with napari-saveas-dtype documentation
4
+ title: ''
5
+ labels: documentation
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## 📚 Documentation
11
+ <!-- A clear and concise description of the documentation that needs to be created/updated -->
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: "\U0001F680 Feature Request"
3
+ about: Submit a proposal/request for a new napari-saveas-dtype feature
4
+ title: ''
5
+ labels: feature
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## 🚀 Feature
11
+ <!-- A clear and concise description of the feature proposal -->
12
+
13
+ ## Motivation
14
+
15
+ <!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->
16
+
17
+ ## Pitch
18
+
19
+ <!-- A clear and concise description of what you want to happen. -->
20
+
21
+ ## Alternatives
22
+
23
+ <!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->
24
+
25
+ ## Additional context
26
+
27
+ <!-- Add any other context or screenshots about the feature request here. -->
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: "\U0001F9F0 Task"
3
+ about: Maintenance, follow-ups, and other defined to-do items
4
+ title: ''
5
+ labels: task
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## 🧰 Task
11
+ <!-- A clear and concise description of the task -->
@@ -0,0 +1,12 @@
1
+ # References and relevant issues
2
+ <!-- What relevant resources were used in the creation of this PR?
3
+ If this PR addresses an existing issue on the repo,
4
+ please link to that issue here as "Closes #(issue-number)"
5
+ If this PR depends on another PR/issue (even in another repo),
6
+ please link to it with "Depends on #PR-number" or "Depends on org/repo#PR-number"
7
+ -->
8
+
9
+ # Description
10
+ <!-- What does this pull request (PR) do? Is it a new feature, a bug fix,
11
+ an improvement, or something else? Why is it necessary? If relevant, please add
12
+ a screenshot or a screen capture: "An image is worth a thousand words!" -->
@@ -0,0 +1,89 @@
1
+ # This workflows will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
+ name: tests
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - main
9
+ - npe2
10
+ tags:
11
+ - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
12
+ pull_request:
13
+ branches:
14
+ - main
15
+ - npe2
16
+ workflow_dispatch:
17
+
18
+ concurrency:
19
+ group: ${{ github.workflow }}-${{ github.ref }}
20
+ cancel-in-progress: true
21
+
22
+ jobs:
23
+ test:
24
+ name: ${{ matrix.platform }} py${{ matrix.python-version }}
25
+ runs-on: ${{ matrix.platform }}
26
+ timeout-minutes: 30
27
+ permissions:
28
+ id-token: write # needed for codecov OIDC authentication
29
+ strategy:
30
+ fail-fast: false
31
+ matrix:
32
+ platform: [ubuntu-latest, windows-latest, macos-latest]
33
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
34
+
35
+ steps:
36
+ - uses: actions/checkout@v6
37
+
38
+ - name: Setup python
39
+ uses: astral-sh/setup-uv@v7
40
+ with:
41
+ python-version: ${{ matrix.python-version }}
42
+ activate-environment: "true"
43
+ - name: Install Windows OpenGL
44
+ uses: pyvista/setup-headless-display-action@v4.2
45
+ with:
46
+ qt: true
47
+ wm: herbstluftwm
48
+
49
+
50
+ # note: if you need dependencies from conda, considering using
51
+ # setup-miniconda: https://github.com/conda-incubator/setup-miniconda
52
+ # and
53
+ # tox-conda: https://github.com/tox-dev/tox-conda
54
+ # this runs the platform-specific tests declared in tox.ini
55
+ - name: Test with tox
56
+ run: uvx --with tox-gh-actions tox
57
+ env:
58
+ PLATFORM: ${{ matrix.platform }}
59
+
60
+ - name: Coverage
61
+ uses: codecov/codecov-action@v5
62
+ with:
63
+ use_oidc: true # reliable tokenless codecov uploads
64
+
65
+ build-and-inspect-package:
66
+ name: Build & inspect package.
67
+ runs-on: ubuntu-latest
68
+
69
+ steps:
70
+ - uses: actions/checkout@v6
71
+ - uses: hynek/build-and-inspect-python-package@v2
72
+
73
+ deploy:
74
+ # this will run when you have tagged a commit, starting with "v*"
75
+ # and requires that you have put your twine API key in your
76
+ # github secrets (see readme for details)
77
+ needs: [test, build-and-inspect-package]
78
+ runs-on: ubuntu-latest
79
+ if: contains(github.ref, 'tags')
80
+ permissions:
81
+ id-token: write
82
+ steps:
83
+ - name: Download built artifact to dist/
84
+ uses: actions/download-artifact@v7
85
+ with:
86
+ name: Packages
87
+ path: dist
88
+ - name: Publish to PyPI
89
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,84 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # PyInstaller
28
+ # Usually these files are written by a python script from a template
29
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .coverage
41
+ .coverage.*
42
+ .cache
43
+ nosetests.xml
44
+ coverage.xml
45
+ *,cover
46
+ .hypothesis/
47
+ .napari_cache
48
+
49
+ # Translations
50
+ *.mo
51
+ *.pot
52
+
53
+ # Django stuff:
54
+ *.log
55
+ local_settings.py
56
+
57
+ # Flask instance folder
58
+ instance/
59
+
60
+ # Sphinx documentation
61
+ docs/_build/
62
+
63
+ # MkDocs documentation
64
+ /site/
65
+
66
+ # PyBuilder
67
+ target/
68
+
69
+ # Pycharm and VSCode
70
+ .idea/
71
+ venv/
72
+ .vscode/
73
+
74
+ # IPython Notebook
75
+ .ipynb_checkpoints
76
+
77
+ # pyenv
78
+ .python-version
79
+
80
+ # OS
81
+ .DS_Store
82
+
83
+ # written by setuptools_scm
84
+ **/_version.py
@@ -0,0 +1,9 @@
1
+ <!-- This file is a placeholder for customizing description of your plugin
2
+ on the napari hub if you wish. The readme file will be used by default if
3
+ you wish not to do any customization for the napari hub listing.
4
+
5
+ If you need some help writing a good description, check out our
6
+ [guide](https://github.com/chanzuckerberg/napari-hub/wiki/Writing-the-Perfect-Description-for-your-Plugin)
7
+ -->
8
+
9
+ The developer has not yet provided a napari-hub specific description.
@@ -0,0 +1,9 @@
1
+ # You may use this file to customize how your plugin page appears
2
+ # on the napari hub: https://www.napari-hub.org/
3
+ # See their wiki for details https://github.com/chanzuckerberg/napari-hub/wiki
4
+
5
+ # Please note that this file should only be used IN ADDITION to entering
6
+ # metadata fields (such as summary, description, authors, and various URLS)
7
+ # in your standard python package metadata (e.g. setup.cfg, setup.py, or
8
+ # pyproject.toml), when you would like those fields to be displayed
9
+ # differently on the hub than in the napari application.
@@ -0,0 +1,28 @@
1
+
2
+ Copyright (c) 2026, David Bauer
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ * Neither the name of copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: napari-saveas-dtype
3
+ Version: 0.0.1
4
+ Summary: Adding writer which saves images and labels with the same dtype as the original data in napari.
5
+ Author: David Bauer
6
+ Author-email: david.bauer@brc.hu
7
+ License-Expression: BSD-3-Clause
8
+ Project-URL: Bug Tracker, https://github.com/bauerdavid/napari-saveas-dtype/issues
9
+ Project-URL: Documentation, https://github.com/bauerdavid/napari-saveas-dtype#README.md
10
+ Project-URL: Source Code, https://github.com/bauerdavid/napari-saveas-dtype
11
+ Project-URL: User Support, https://github.com/bauerdavid/napari-saveas-dtype/issues
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Framework :: napari
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: numpy
28
+ Provides-Extra: all
29
+ Requires-Dist: napari[all]; extra == "all"
30
+ Dynamic: license-file
31
+
32
+ # napari-saveas-dtype
33
+
34
+ [![License BSD-3](https://img.shields.io/pypi/l/napari-saveas-dtype.svg?color=green)](https://github.com/bauerdavid/napari-saveas-dtype/raw/main/LICENSE)
35
+ [![PyPI](https://img.shields.io/pypi/v/napari-saveas-dtype.svg?color=green)](https://pypi.org/project/napari-saveas-dtype)
36
+ [![Python Version](https://img.shields.io/pypi/pyversions/napari-saveas-dtype.svg?color=green)](https://python.org)
37
+ [![tests](https://github.com/bauerdavid/napari-saveas-dtype/workflows/tests/badge.svg)](https://github.com/bauerdavid/napari-saveas-dtype/actions)
38
+ [![codecov](https://codecov.io/gh/bauerdavid/napari-saveas-dtype/branch/main/graph/badge.svg)](https://codecov.io/gh/bauerdavid/napari-saveas-dtype)
39
+ [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-saveas-dtype)](https://napari-hub.org/plugins/napari-saveas-dtype)
40
+ [![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)
41
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)
42
+
43
+ Adding writer which saves images and labels with the same dtype as the original data in napari.
44
+
45
+ ----------------------------------
46
+
47
+ This [napari] plugin was generated with [copier] using the [napari-plugin-template] (None).
48
+
49
+ <!--
50
+ Don't miss the full getting started guide to set up your new package:
51
+ https://github.com/napari/napari-plugin-template#getting-started
52
+
53
+ and review the napari docs for plugin developers:
54
+ https://napari.org/stable/plugins/index.html
55
+ -->
56
+
57
+ ## Installation
58
+
59
+ You can install `napari-saveas-dtype` via [pip]:
60
+
61
+ ```bash
62
+ pip install napari-saveas-dtype
63
+ ```
64
+
65
+ If napari is not already installed, you can install `napari-saveas-dtype` with napari and Qt via:
66
+
67
+ ```bash
68
+ pip install "napari-saveas-dtype[all]"
69
+ ```
70
+
71
+
72
+ To install latest development version:
73
+
74
+ ```bash
75
+ pip install git+https://github.com/bauerdavid/napari-saveas-dtype.git
76
+ ```
77
+
78
+
79
+
80
+ ## Contributing
81
+
82
+ Contributions are very welcome. Tests can be run with [tox], please ensure
83
+ the coverage at least stays the same before you submit a pull request.
84
+
85
+ ## License
86
+
87
+ Distributed under the terms of the [BSD-3] license,
88
+ "napari-saveas-dtype" is free and open source software
89
+
90
+ ## Issues
91
+
92
+ If you encounter any problems, please [file an issue] along with a detailed description.
93
+
94
+ [napari]: https://github.com/napari/napari
95
+ [copier]: https://copier.readthedocs.io/en/stable/
96
+ [MIT]: http://opensource.org/licenses/MIT
97
+ [BSD-3]: http://opensource.org/licenses/BSD-3-Clause
98
+ [GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
99
+ [GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
100
+ [Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
101
+ [Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
102
+ [napari-plugin-template]: https://github.com/napari/napari-plugin-template
103
+
104
+ [file an issue]: https://github.com/bauerdavid/napari-saveas-dtype/issues
105
+
106
+ [tox]: https://tox.readthedocs.io/en/latest/
107
+ [pip]: https://pypi.org/project/pip/
108
+ [PyPI]: https://pypi.org/
@@ -0,0 +1,77 @@
1
+ # napari-saveas-dtype
2
+
3
+ [![License BSD-3](https://img.shields.io/pypi/l/napari-saveas-dtype.svg?color=green)](https://github.com/bauerdavid/napari-saveas-dtype/raw/main/LICENSE)
4
+ [![PyPI](https://img.shields.io/pypi/v/napari-saveas-dtype.svg?color=green)](https://pypi.org/project/napari-saveas-dtype)
5
+ [![Python Version](https://img.shields.io/pypi/pyversions/napari-saveas-dtype.svg?color=green)](https://python.org)
6
+ [![tests](https://github.com/bauerdavid/napari-saveas-dtype/workflows/tests/badge.svg)](https://github.com/bauerdavid/napari-saveas-dtype/actions)
7
+ [![codecov](https://codecov.io/gh/bauerdavid/napari-saveas-dtype/branch/main/graph/badge.svg)](https://codecov.io/gh/bauerdavid/napari-saveas-dtype)
8
+ [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-saveas-dtype)](https://napari-hub.org/plugins/napari-saveas-dtype)
9
+ [![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)
10
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)
11
+
12
+ Adding writer which saves images and labels with the same dtype as the original data in napari.
13
+
14
+ ----------------------------------
15
+
16
+ This [napari] plugin was generated with [copier] using the [napari-plugin-template] (None).
17
+
18
+ <!--
19
+ Don't miss the full getting started guide to set up your new package:
20
+ https://github.com/napari/napari-plugin-template#getting-started
21
+
22
+ and review the napari docs for plugin developers:
23
+ https://napari.org/stable/plugins/index.html
24
+ -->
25
+
26
+ ## Installation
27
+
28
+ You can install `napari-saveas-dtype` via [pip]:
29
+
30
+ ```bash
31
+ pip install napari-saveas-dtype
32
+ ```
33
+
34
+ If napari is not already installed, you can install `napari-saveas-dtype` with napari and Qt via:
35
+
36
+ ```bash
37
+ pip install "napari-saveas-dtype[all]"
38
+ ```
39
+
40
+
41
+ To install latest development version:
42
+
43
+ ```bash
44
+ pip install git+https://github.com/bauerdavid/napari-saveas-dtype.git
45
+ ```
46
+
47
+
48
+
49
+ ## Contributing
50
+
51
+ Contributions are very welcome. Tests can be run with [tox], please ensure
52
+ the coverage at least stays the same before you submit a pull request.
53
+
54
+ ## License
55
+
56
+ Distributed under the terms of the [BSD-3] license,
57
+ "napari-saveas-dtype" is free and open source software
58
+
59
+ ## Issues
60
+
61
+ If you encounter any problems, please [file an issue] along with a detailed description.
62
+
63
+ [napari]: https://github.com/napari/napari
64
+ [copier]: https://copier.readthedocs.io/en/stable/
65
+ [MIT]: http://opensource.org/licenses/MIT
66
+ [BSD-3]: http://opensource.org/licenses/BSD-3-Clause
67
+ [GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
68
+ [GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
69
+ [Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
70
+ [Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
71
+ [napari-plugin-template]: https://github.com/napari/napari-plugin-template
72
+
73
+ [file an issue]: https://github.com/bauerdavid/napari-saveas-dtype/issues
74
+
75
+ [tox]: https://tox.readthedocs.io/en/latest/
76
+ [pip]: https://pypi.org/project/pip/
77
+ [PyPI]: https://pypi.org/
@@ -0,0 +1,105 @@
1
+ [project]
2
+ name = "napari-saveas-dtype"
3
+ dynamic = ["version"]
4
+ description = "Adding writer which saves images and labels with the same dtype as the original data in napari."
5
+ readme = "README.md"
6
+ license = "BSD-3-Clause"
7
+ license-files = ["LICENSE"]
8
+ authors = [
9
+ {name = "David Bauer"},
10
+ {email = "david.bauer@brc.hu"},
11
+ ]
12
+ classifiers = [
13
+ "Development Status :: 2 - Pre-Alpha",
14
+ "Framework :: napari",
15
+ "Intended Audience :: Developers",
16
+ "Operating System :: OS Independent",
17
+ "Programming Language :: Python",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Topic :: Scientific/Engineering :: Image Processing",
25
+ ]
26
+ requires-python = ">=3.10"
27
+ # napari can be included in dependencies if napari imports are required.
28
+ # However, you should not include napari[all], napari[qt],
29
+ # or any other Qt bindings directly (e.g. PyQt5, PySide2).
30
+ # See best practices: https://napari.org/stable/plugins/building_a_plugin/best_practices.html
31
+ dependencies = [
32
+ "numpy",
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ # Allow easily installation with the full, default napari installation
37
+ # (including Qt backend) using napari-saveas-dtype[all].
38
+ all = ["napari[all]"]
39
+
40
+ [dependency-groups]
41
+ dev = [
42
+ "tox-uv",
43
+ "pytest", # https://docs.pytest.org/en/latest/contents.html
44
+ "pytest-cov", # https://pytest-cov.readthedocs.io/en/latest/
45
+ ]
46
+
47
+ [project.entry-points."napari.manifest"]
48
+ napari-saveas-dtype = "napari_saveas_dtype:napari.yaml"
49
+
50
+ [project.urls]
51
+ "Bug Tracker" = "https://github.com/bauerdavid/napari-saveas-dtype/issues"
52
+ "Documentation" = "https://github.com/bauerdavid/napari-saveas-dtype#README.md"
53
+ "Source Code" = "https://github.com/bauerdavid/napari-saveas-dtype"
54
+ "User Support" = "https://github.com/bauerdavid/napari-saveas-dtype/issues"
55
+
56
+ [build-system]
57
+ requires = ["setuptools>=77.0.3", "setuptools_scm"]
58
+ build-backend = "setuptools.build_meta"
59
+
60
+ [tool.setuptools]
61
+ include-package-data = true
62
+
63
+ [tool.setuptools.packages.find]
64
+ where = ["src"]
65
+
66
+ [tool.setuptools.package-data]
67
+ "*" = ["*.yaml"]
68
+
69
+ [tool.setuptools_scm]
70
+ write_to = "src/napari_saveas_dtype/_version.py"
71
+ fallback_version = "0.0.1+nogit"
72
+
73
+ [tool.pytest.ini_options]
74
+ minversion = "6.0"
75
+ addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
76
+ xfail_strict = true
77
+ # filterwarnings = ["error"] # recommended by PP309; deprecation warnings cause failures so leaving for the user to enable if desired
78
+ log_cli_level = "INFO"
79
+ testpaths = ["tests"]
80
+
81
+ [tool.ruff]
82
+ line-length = 79
83
+ fix = true
84
+
85
+ [tool.ruff.format]
86
+ quote-style = "single"
87
+
88
+ [tool.ruff.lint]
89
+ select = [
90
+ "E", "F", "W", #flake8
91
+ "UP", # pyupgrade
92
+ "I", # isort
93
+ "BLE", # flake8-blind-exception
94
+ "B", # flake8-bugbear
95
+ "A", # flake8-builtins
96
+ "C4", # flake8-comprehensions
97
+ "ISC", # flake8-implicit-str-concat
98
+ "G", # flake8-logging-format
99
+ "PIE", # flake8-pie
100
+ "SIM", # flake8-simplify
101
+ ]
102
+ ignore = [
103
+ "E501", # line too long. handled by formatter
104
+ "UP006", "UP007", # type annotation. As using magicgui require runtime type annotation then we disable this.
105
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,10 @@
1
+ try:
2
+ from ._version import version as __version__
3
+ except ImportError:
4
+ __version__ = 'unknown'
5
+
6
+ from ._writer import write_single
7
+
8
+ __all__ = (
9
+ 'write_single',
10
+ )
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.0.1'
22
+ __version_tuple__ = version_tuple = (0, 0, 1)
23
+
24
+ __commit_id__ = commit_id = 'g4af04269f'
@@ -0,0 +1,56 @@
1
+ """
2
+ This module is an example of a barebones writer plugin for napari.
3
+
4
+ It implements the Writer specification.
5
+ see: https://napari.org/stable/plugins/building_a_plugin/guides.html#writers
6
+
7
+ Replace code below according to your needs.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import os
13
+ from collections.abc import Sequence
14
+ from typing import TYPE_CHECKING, Any, Union
15
+
16
+ from napari.utils.io import imsave_tiff
17
+ from napari_builtins.io import napari_write_image
18
+
19
+ if TYPE_CHECKING:
20
+ DataType = Union[Any, Sequence[Any]]
21
+ FullLayerData = tuple[DataType, dict, str]
22
+
23
+
24
+ def write_single(path: str, data: Any, meta: dict) -> list[str]:
25
+ """Writes a single image/labels layer.
26
+
27
+ Parameters
28
+ ----------
29
+ path : str
30
+ A string path indicating where to save the image/labels
31
+ return paths file.
32
+ data : The layer data
33
+ The `.data` attribute from the napari layer.
34
+ meta : dict
35
+ A dictionary containing all other attributes from the napari layer
36
+ (excluding the `.data` layer attribute).
37
+
38
+ Returns
39
+ -------
40
+ [path] : A list containing the string path to the saved file.
41
+ """
42
+ ext = os.path.splitext(path)[1]
43
+ if ext not in [".tif", ".tiff"]:
44
+ # If no file extension was specified, choose .tif by default
45
+ path += ".tif"
46
+
47
+ import numpy as np
48
+
49
+ # Get the data as a numpy array preserving the current dtype
50
+ arr = np.asarray(data)
51
+
52
+ # Save the image using tifffile, preserving the dtype
53
+ imsave_tiff(path, arr)
54
+
55
+ # return path to any file(s) that were successfully written
56
+ return [path]
@@ -0,0 +1,21 @@
1
+ name: napari-saveas-dtype
2
+ display_name: Export Image/Labels As Is
3
+ # use 'hidden' to remove plugin from napari hub search results
4
+ visibility: public
5
+ # see https://napari.org/stable/plugins/technical_references/manifest.html#fields for valid categories
6
+ # categories: []
7
+ contributions:
8
+ commands:
9
+ - id: napari-saveas-dtype.write_single
10
+ python_name: napari_saveas_dtype._writer:write_single
11
+ title: Save image/labels in original data type
12
+ writers:
13
+ - command: napari-saveas-dtype.write_single
14
+ layer_types:
15
+ - labels
16
+ filename_extensions: [.tif, .tiff]
17
+ - command: napari-saveas-dtype.write_single
18
+ layer_types:
19
+ - image
20
+ filename_extensions: [ .tif, .tiff ]
21
+
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: napari-saveas-dtype
3
+ Version: 0.0.1
4
+ Summary: Adding writer which saves images and labels with the same dtype as the original data in napari.
5
+ Author: David Bauer
6
+ Author-email: david.bauer@brc.hu
7
+ License-Expression: BSD-3-Clause
8
+ Project-URL: Bug Tracker, https://github.com/bauerdavid/napari-saveas-dtype/issues
9
+ Project-URL: Documentation, https://github.com/bauerdavid/napari-saveas-dtype#README.md
10
+ Project-URL: Source Code, https://github.com/bauerdavid/napari-saveas-dtype
11
+ Project-URL: User Support, https://github.com/bauerdavid/napari-saveas-dtype/issues
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Framework :: napari
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: numpy
28
+ Provides-Extra: all
29
+ Requires-Dist: napari[all]; extra == "all"
30
+ Dynamic: license-file
31
+
32
+ # napari-saveas-dtype
33
+
34
+ [![License BSD-3](https://img.shields.io/pypi/l/napari-saveas-dtype.svg?color=green)](https://github.com/bauerdavid/napari-saveas-dtype/raw/main/LICENSE)
35
+ [![PyPI](https://img.shields.io/pypi/v/napari-saveas-dtype.svg?color=green)](https://pypi.org/project/napari-saveas-dtype)
36
+ [![Python Version](https://img.shields.io/pypi/pyversions/napari-saveas-dtype.svg?color=green)](https://python.org)
37
+ [![tests](https://github.com/bauerdavid/napari-saveas-dtype/workflows/tests/badge.svg)](https://github.com/bauerdavid/napari-saveas-dtype/actions)
38
+ [![codecov](https://codecov.io/gh/bauerdavid/napari-saveas-dtype/branch/main/graph/badge.svg)](https://codecov.io/gh/bauerdavid/napari-saveas-dtype)
39
+ [![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-saveas-dtype)](https://napari-hub.org/plugins/napari-saveas-dtype)
40
+ [![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)
41
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)
42
+
43
+ Adding writer which saves images and labels with the same dtype as the original data in napari.
44
+
45
+ ----------------------------------
46
+
47
+ This [napari] plugin was generated with [copier] using the [napari-plugin-template] (None).
48
+
49
+ <!--
50
+ Don't miss the full getting started guide to set up your new package:
51
+ https://github.com/napari/napari-plugin-template#getting-started
52
+
53
+ and review the napari docs for plugin developers:
54
+ https://napari.org/stable/plugins/index.html
55
+ -->
56
+
57
+ ## Installation
58
+
59
+ You can install `napari-saveas-dtype` via [pip]:
60
+
61
+ ```bash
62
+ pip install napari-saveas-dtype
63
+ ```
64
+
65
+ If napari is not already installed, you can install `napari-saveas-dtype` with napari and Qt via:
66
+
67
+ ```bash
68
+ pip install "napari-saveas-dtype[all]"
69
+ ```
70
+
71
+
72
+ To install latest development version:
73
+
74
+ ```bash
75
+ pip install git+https://github.com/bauerdavid/napari-saveas-dtype.git
76
+ ```
77
+
78
+
79
+
80
+ ## Contributing
81
+
82
+ Contributions are very welcome. Tests can be run with [tox], please ensure
83
+ the coverage at least stays the same before you submit a pull request.
84
+
85
+ ## License
86
+
87
+ Distributed under the terms of the [BSD-3] license,
88
+ "napari-saveas-dtype" is free and open source software
89
+
90
+ ## Issues
91
+
92
+ If you encounter any problems, please [file an issue] along with a detailed description.
93
+
94
+ [napari]: https://github.com/napari/napari
95
+ [copier]: https://copier.readthedocs.io/en/stable/
96
+ [MIT]: http://opensource.org/licenses/MIT
97
+ [BSD-3]: http://opensource.org/licenses/BSD-3-Clause
98
+ [GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
99
+ [GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
100
+ [Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
101
+ [Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
102
+ [napari-plugin-template]: https://github.com/napari/napari-plugin-template
103
+
104
+ [file an issue]: https://github.com/bauerdavid/napari-saveas-dtype/issues
105
+
106
+ [tox]: https://tox.readthedocs.io/en/latest/
107
+ [pip]: https://pypi.org/project/pip/
108
+ [PyPI]: https://pypi.org/
@@ -0,0 +1,26 @@
1
+ .copier-answers.yml
2
+ .gitignore
3
+ LICENSE
4
+ README.md
5
+ pyproject.toml
6
+ tox.ini
7
+ .github/PULL_REQUEST_TEMPLATE.md
8
+ .github/ISSUE_TEMPLATE/bug_report.yml
9
+ .github/ISSUE_TEMPLATE/documentation.md
10
+ .github/ISSUE_TEMPLATE/feature_request.md
11
+ .github/ISSUE_TEMPLATE/task.md
12
+ .github/workflows/test_and_deploy.yml
13
+ .napari-hub/DESCRIPTION.md
14
+ .napari-hub/config.yml
15
+ src/napari_saveas_dtype/__init__.py
16
+ src/napari_saveas_dtype/_version.py
17
+ src/napari_saveas_dtype/_writer.py
18
+ src/napari_saveas_dtype/napari.yaml
19
+ src/napari_saveas_dtype.egg-info/PKG-INFO
20
+ src/napari_saveas_dtype.egg-info/SOURCES.txt
21
+ src/napari_saveas_dtype.egg-info/dependency_links.txt
22
+ src/napari_saveas_dtype.egg-info/entry_points.txt
23
+ src/napari_saveas_dtype.egg-info/requires.txt
24
+ src/napari_saveas_dtype.egg-info/top_level.txt
25
+ tests/__init__.py
26
+ tests/test_writer.py
@@ -0,0 +1,2 @@
1
+ [napari.manifest]
2
+ napari-saveas-dtype = napari_saveas_dtype:napari.yaml
@@ -0,0 +1,4 @@
1
+ numpy
2
+
3
+ [all]
4
+ napari[all]
@@ -0,0 +1 @@
1
+ napari_saveas_dtype
File without changes
@@ -0,0 +1,7 @@
1
+ # from napari_saveas_dtype import write_single, write_multiple
2
+
3
+ # add your tests here...
4
+
5
+
6
+ def test_something():
7
+ pass
@@ -0,0 +1,33 @@
1
+ # For more information about tox, see https://tox.readthedocs.io/en/latest/
2
+ [tox]
3
+ envlist = py{310,311,312,313}-{linux,macos,windows}
4
+ isolated_build=true
5
+
6
+ [gh-actions]
7
+ python =
8
+ 3.10: py310
9
+ 3.11: py311
10
+ 3.12: py312
11
+ 3.13: py313
12
+
13
+ [gh-actions:env]
14
+ PLATFORM =
15
+ ubuntu-latest: linux
16
+ macos-latest: macos
17
+ windows-latest: windows
18
+
19
+ [testenv]
20
+ platform =
21
+ macos: darwin
22
+ linux: linux
23
+ windows: win32
24
+ passenv =
25
+ CI
26
+ GITHUB_ACTIONS
27
+ DISPLAY
28
+ XAUTHORITY
29
+ NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
30
+ PYVISTA_OFF_SCREEN
31
+ dependency_groups =
32
+ dev
33
+ commands = pytest -v --color=yes --cov=napari_saveas_dtype --cov-report=xml