RelatedObjects does not commit relations to child objects

The RelateObjects module does not replace the original labels with the new ones, which results in unexpected behavior if a later FilterObjects module is run with the parent and child objects (namely, that the wrong child objects are being filtered).

Assuming there is no need to keep the non-related child objects, the code at the end of the module’s run subroutine should be replaced as follows:

[code]
parent_labeled_children = np.zeros(children.segmented.shape, int)
parent_labeled_children[children.segmented > 0] =
parents_of[children.segmented[children.segmented > 0]-1]

    if workspace.frame is not None:
        figure = workspace.create_or_find_figure(title="RelateObjects, image cycle #%d"%(
            workspace.measurements.image_set_number),subplots=(2,2))
        figure.subplot_imshow_labels(0,0,parents.segmented,
                                     title = self.parent_name.value)
        figure.subplot_imshow_labels(1,0,children.segmented,
                                     title = self.sub_object_name.value,
                                     sharex = figure.subplot(0,0),
                                     sharey = figure.subplot(0,0))
        figure.subplot_imshow_labels(0,1,children.segmented,
                                     "%s labeled by %s"%
                                     (self.sub_object_name.value,
                                      self.parent_name.value),
                                     sharex = figure.subplot(0,0),
                                     sharey = figure.subplot(0,0))
        
    children.segmented = parent_labeled_children[/code]

Thanks for the report. I agree that we should store the result of Relate, but probably in a new Object, rather than replacing the existing one. That, or ask the user whether they would like to replace the child Object with the result from Relate.