Fast mixture model segmentation used in Boone and Andrews labs
- Numpy
- Cython
- scikit-image
- Boost
Install C dependencies (ubuntu):
$ sudo apt install libboost-devCreate 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 segmentationRead the image.
read_channel takes an optional argument channel= that can be used to specifiy which channel to read. "red" (default) is preset to begin with the second frame, "green" is first frame. The argument can also be an integer, that can be used to manually specifiy at which frame should we start reading.
import segmentation as seg
tiff = seg.read_channel('./001001000.tiff', channel="red") # channel red == read every other frame, start from frame 2
im = seg.blur_frame(tiff[0]) # gaussian blur
labels, _ = seg.mixture_model(im) # second return argument is currently unused