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
- Download Anaconda https://docs.anaconda.com/anaconda/install/
- Open an anaconda prompt
- create a new environment (tested in Python 3.8)
conda create --name nanoimaging python=3.8 anaconda tifffile
- Activate
conda activate nanoimaging
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nanoimagingpack-2.1.3.dev1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | adaed1a3bb200beb4ebfbe4ef900a4c6c495731c5978bb996f89162616fbbb89 |
|
MD5 | 201914a66046b1ec75af69f568cd589d |
|
BLAKE2b-256 | 40aca678f0059796e8d1ce8398657b09ab77707497565bc2629baec7d0928477 |
Close
Hashes for NanoImagingPack-2.1.3.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81ef6c7fb409069be7c01b5d4f128b8d52c238077d4b772647c5528d4eed9378 |
|
MD5 | 14e68b1939162415f150199c63afd600 |
|
BLAKE2b-256 | 089fedfc52fbbeb689fe97c482097a98becb2ce9cbd0fb1c6d642d7db1dc151d |