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.1.tar.gz
(17.1 kB
view details)
Built Distribution
misic-1.1.1-py3-none-any.whl
(7.3 MB
view details)
File details
Details for the file misic-1.1.1.tar.gz
.
File metadata
- Download URL: misic-1.1.1.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.0 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 | 19d3ceb5da22a7fbf067fc08fed31645bed7a7dd4932eaddbe5072c690a038b8 |
|
MD5 | 283659510bc177fbc41cfc25f78c42da |
|
BLAKE2b-256 | 3212319acbcd7fa0cbf629c409435b578d0cdacb02d303eff18165f1a4aeb034 |
File details
Details for the file misic-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: misic-1.1.1-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.0 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 | 2b6f3b964771ed85ae947d1120801db2bb3d310721ad5367d2a220ab026718e3 |
|
MD5 | 58b3c4f5692761d56744df6fb7ca4fb5 |
|
BLAKE2b-256 | 6496b1b49196c81db9ccf4f6665d9cc0d03a74ce3d2930c975ab3029d3de412e |