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:

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"%(
                                     title = self.parent_name.value)
                                     title = self.sub_object_name.value,
                                     sharex = figure.subplot(0,0),
                                     sharey = figure.subplot(0,0))
                                     "%s labeled by %s"%
                                     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.