Skip to main content

A library for image processing functions.

Project description

oct_analysis

oct_analysis is a Python library for the processing of image data for optical methods (foremost optical coherence tomography (OCT)).

Installation

pip install oct_analysis

Features

The oct_analysis python package includes various functions for:

  • Unpacking *.oct files and loading tiff files as numpy array
  • Preprocessing functions to identify and remove objects/boundaries
  • Image segmentation and binarization
  • Post-processing funtions for the calcuation and saving of structural parameters from the imaging stacks

Usage

The documentation can be found in https://oct-analysis.readthedocs.io/en/latest/index.html

Examples for the usage of the functions are described in https://github.com/AndreasNetsch/oct_analysis/tree/main/examples

from oct_analysis import (
    read_tiff,
    select_tiff_folder,
    convert_to_8bit,
    find_substratum,
    voxel_count,
    find_max_zero,
    untilt,
    generate_Height_Map
)

Collaboration and Development

Setup

  1. Clone the repository:
git clone https://github.com/AndreasNetsch/oct_analysis.git
cd oct_analysis
  1. Create a virtual environment and install development dependencies:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e ".[dev]"

Testing

Run tests with pytest:

pytest

Code Formatting and Linting

This project uses pre-commit hooks to ensure code quality. After installing the development dependencies, set up the pre-commit hooks:

pre-commit install

This will automatically format your code with Black and check it with Flake8 before each commit. You can also run the hooks manually:

pre-commit run --all-files

Building the package

python -m build

Documentation

This project uses Sphinx for documentation. To build the documentation locally:

cd docs
make html

The generated documentation will be available in docs/build/html/index.html.

ReadTheDocs Integration

The documentation is also configured to be built automatically on ReadTheDocs. To set it up:

  1. Push your code to GitHub
  2. Sign up for a ReadTheDocs account
  3. Import your repository on ReadTheDocs
  4. ReadTheDocs will automatically build and host the documentation

You can customize the build process by modifying .readthedocs.yml and the Sphinx configuration files in the docs directory.

CI/CD

This project uses GitHub Actions for:

  • Running tests on multiple Python versions
  • Linting the code
  • Building and publishing the package to PyPI when a new version tag is pushed

Creating Releases

The CI/CD pipeline is configured to automatically build and publish the package to PyPI when a new version tag is pushed to the repository. This process ensures that only properly versioned, tagged releases get published.

To create and publish a new release:

  1. Update the version number in setup.py
  2. Commit your changes:
    git add setup.py
    git commit -m "Bump version to x.y.z"
    
  3. Create a new version tag (tag name must start with "v"):
    git tag vx.y.z
    
  4. Push the tag to GitHub:
    git push origin vx.y.z
    

Once the tag is pushed, GitHub Actions will:

  1. Run all tests on multiple Python versions
  2. If tests pass, build the package
  3. Publish the package to PyPI using the configured PyPI API token

Note: Make sure you've added a PYPI_API_TOKEN secret to your GitHub repository settings under "Settings > Secrets and Variables > Actions" before triggering a release.

License

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

oct_analysis-1.0.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oct_analysis-1.0.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file oct_analysis-1.0.1.tar.gz.

File metadata

  • Download URL: oct_analysis-1.0.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for oct_analysis-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4103cb597d29ef530b61bfeab335ab66bd39a4e3e47dcd44df5c6fa842bd4ae2
MD5 f5d84f4374ca345907def4027f588c2d
BLAKE2b-256 1695e0cd5e97463cd2b87cfac63ff4fdafcea9481fb6385995f26247c2308bb2

See more details on using hashes here.

File details

Details for the file oct_analysis-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: oct_analysis-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for oct_analysis-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c167911a9071680b34b6490f3e3457ad5ff18e273e14bd5fada4b1cbc0925d0
MD5 ce65a7aca21c7916fa51ceec7e4e8b1f
BLAKE2b-256 9bd733b96140c1853f936db76454d38c5ba81d2f15ec314e54f28127d01b5a27

See more details on using hashes here.

Supported by

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