The situated bounds can be set to embed the CFView in a larger
        bounded region.""")

    input_sheet_slice = param.NumericTuple(default=(0, 0, 0, 0), doc="""
        Slice indices of the embedded view into the situated matrix.""")

    @property
    def situated(self):
        if self.bounds.lbrt() == self.situated_bounds.lbrt():
            self.warning("CFView is already situated.")
            return self
        l, b, r, t = self.bounds.lbrt()
        xd = int(np.round(self.data.shape[1] / (r-l)))
        yd = int(np.round(self.data.shape[0] / (t-b)))

        scs = SheetCoordinateSystem(self.situated_bounds, xd, yd)

        data = np.zeros(scs.shape, dtype=np.float64)
        r1, r2, c1, c2 = self.input_sheet_slice
        data[r1:r2, c1:c2] = self.data

        return CFView(data, self.situated_bounds, roi_bounds=self.bounds,
                      situated_bounds=self.situated_bounds,
                      label=self.label, group=self.group)


Store.register({CFView: RasterPlot}, 'matplotlib')

options = Store.options(backend='matplotlib')
options.CFView = Options('style', cmap='gray', interpolation='nearest')
Exemple #2
0
                                           doc="""
        Slice indices of the embedded view into the situated matrix.""")

    @property
    def situated(self):
        if self.bounds.lbrt() == self.situated_bounds.lbrt():
            self.warning("CFView is already situated.")
            return self
        l, b, r, t = self.bounds.lbrt()
        xd = int(np.round(self.data.shape[1] / (r - l)))
        yd = int(np.round(self.data.shape[0] / (t - b)))

        scs = SheetCoordinateSystem(self.situated_bounds, xd, yd)

        data = np.zeros(scs.shape, dtype=np.float64)
        r1, r2, c1, c2 = self.input_sheet_slice
        data[r1:r2, c1:c2] = self.data

        return CFView(data,
                      self.situated_bounds,
                      roi_bounds=self.bounds,
                      situated_bounds=self.situated_bounds,
                      label=self.label,
                      group=self.group)


Store.register({CFView: RasterPlot}, 'matplotlib')

options = Store.options(backend='matplotlib')
options.CFView = Options('style', cmap='gray', interpolation='nearest')