Esempio n. 1
0
    def get_scaled_cutout2(self, p1, p2, scales,
                           method='basic', logger=None):

        if method not in ('basic', 'view') and len(scales) == 2:
            # for 2D images with alternate interpolation requirements
            return self.get_scaled_cutout(p1[0], p1[1], p2[0], p2[1],
                                          scales[0], scales[1],
                                          method=method)

        shp = self.shape

        view, scales = trcalc.get_scaled_cutout_basic_view(
            shp, p1, p2, scales)

        newdata = self._slice(view)

        scale_x, scale_y = scales[:2]
        res = Bunch.Bunch(data=newdata, scale_x=scale_x, scale_y=scale_y)
        if len(scales) > 2:
            res.scale_z = scales[2]

        return res
Esempio n. 2
0
    def get_scaled_cutout2(self, p1, p2, scales,
                           method='basic', logger=None):

        if method not in ('basic',) and len(scales) == 2:
            # for 2D images with alternate interpolation requirements
            return self.get_scaled_cutout(p1[0], p1[1], p2[0], p2[1],
                                          scales[0], scales[1],
                                          method=method)

        shp = self.shape

        view, scales = trcalc.get_scaled_cutout_basic_view(
            shp, p1, p2, scales)

        newdata = self._slice(view)

        scale_x, scale_y = scales[:2]
        res = Bunch.Bunch(data=newdata, scale_x=scale_x, scale_y=scale_y)
        if len(scales) > 2:
            res.scale_z = scales[2]

        return res