def create_stack_window(self, stack: Images, position: Qt.DockWidgetArea = Qt.DockWidgetArea. RightDockWidgetArea, floating: bool = False) -> StackVisualiserView: stack.make_name_unique(self.stack_names) stack_vis = StackVisualiserView(self, stack) # this puts the new stack window into the centre of the window self.splitter.addWidget(stack_vis) self.setCentralWidget(self.splitter) # add the dock widget into the main window self.addDockWidget(position, stack_vis) stack_vis.setFloating(floating) self.presenter.add_stack_to_dictionary(stack_vis) return stack_vis
def test_name_unique_exists(self): existing = ["tomo"] imgs = Images(np.asarray([1]), name="tomo") imgs.make_name_unique(existing) self.assertEqual(imgs.name, "tomo_2")