MiSiC
Microbe segmentation in dense colonies.
Installation
Requires version python version 3.6/7
pip install misic
MiSiC as napari plugin
A napari plugin is up and running at the moment with a few glitches!
Here are the steps for installation:
- You can download napari at the bottom of the page at https://github.com/napari/napari/releases
- After you install napari, in the plugins tab > Install plugin > misic-napari
- Restart napari
- Drag and drop an image
- Go to segment More information is at https://pypi.org/project/misic-napari/
The plugin is still underdevelopment so there might be a few bugs that will be incrementally updated.
Possible errors during installtion
tensorflow dependecies may not be installed if pyparsing error pip install pyparsing if protobuf error conda install protobuf
Usage
use package
from misic.misic import *
from misic.extras 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)
sr,sc = im.shape
# 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
standard_width = 9.7
# the approximate width of cells to be segmented
mean_width = 9.7
# If image is phase contrast light_background = True
light_background = True
# compute scaling factor
scale = (standard_width/mean_width)
# Initialize MiSiC
mseg = MiSiC()
# preprocess using inbuit function or if you are feeling lucky use your own preprocessing
# recomended preprcessing
# im = adjust_gamma(im,0.25)
# im = unsharp_mask(im,2.2,0.6)
# for fluorescence images
# im = gaussian(laplace(im),2.2)
# im = add_noise(im,0.1)
# OR
# im = random_noise(im,mode = 'gaussian',var = 0.1/100.0)
im = rescale(im,scale,preserve_range = True)
# add local noise
img = add_noise(im,sensitivity = 0.13,invert = light_background)
# segment
yp = mseg.segment(img,invert = light_background)
yp = resize(yp,(sr,sc))
# watershed based post processing (optional)
# yp = postprocess_ws(img,yp)
yp = postprocessing(im if light_background else -im,yp)[:,:,0]
# save 8-bit segmented image and use it as you like
imsave('segmented.tif', ((yp > 0)*255).astype(np.uint8))
''''
### In case of gpu error, one might need to disabple gpu before importing MiSiC [ os.environ["CUDA_VISIBLE_DEVICES"]="-1" ]
Metadata
Release files for misic 1.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| misic-1.1.5.tar.gz | 6.8 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| misic-1.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 MB
Release files / misic-1.1.5.tar.gz
| Download URL | misic-1.1.5.tar.gz |
|---|---|
| Size | 6.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa14247bc3089bbdb700f1148836fb8f7d5a66fd0d1cd828a5eccae329fa0a69
|
|
BLAKE2b-256 checksum How to use checksums |
3940ab5474530e5f93791919ac9b07bb987bc5cf44f4280c4a284d3e4139feac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
|
Release files / misic-1.1.5-py3-none-any.whl
| Download URL | misic-1.1.5-py3-none-any.whl |
|---|---|
| Size | 6.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15998664bac2c320b423c29443169a69ba7e203082867889f8ee90f3ce45c73a
|
|
BLAKE2b-256 checksum How to use checksums |
119732d66925fc7020c7223ced30f951def094394dd96f646f2b06886eff3971
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
|
Security for misic 1.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.