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.0.tar.gz
(17.1 kB
view details)
Built Distribution
misic-1.1.0-py3-none-any.whl
(7.3 MB
view details)
File details
Details for the file misic-1.1.0.tar.gz
.
File metadata
- Download URL: misic-1.1.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.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 | 18e3457b765e39670579d5a400b2c7442377a262fb7928aa8218f7aeec9857a4 |
|
MD5 | 0279524d2c969971a0b1004aeab6c358 |
|
BLAKE2b-256 | cc5c29edfe9903751296fb29ed26773887a2354cd741d165719ab35c555f2b56 |
File details
Details for the file misic-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: misic-1.1.0-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/3.10.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 | a4c372040789940eaafb0d0aa8e88f87d0a8db4f7f595b1183ff1188d8bb3185 |
|
MD5 | a5d4cae38bf7d6340ba136d0041bad29 |
|
BLAKE2b-256 | 7533fbfe0646d07fc8fbb98fa9b8b7d3d2e3c6e87d37130ec5cd19d99689efbd |