Skip to main content

junkie_picasso adds abstract functionality to the junkie JUpyter NotebooK Image Explorer

Project description

Logo

GPLv3 License Static Badge

JuNkIE-picasso: abstract functionality for Junkie

JuNkIE-picasso adds onto the functionality of JuNkIE, allowing you to not just explore your images, but also the parameter space of your image processing pipeline.

Installing JuNkIE-picasso

To install JuNkIE-picasso, type:

$ python3 -m pip install junkie_picasso

We do most of the development and testing of JuNkIE-picasso in Jupyter Lab, so we recommend using Jupyter Lab.

A note on the Python interpreter

JuNkIE-picasso requires that you have Python 3.10 or above installed.

Using JuNkIE

For details on how to use the basic functionality of JuNkIE, visit the JuNkIE docs.

Adding abstract functions

JuNkIE-picasso allows the user to define abstract image processing functions that will be applied to the input image. This allows you to explore the parameter space of your image processing pipeline without re-writing and re-running your code!

New in version 2024.8.6! Create abstract functions using a simple function definition without the need for an entire class!

Define your image processing function. There are a few rules that it must follow:

  • The first argument must be a positional argument that takes the image numpy array
  • All following arguments must be keyword arguments and contain both type hints and defaults
  • The types of the keyword arguments can be float, int, or bool
  • The function must return the processed image as a numpy array with dtype np.uint16

For example, lets say we wanted to apply a gaussian filter and offset to our image, and have an easy way to turn processing on and off:

def gaussian_and_offset(img, offset: int = 0, sigma: float = .0, apply_flag: bool = False):
  
  if apply_flag:
    for t in range(len(img)):
      img[t] = skimage.filters.gaussian(img[t], sigma, preserve_range=True) + offset
          
  return img.astype(np.uint16)

Finally, create a JuNkIE-picasso instance using your custom class as an additional parameter:

ayim = junkie('/path/to/img.tiff', func=gaussian_and_offset)

The parameters you have defined will appear to the right of the default JuNkIE parameters in a tabbed box, with each tab corresponding to a different parameter. This allows for an arbitrary number of parameters to be added without reorganizing the widget layout.

Making a custom pipeline

Citing JuNkIE-picasso

If you use JuNkIE-picasso, please cite this repository and the repository for the original JuNkIE. We are working on the paper!

Sponsors

We are grateful for the generous support from the following agencies and institutions, which contribute to the development and maintenance of JuNkIE and JuNkIE-picasso:

Sponsors

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

junkie_picasso-2024.8.6.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

junkie_picasso-2024.8.6-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file junkie_picasso-2024.8.6.tar.gz.

File metadata

  • Download URL: junkie_picasso-2024.8.6.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for junkie_picasso-2024.8.6.tar.gz
Algorithm Hash digest
SHA256 a60f6e79c6fd0db6dee36088b506b85f44c2c360da6dcb93ce23ef747d335bae
MD5 b5e1f40c5196e18a25a89c61da215a70
BLAKE2b-256 907c6097cce5fbb0aee0b61bac3b02bbdec1ff5f4814aec6cc1db63ed3120275

See more details on using hashes here.

File details

Details for the file junkie_picasso-2024.8.6-py3-none-any.whl.

File metadata

File hashes

Hashes for junkie_picasso-2024.8.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4046ce2bc0e47ae6af0024663748aa403b928ed2e530b6d91aa7759d3b017caf
MD5 2621df76f27c3687b3ea79200c07c5e6
BLAKE2b-256 dfb4c7d8cf803b86fa60d103600a1f455a4dae162af45428ec93bf6408c2bd78

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