4Quant / LungStageAnnotator

The documentation and support for the LungStageAnnotator tool
http://4quant.com/LungStageAnnotator
2 stars 0 forks source link

Segment names are incorrect if renamed #94

Closed kmader closed 7 years ago

kmader commented 7 years ago

If you create a new segment and then rename it, the only one retained is the original name

image

The annotator fields also show the problem with

>>> LSA_settings.get_label_ids()
['Segment_0', 'Segment_1']
kmader commented 7 years ago

Added a new function to get the current name rather than the id, we now keep track of both

    def get_label_names(self):
        # type: () -> List[str]
        """
        Get the label names instead of the ids (since they don't always match
        We order by the IDs though
        :return:
        """
        all_ids = self.get_label_ids()
        seg_data = self.get_seg_node().GetSegmentation()
        return [seg_data.GetSegment(cur_id).GetName() for cur_id in all_ids]