Microbe segmentation in dense colonies
Project description
MiSiC
Microbe segmentation in dense colonies.
Installation
Requires version python version 3.6/7
pip install misic
Usage
use package
from misic.misic import *
from skimage.io import imsave,imread
from skimage.transform import resize,rescale
filename = 'awesome_image.tif'
# read image using your favorite package
im = imread(filename)
# Parameters that need to be changed
## Ideally, use a single image to fine tune two parameters : mean_width and noise_variance (optional)
#input the approximate mean width of microbe under consideration
mean_width = 8
# compute scaling factor
scale = (10/mean_width)
# Initialize MiSiC
mseg = MiSiC()
# preprocess using inbuit function or if you are feeling lucky use your own preprocessing
im = rescale(im,scale,preserve_range = True)
# add local noise
img = add_noise(im,sensitivity = 0.13,invert = True)
# segment
yp = mseg.segment(img,invert = True)
yp = resize(yp,[sr,sc,-1])
# watershed based post processing
yp = postprocess_ws(img,yp)
# save 8-bit segmented image and use it as you like
imsave('segmented.tif', yp.astype(np.uint8))
''''
### In case of gpu error, one might need to disabple gpu before importing MiSiC [ os.environ["CUDA_VISIBLE_DEVICES"]="-1" ]
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
misic-1.1.2.tar.gz
(17.1 kB
view details)
Built Distribution
misic-1.1.2-py3-none-any.whl
(7.3 MB
view details)
File details
Details for the file misic-1.1.2.tar.gz
.
File metadata
- Download URL: misic-1.1.2.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1006cce4ff979cd29ffebd7c8c19b529c72d20706db44d7091262540bb8e9b32 |
|
MD5 | a96b05be439b814035a50993c5654450 |
|
BLAKE2b-256 | 868c773b5f843c4912c52b8e85fbd9fa5bc2a80e81be701e36253edd2bee6920 |
File details
Details for the file misic-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: misic-1.1.2-py3-none-any.whl
- Upload date:
- Size: 7.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dd53430f37dfad8b72db72213f7152ffb66ccbb5b1f954210e310c566b0cade |
|
MD5 | 37e737f47cfd56cb87a8d65fced6efcb |
|
BLAKE2b-256 | 4ae2110096760297b525e2c3be5c6afbd582163476aa5316b46768aa5c9ebf56 |