Skip to content

Commit

Permalink
Merge branch 'master' of github.com:CellProfiler/CellProfiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Kamentsky committed Oct 1, 2012
2 parents e1be53a + e46aa4e commit e9bb22d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions cellprofiler/modules/reassignobjectnumbers.py
Expand Up @@ -327,14 +327,22 @@ def display(self, workspace):
workspace.measurements.image_set_number),subplots=(1,2)) workspace.measurements.image_set_number),subplots=(1,2))
figure.subplot_imshow_labels(0,0, workspace.display_data.orig_labels, figure.subplot_imshow_labels(0,0, workspace.display_data.orig_labels,
title = self.objects_name.value) title = self.objects_name.value)
if self.wants_image:
# output_labels = renumber_labels_for_display(
# Make a nice picture which superimposes the labels on the
# guiding image
#
output_labels = renumber_labels_for_display(
workspace.display_data.output_labels) workspace.display_data.output_labels)
image = (stretch(workspace.display_data.image) * 255).astype(np.uint8) if self.relabel_option == OPTION_UNIFY:
if self.unify_option == UNIFY_DISTANCE and self.wants_image:
#
# Make a nice picture which superimposes the labels on the
# guiding image
#
image = (stretch(workspace.display_data.image) * 255).astype(np.uint8)
elif self.unify_option == UNIFY_PARENT:
parent_objects = workspace.object_set.get_objects(self.parent_object.value)
labels = parent_objects.segmented
image = labels.astype(float) / (1.0 if np.max(labels) == 0 else np.max(labels))
image = (stretch(image) * 255).astype(np.uint8)

image = np.dstack((image,image,image)) image = np.dstack((image,image,image))
my_cm = cm.get_cmap(cpprefs.get_default_colormap()) my_cm = cm.get_cmap(cpprefs.get_default_colormap())
my_cm.set_bad((0,0,0)) my_cm.set_bad((0,0,0))
Expand All @@ -345,6 +353,7 @@ def display(self, workspace):
image[output_labels > 0 ] = ( image[output_labels > 0 ] = (
image[output_labels > 0] / 4 * 3 + image[output_labels > 0] / 4 * 3 +
output_image[output_labels > 0,:] / 4) output_image[output_labels > 0,:] / 4)

figure.subplot_imshow(0,1, image, figure.subplot_imshow(0,1, image,
title = self.output_objects_name.value, title = self.output_objects_name.value,
sharex = figure.subplot(0,0), sharex = figure.subplot(0,0),
Expand Down

0 comments on commit e9bb22d

Please sign in to comment.