Skip to content

Tables not creating again after deleting them #7

Description

@ilVecc

I am testing a script that performs several registrations and calculates the similarity coefficients for each of them.
To do so, before each registration I clear the scene using slicer.mrmlScene.Clear(0), and here the issue arises: the similarity coefficients are calculated only for the first run and, after the clean-up, never again.

Reading the source of the module, I see that in the calculateSegmentSimilarity function, only the self.segmentComparisonNode node has a check of its current presence in the scene. This check is not performed for the self.diceTableNode node


nor for the self.hausdorffTableNode node

which means that, after the clean-up, the module still thinks that those tables are in the scene but, after having calculated the coefficients, finds no table in which storing them.

This can be easily fixed by adding the same check on those two nodes:
if self.diceTableNode is None or self.hausdorffTableNode.GetScene() is None:
and
if self.hausdorffTableNode is None or self.hausdorffTableNode.GetScene() is None:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions