Пример #1
0
    def view_subimg(self, offset, shape):
        """Zoom all Plot Editors to the given sub-image.

        Args:
            offset: Sub-image coordinates in ``z,y,x`` order.
            shape: Sub-image shape in ``z,y,x`` order.
        
        """
        for i, plane in enumerate(config.PLANE):
            offset_tr = libmag.transpose_1d(list(offset), plane)
            shape_tr = libmag.transpose_1d(list(shape), plane)
            self.plot_eds[plane].view_subimg(offset_tr[1:], shape_tr[1:])
        self.fig.canvas.draw_idle()
Пример #2
0
 def update_coords(self, coord, plane_src=config.PLANE[0]):
     """Update all plot editors with given coordinates.
     
     Args:
         coord: Coordinate at which to center images, in z,y,x order.
         plane_src: One of :const:`magmap.config.PLANE` to specify the 
             orientation from which the coordinates were given; defaults 
             to the first element of :const:`magmap.config.PLANE`.
     """
     coord_rev = libmag.transpose_1d_rev(list(coord), plane_src)
     for i, plane in enumerate(config.PLANE):
         coord_transposed = libmag.transpose_1d(list(coord_rev), plane)
         if i == 0:
             # update the offset based on the xy plane
             self.offset = coord_transposed[::-1]
             if self.fn_update_coords:
                 self.fn_update_coords(coord_transposed)
         self.plot_eds[plane].update_coord(coord_transposed)