Skip to main content

An image processing package meant for use in the optics and microscopy community

Project description

NanoImagingPack

This is a package for simple image processing. It is oriented on the DIP-Image package, which is available for Matlab. The goal is to keep things simple and make it available for a broad community.

Installation

  1. Download Anaconda https://docs.anaconda.com/anaconda/install/
  2. Open an anaconda prompt
  3. create a new environment (tested in Python 3.8)
    conda create --name nanoimaging python=3.8 anaconda tifffile
    
  4. Activate
    conda activate nanoimaging
    
  5. Install this feature branch of NanoImagingPack
    pip install git+https://gitlab.com/bionanoimaging/nanoimagingpack
    

Getting started

Start an ipython shell

ipython

Load and view a sample image

import NanoImagingPack as nip
import napari

img = nip.readim("erika")
nip.vv(img)

The created image is of type "image"

Gain calibration from an inhomogenous stack

Perform a gain calibration using simulated data.

import NanoImagingPack as nip
import numpy as np

# define the input parameters
NPHOT = 100 # max number of photons in simulation
OFFSET = 100 # black level offset
READNOISE = 4 # read noise to simulate
STACK_SIZE = 30

img = nip.readim("MITO_SIM")[0] # load the first frame from the MITO_SIM sample

fg = np.tile(img,(STACK_SIZE,1,1)) # make a stack of frames
fg = nip.poisson(fg, NPhot=NPHOT) # simulate poissonian shot noise

fg = fg + np.random.normal(loc=OFFSET, scale=READNOISE, size=fg.shape) # add gaussian noise

bg = np.random.normal(loc=OFFSET, scale=READNOISE, size=fg.shape) # generate background stack

# perform a calibration and plot the results
nip.cal_readnoise(fg, bg, brightness_blurring=False)

Notes

  • the command nip.lookfor('some string') allows you to search for functions and methods
  • nip.view() or nip.vv() provides an image viewer
    • The default viewer is currently Napari, but this can be changed by nip.setDefault('IMG_VIEWER',myViewer) with myViewer being one of 'NIP_VIEW', 'VIEW5D','NAPARI','INFO'
    • in NIP_VIEW press 'h' to get help. In VIEW5d press "?"
  • graph() provides a simple viewer for 2D graphs -> you can add lists for multiple graphs

Features

  • multidimensional fft/ifft
  • image alignment
  • finding for SLM based SIM images
  • Controlling Hamamatsu LCOS SLM
  • Creating OTFs, PSFs etc.
  • Image manipulation (convolution, (simple) EdgeDamping, extracting, concattenating, Fourier-space extractions and padding)
  • helper functions such as ramps, xx, yy, zz, freq/realspace coord transforms

See "dependencies.txt" for help required dependencies

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

nanoimagingpack-2.1.4.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

NanoImagingPack-2.1.4-py3-none-any.whl (5.1 MB view details)

Uploaded Python 3

File details

Details for the file nanoimagingpack-2.1.4.tar.gz.

File metadata

  • Download URL: nanoimagingpack-2.1.4.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for nanoimagingpack-2.1.4.tar.gz
Algorithm Hash digest
SHA256 d900b04f87c8ef0bcf97abb8a522d8d8519179ac08e9efbb308f85d0d11568a4
MD5 eecc384d8cd32b3f4f3ed1b2d5c0ce3c
BLAKE2b-256 08ea4480934f132eae8305ee6ce0a0097b4ae0972004a02c710a577c5971c2ce

See more details on using hashes here.

File details

Details for the file NanoImagingPack-2.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for NanoImagingPack-2.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 40f802aaf0cca92682e1a43bd0831305a2b88be0d996f5d885e7a7fe6de54a06
MD5 e0e2eea4e98ad8218fb4c623021ed2ba
BLAKE2b-256 1313a83fd3cae06d9071f8494b5869fbe922155020d0301eb4dda6fff73da9b5

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