Exemplo n.º 1
0
def prep_source_img(src: Image,
                    crop: bool = True,
                    do_plot: bool = True) -> Image:
    src = src.as_masked()

    if crop:
        src = src.crop_to_landmarks()

    src = src.constrain_mask_to_landmarks()

    if do_plot:
        src.view(new_figure=True)

    return src
Exemplo n.º 2
0
 def view(self, xr=None, yr=None, is_merge=False):
     img = self.svs_image(xr, yr)
     if is_merge:
         img = Image(np.sum(img.pixels, axis=0))
     img.view()