Metadata-Version: 2.4
Name: napari-sediment
Version: 0.5.3
Summary: A plugin to process hyperspectral images of sediments
Author: Guillaume Witz
Author-email: guillaume.witz@unibe.ch
License: 
        Copyright (c) 2023, University of Bern, Data Science Lab, Guillaume Witz
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        * Redistributions of source code must retain the above copyright notice, this
          list of conditions and the following disclaimer.
        
        * Redistributions in binary form must reproduce the above copyright notice,
          this list of conditions and the following disclaimer in the documentation
          and/or other materials provided with the distribution.
        
        * Neither the name of copyright holder nor the names of its
          contributors may be used to endorse or promote products derived from
          this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Bug Tracker, https://github.com/guiwitz/napari-sediment/issues
Project-URL: Documentation, https://github.com/guiwitz/napari-sediment#README.md
Project-URL: Source Code, https://github.com/guiwitz/napari-sediment
Project-URL: User Support, https://github.com/guiwitz/napari-sediment/issues
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: napari
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<2.4.0
Requires-Dist: zarr==3.*
Requires-Dist: magicgui
Requires-Dist: qtpy
Requires-Dist: napari-guitils>0.1.0
Requires-Dist: napari-convpaint==0.6.0
Requires-Dist: torch<2.9.0
Requires-Dist: superqt
Requires-Dist: natsort
Requires-Dist: spectral
Requires-Dist: matplotlib
Requires-Dist: scikit-image
Requires-Dist: scikit-learn
Requires-Dist: PyYAML
Requires-Dist: microfilm
Requires-Dist: dask
Requires-Dist: distributed
Requires-Dist: tqdm
Requires-Dist: cmap
Requires-Dist: colour-science
Provides-Extra: testing
Requires-Dist: tox; extra == "testing"
Requires-Dist: pytest; extra == "testing"
Requires-Dist: pytest-cov; extra == "testing"
Requires-Dist: pytest-qt; extra == "testing"
Requires-Dist: napari; extra == "testing"
Requires-Dist: pyqt5; extra == "testing"
Provides-Extra: classifier
Requires-Dist: torch; extra == "classifier"
Requires-Dist: torchvision; extra == "classifier"
Dynamic: license-file

# napari-sediment

[![License BSD-3](https://img.shields.io/pypi/l/napari-sediment.svg?color=green)](https://github.com/guiwitz/napari-sediment/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-sediment.svg?color=green)](https://pypi.org/project/napari-sediment)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-sediment.svg?color=green)](https://python.org)
[![tests](https://github.com/guiwitz/napari-sediment/workflows/tests/badge.svg)](https://github.com/guiwitz/napari-sediment/actions)
[![codecov](https://codecov.io/gh/guiwitz/napari-sediment/branch/main/graph/badge.svg)](https://codecov.io/gh/guiwitz/napari-sediment)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-sediment)](https://napari-hub.org/plugins/napari-sediment)

This napari plugin is designed to hyper-spectral images of sediment cores. It is composed of three interfaces allowing the user to:

- import HDR images
- normalize the images using white and dark references
- mask unwanted regions
- perform spectral dimensionality reduction via minimum noise fraction analysis
- perform spatial dimensionality reduction based on pixel purity indices
- identify representative end-members by clustering pure pixels
- select relevant regions in spectra to compute absorption indices and create absorption maps 

### Pre-processing: Sediment widget

The sediment widget allows the user to import an HDR image and to normalize it using white and dark references. The widget also allows the user to mask unwanted regions of the images.

## Documentation

You can find a detailed documentation [here](https://guiwitz.github.io/napari-sediment).
## Installation

Create a conda environment and activate it. If you don't have conda installed you can for example install [miniforge](https://github.com/conda-forge/miniforge?tab=readme-ov-file#install).

    conda create -n sediment python=3.12 napari pyqt -c conda-forge
    conda activate sediment

Then you can install `napari-sediment` use:

    pip install napari-sediment

Or you can install the latest development version directly from the GitHub repository:

    pip install git+https://github.com/guiwitz/napari-sediment.git

On Windows, there is sometimes an issue installing PyTorch (needed for pixel classification) leading to an error about loading a dependency (typically fbgemm.dll). In that case we recommend the following:

    conda create -n sediment python=3.12 napari pyqt -c conda-forge
    conda activate sediment
    pip install napari-sediment
    pip uninstall torch
    conda install -c conda-forge pytorch llvm-openmp


## Contributing

Contributions are very welcome. Tests can be run with [tox], please ensure
the coverage at least stays the same before you submit a pull request.

## License

Distributed under the terms of the [BSD-3] license,
"napari-sediment" is free and open source software

## Authors

This plugin has been developed by Guillaume Witz at the Data Science Lab of the University of Bern in collaboration with Petra Zahajská, Institue of Geography of the University of Bern. Funding for development was provided by Prof. Martin Grosjean, Institute of Geography of the University of Bern.

## Issues

If you encounter any problems, please [file an issue] along with a detailed description.

[napari]: https://github.com/napari/napari
[Cookiecutter]: https://github.com/audreyr/cookiecutter
[@napari]: https://github.com/napari
[MIT]: http://opensource.org/licenses/MIT
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin

[file an issue]: https://github.com/guiwitz/napari-sediment/issues

[napari]: https://github.com/napari/napari
[tox]: https://tox.readthedocs.io/en/latest/
[pip]: https://pypi.org/project/pip/
[PyPI]: https://pypi.org/
