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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nanoimagingpack-2.1.5.tar.gz.
File metadata
- Download URL: nanoimagingpack-2.1.5.tar.gz
- Upload date:
- Size: 5.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6857ff5c037418de9703b4b9908c7bfe9770f5b8e47ac51fa5fc63553ee751b7
|
|
| MD5 |
ac1ab19cdbdde5d497f9532eb5786eb9
|
|
| BLAKE2b-256 |
28214ff6f22688995e3a7acf5685e370edb202fd267c28ce4cc6f12acbb06e33
|
File details
Details for the file nanoimagingpack-2.1.5-py3-none-any.whl.
File metadata
- Download URL: nanoimagingpack-2.1.5-py3-none-any.whl
- Upload date:
- Size: 5.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f96c19673634ecb7918d674831162e10a10538411a40a1a2bdbbd397708ec7a6
|
|
| MD5 |
e8152815b4c03913184d064b79ff26f9
|
|
| BLAKE2b-256 |
84add16654c93133989dd156d7a5d5d5b88d52b7912ac8c09973242c7e7f58f6
|