def test_cube(self): d = core.Data(label='cube', x=np.zeros((2, 2, 2))) dc = core.DataCollection([d]) app = GlueApplication(dc) w = app.new_data_viewer(ImageWidget, d) w.slice = ('x', 'y', 1) assert w.slice == ('x', 'y', 1) c = self.check_clone(app) w2 = c.viewers[0][0] assert w2.ui.slice.slice == w.slice
def setup_method(self, method): LinkSame = core.link_helpers.LinkSame d = core.Data(label='im', x=[[1, 2], [2, 3]], y=[[2, 3], [4, 5]]) d2 = core.Data(label='cat', x=[0, 1, 0, 1], y=[0, 0, 1, 1], z=[1, 2, 3, 4]) dc = core.DataCollection([d, d2]) dc.add_link(LinkSame(d.get_pixel_component_id(0), d2.id['x'])) dc.add_link(LinkSame(d.get_pixel_component_id(1), d2.id['y'])) app = GlueApplication(dc) w = app.new_data_viewer(ImageWidget, data=d) self.d = d self.app = app self.w = w self.d2 = d2 self.dc = dc