I have a case where I have several segmentations and I need to test each of them in no window mode (test mode)
The normal way to do this is to disable all of them and the enable just the one I am testing, this is done with
displayNode = segmentationNode.GetDisplayNode()
if displayNode is not None:
displayNode.SetVisibility(1)
However without the qSlicerMainWindow the above code never gets executed as there are no display nodes in the first place. So the question is how to enable/disable the segmentation node without using the display nodes?
The problem is that when the segmentation is called by SegmenationStatistic module it is never enabled and it treats it as it were no segmentation at all.
This is related with the failing tests here