Fast mixture model segmentation used in Boone and Andrews labs
- Numpy
- Cython
- scikit-image
Create a virtual environment (optional)
$ virtualenv -ppython3 segmentation-env
$ source segmentation-env/bin/activateInstall python requirements (needed to build the package)
$ pip install numpy cythonInstall our library (pulls in all other dependencies)
$ pip install segmentationimport segmentation as seg
from skimage.io import imread
image = imread('./001001000.tiff', plugin='tifffile')[1] # Read channel 1 of a tiff/flex
im = seg.blur_frame(image) # gaussian blur
segmented, _ = seg.mixture_model(im, debug=True) # second return argument is currently unused
labels = seg.watershed(im, segmented)