Code Monkey home page Code Monkey logo

histoprep's People

Contributors

jopo666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

histoprep's Issues

AttributeError: 'SlideReader' object has no attribute 'get_tissue_mask'

Hi!

Thank you for providing HistoPrep to the community.

I'm running trying to run the functions in the Readme page, using the following H2_1.jpg that can be downloaded here: https://data.mendeley.com/datasets/svw96g68dv/4.

I encounter the following error:

reader.get_tissue_mask(level=-1)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [22], in <cell line: 1>()
----> 1 reader.get_tissue_mask(level=-1)

AttributeError: 'SlideReader' object has no attribute 'get_tissue_mask'

Windows 11 Home, 64 bit, Anaconda Python, running in a Jupter notebook.

Happy to provide more details if needed, would love to be able to run HistoPrep on some images!

AttributeError: module 'openslide' has no attribute 'OpenSlide'

Hi there! I was trying to open a histology WSI in .tif and bumped into the following error:

File ~/.local/lib/python3.11/site-packages/histoprep/_backend.py:235 in init
self.__reader = openslide.OpenSlide(path)

AttributeError: module 'openslide' has no attribute 'OpenSlide'

I wonder if you have any thoughts or suggestions to fix this bug? I had both libraries, openslide and openslide_python (v 1.3.1), installed on Linux.

Thank you!

Add labeler to HistoPrep

A class for easily adding labels for tiles would be awesome! Something like

metadata = histoprep.Labeler(metadata, prefix='cancer', mask=mask)

Is the slide resolution taken into account when extracting tiles ?

Hello,
Thank you for this nice package !

I used histoprep on two slides with different resolutions.
One was scanned at a mpp of 0.25, the other one with a mpp of 0.5. It seems that when extracting the tiles with the following code, it reads images of size 512x512 at the lowest openslide level, without taking in account the resolution. This implies that the cell scale etc.. differs between the images extracted on the two different slides (see images below, first is mpp 0.25, second is mpp 0.5).

from histoprep import SlideReader

# Read slide image.
reader = SlideReader("./slides/slide_with_ink.jpeg")
# Detect tissue.
threshold, tissue_mask = reader.get_tissue_mask(level=-1)
# Extract overlapping tile coordinates with less than 50% background.
tile_coordinates = reader.get_tile_coordinates(
    tissue_mask, width=512, overlap=0.5, max_background=0.5
)
# Save tile images with image metrics for preprocessing.
tile_metadata = reader.save_regions(
    "./train_tiles/", tile_coordinates, threshold=threshold, save_metrics=True
)
image image

Is this an intended behaviour or am I missing something?
Best

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.