Skip to main content

xarray-based tools for image/video processing

Project description

📦 Welcome to ximage

Deployment PyPI Conda
Activity PyPI Downloads Conda Downloads
Python Versions Python Versions
Supported Systems Linux macOS Windows
Project Status Project Status
Build Status Tests Lint Docs
Linting Black Ruff Codespell
Code Coverage Coveralls Codecov
Code Quality Codefactor Codebeat Codacy Codescene
Code Review pyOpenSci
License License
Community Slack GitHub Discussions
Citation DOI

Slack | Docs

The ximage package is in active development. Feel free to try it out, to report issues or to suggest changes.

ℹ️ Software Overview

The software currently enables to:

  • label n-dimensional xarray objects
  • extract patches around n-dimensional labels
  • extract patches from n-dimensional xarray objects

Join the DISDRODB Slack Workspace to meet the community !

🚀 Quick Start

ximage provides an easy-to-use interface to manipulate image, videos and n-dimensional arrays with classical image processing techniques.

The ximage xarray accessor provides a convenient way to labelling and extract patches in n-dimensional arrays !

Image labelling
min_value_threshold = 1
max_value_threshold = np.inf
min_area_threshold = 5
max_area_threshold = np.inf
footprint = None
sort_by = "area"
sort_decreasing = True
label_name = "label"

### Label xarray object
xr_obj = da.ximage.label(
    min_value_threshold=min_value_threshold,
    max_value_threshold=max_value_threshold,
    min_area_threshold=min_area_threshold,
    max_area_threshold=max_area_threshold,
    footprint=footprint,
    sort_by=sort_by,
    sort_decreasing=sort_decreasing,
    label_name=label_name,
)
Extract patches around labels
# Output Options
n_patches = 10
n_labels = None
labels_id = None
highlight_label_id = False
# Patch Extraction Options
patch_size = (100, 100)
centered_on = "label_bbox"
padding = 0
n_patches_per_label = np.Inf
n_patches_per_partition = 1
# Tiling/Sliding Options
partitioning_method = None # "tiling" / "sliding"
n_partitions_per_label = None
kernel_size = None
buffer = 0
stride = None
include_last = True
ensure_slice_size = True
debug = True
verbose = True

da_patch_gen = xr_obj.ximage.label_patches(
    label_name=label_name,
    patch_size=patch_size,
    variable=variable,
    # Output Options
    n_patches=n_patches,
    n_labels=n_labels,
    labels_id=labels_id,
    highlight_label_id=highlight_label_id,
    # Patch Extraction Options
    centered_on=centered_on,
    padding=padding,
    n_patches_per_label=n_patches_per_label,
    n_patches_per_partition=n_patches_per_partition,
    # Tiling/Sliding Options
    partitioning_method=partitioning_method,
    n_partitions_per_label=n_partitions_per_label,
    kernel_size=kernel_size,
    buffer=buffer,
    stride=stride,
    include_last=include_last,
    ensure_slice_size=ensure_slice_size,
    debug=debug,
    verbose=verbose,
)

Look at the Tutorials to have an overview of the software !

🛠️ Installation

pip

ximage can be installed via pip on Linux, Mac, and Windows. On Windows you can install WinPython to get Python and pip running. Then, install the ximage package by typing the following command in the command terminal:

    pip install ximage

To install the latest development version via pip, see the [documentation][doc_install_link].

conda [NOT YET AVAILABLE]

ximage can be installed via conda on Linux, Mac, and Windows. Install the package by typing the following command in a command terminal:

    conda install ximage

In case conda-forge is not set up for your system yet, see the easy to follow instructions on conda-forge.

💭 Feedback and Contributing Guidelines

If you aim to contribute or discuss the future development of ximage, we highly suggest to join the DISDRODB Slack Workspace

Feel free to also open a GitHub Issue or a GitHub Discussion specific to your questions or ideas.

✍️ Contributors

Citation

You can cite the ximage software by:

Ghiggi Gionata & Son Pham-Ba . ghiggi/ximage. Zenodo. https://doi.org/10.5281/zenodo.8131552

If you want to cite a specific version, have a look at the Zenodo site.

📚 Requirements:

License

The content of this repository is released under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ximage-0.0.3.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

ximage-0.0.3-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file ximage-0.0.3.tar.gz.

File metadata

  • Download URL: ximage-0.0.3.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for ximage-0.0.3.tar.gz
Algorithm Hash digest
SHA256 aac64207f4216337eaf534aa1eb9e89dd38f7fc0db41e121f95b7b002e339f47
MD5 8d8b489d5e549d0ebdd85c68c062fb72
BLAKE2b-256 d4ffa0cfc916e7b6491ea96c86493702e4bcb070c18e48834d9638173fd81a6e

See more details on using hashes here.

File details

Details for the file ximage-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ximage-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for ximage-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 03b3ed988c21a94f8daedebb02d7a3eeb6ba0468ea22b53db638e4f199761f99
MD5 e637f95b4c35b00cdd2ef7621f68ebff
BLAKE2b-256 9add0a59e60bbffef74f78b93992efc32ebd103cb0b155b0e50682f10f1d0cce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page