Skip to main content

Miscellaneous image processing functions

Project description


pysto are a few miscellaneous processing python functions.

The name is a play of words on “pisto”, a Manchego dish made of tomatoes, onions, courgettes, green and red peppers and olive oil.

User instructions

Installing pysto with pip

  1. Simply run from your local environment or whole system

    pip install pysto

Installing pysto from the cloned github repository

  1. Clone the pysto repository

    git clone
  2. Activate the local environment of the other project, or you can also work without a local environment. For example, to activate a local conda environment called “myproject”

    source activate myproject
  3. Install pysto from the pysto root directory (note that if you are installing it system-wide, you may need to run the command as root)

    cd pysto
    pip install .

Uninstalling pysto

  1. Uninstall the package

    pip uninstall pysto

Developer instructions

Install pysto project for development

  1. Clone the pysto repository

    git clone
  2. Run to install development tools, create local environments for python 2.7 and 3.6, and install python dependencies. pysto depends on SimpleITK, and there are two options:

    1. Install the official SimpleITK package

      cd pysto
    2. Build and install SimpleElastix, which is an extension of SimpleITK

      cd pysto
      ./ SimpleElastix

Developing source code for pysto

  1. Activate one of the pysto local environments

    source activate pysto_3.6
  2. If you are making changes to the code, you want your python environment to import the code you are working with in ~/Software/pysto, not the package installed in your local conda environment. Thus, add the project’s source directory to PYTHONPATH

    export PYTHONPATH=~/Software/pysto:$PYTHONPATH
  3. Launch the development IDE, e.g.

  4. In your code, import the pysto modules/functions in the usual way, e.g.

    import pysto.imgproc as pymg
    imf = pymg.imfuse(im1, im2)
  5. While developing, you can run all tests (both for python 2.7 and 3.6) from the command line with

    make test
  6. You need to have a local file ~/.pypirc (replace <the password> by the password). This will be used by twine to release packages to PyPI

    index-servers =
    password=<the password>
    repository =
    password=<the password>
  7. Protect the file so that it can be read only by you

    chmod 600 ~/.pypirc

Uninstalling pysto

  1. Uninstall the package

    pip uninstall pysto

Releasing a new version of pysto to PyPI

We provide a Makefile to simplify testing and releasing.

  1. Run tests to make sure nothing obvious got broken

    make test
  2. Commit and push all the code that should go in the release to github.

  3. Update with release version, any new dependencies, the new download URL, changes to the description…

    from setuptools import setup, find_packages
        download_url = '',
        description='Miscellanea image processing functions',
        author='Ramón Casero',
        license='GPL v3',
  4. Update with the main changes to this release. For example,

    ## v1.0.0
    ### Added
    - imgproc.matchHist(): "Modify image intensities to match the
      histogram of a reference image" by
    - imgproc.imfuse(): "Composite of two images" by
    - testdata/*.png: Stereo cloud images with ROI masks (left_mask.png,
      left.png, right_mask.png, right.png) by
  5. Tag the release in github, create the package/wheel and upload to the test PyPI server

    make test-package
  6. You should be able to see your package in
  7. If everything goes well, upload to PyPI Live

    make package
  8. You should be able to see your package in

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

pysto-1.4.1.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

pysto-1.4.1-py3-none-any.whl (14.7 kB view hashes)

Uploaded Python 3

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