Skip to content

Instantly share code, notes, and snippets.

@bennihepp
bennihepp / script.py
Created January 20, 2012 09:41 — forked from thouis/script.py
Example script for CellProfiler RunScript module
import cpscript
from scipy import ndimage
# either ask explicitely for an object
labels = cpscript.objects['Cells'].segmented
# or ask the user to choose one
# cpscript.objects.input_objects.require('The objects from which to measure the distance')
#labels = cpscript.objects.input_objects.segmented
background_labels = np.array(labels == 0, dtype=int)