Installation
=================

*pathology-image-features* is published on PyPI.

Installing *pathology-image-features* can therefore be accomplished by running the following command
in your desired Python environment (>=3.12):

.. code-block:: bash

    pip install pathology-image-features


The primary libary used for reading large whole slide images (WSIs) in *pathology-image-features* is
`large-image` [documentation](https://girder.github.io/large_image/). The `large-image` library supports
a large amount of different image formats ("tile sources" in large-image terminology) but does not include
all of them by default. Therefore, it may be necessary to install additional tile source readers depending on
what type of images you work with. Information on adding tile sources may be found [here](https://girder.github.io/large_image/getting_started.html#installation)
but can generally be summarized in the following steps:

- You receive some error (most likely a `TileSourceError` or some subclass)
- Check if the image is able to be opened in large image:

.. code-block:: python

    import large_image

    path_to_image = '/path/to/image.extension'

    tile_source = large_image.open(path_to_image)

- Check which tile sources you currently have installed (grep in Linux/Mac, findstr in Windows):

.. code-block:: bash

    python -m pip list | grep large-image-source

- Install any missing tile source reader by consulting this [table](https://girder.github.io/large_image/formats.html)

.. code-block:: bash

    python -m pip install large-image-source-{source name}

Where source name could be one of tiff, tifffile, openslide, pil, vips, zarr, nd2, bioformats, etc.
