+
Skip to content

Error in using tissue mask with custom filter #707

@qasimgilani

Description

@qasimgilani

Hi,

When I use the tissue mask with the custom filters, I receive this error.

masked_image[:,:,channel_i] = img_arr[:,:,channel_i] * mask

ValueError: operands could not be broadcast together with shapes (644, 988) (2013, 3089)

I am running this example from histolab:

from histolab.data import breast_tissue_diagnostic_green_pen
from histolab.filters.image_filters import (
   ApplyMaskImage,
   GreenPenFilter,
   Invert,
   OtsuThreshold,
   RgbToGrayscale,
)
from histolab.filters.morphological_filters import RemoveSmallHoles, RemoveSmallObjects
from histolab.masks import TissueMask
from histolab.slide import Slide

_, slide_path = breast_tissue_diagnostic_green_pen()
breast_slide = Slide(slide_path, "")

mask = TissueMask(
   RgbToGrayscale(),
   OtsuThreshold(),
   ApplyMaskImage(breast_slide.thumbnail),
   GreenPenFilter(),
   RgbToGrayscale(),
   Invert(),
   OtsuThreshold(),
   RemoveSmallHoles(),
   RemoveSmallObjects(),
)

breast_slide.locate_mask(mask, scale_factor=64)

Any help in resolving this issue will be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载