def METHOD_NAME(self):
    new_segments = self.viewer.state.layers['ground_truth'].segments
    if new_segments != self.selected_segments:
        self.selected_segments = new_segments
        self.viewer.defer_callback(
            self._update_synapses)