Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data module in docs #123

Merged
merged 4 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
Changelog
=========

v0.0.5b
-------

- Fix `issue #100 <https://github.com/histolab/histolab/issues/100>`_
- Fix `issue #108 <https://github.com/histolab/histolab/issues/108>`_
- `Grid Tiler <https://github.com/histolab/histolab/issues/99>`_ added


v0.0.4b
-------

- Fix kmeans segmentation image filter default parameters
- Fix rag threshold image filter default parameters
- Fix check tissue on `Tile` to discard almost white tiles

v0.0.5b
-------

- Fix `issue #100 <https://github.com/histolab/histolab/issues/100>`_
- Fix `issue #108 <https://github.com/histolab/histolab/issues/108>`_
- `Grid Tiler <https://github.com/histolab/histolab/issues/99>`_ added
.. toctree::
11 changes: 11 additions & 0 deletions docs/api/data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Data
====================================

.. toctree::
:caption: API Reference
:maxdepth: 2

.. automodule:: src.histolab.data
:members:

.. toctree::
6 changes: 3 additions & 3 deletions docs/api/filters.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Filters
====================================

.. toctree::

.. toctree::
:maxdepth: 2
:caption: API Reference

filters/image_filters
filters/image_filters_functional
filters/morphological_filters
filters/morphological_filters_functional
filters/morphological_filters_functional

.. toctree::
6 changes: 3 additions & 3 deletions docs/api/filters/image_filters.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Image Filters
====================================

.. toctree::

.. toctree::
:caption: Filters
:maxdepth: 2

.. automodule:: src.histolab.filters.image_filters
:members:
:members:

.. toctree::
5 changes: 3 additions & 2 deletions docs/api/filters/image_filters_functional.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Image Filters Functional
====================================

.. toctree::

.. toctree::
:caption: Filters
:maxdepth: 2

.. automodule:: src.histolab.filters.image_filters_functional
:members:
:members:

.. toctree::
6 changes: 3 additions & 3 deletions docs/api/filters/morphological_filters.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Morphological Filters
====================================

.. toctree::

.. toctree::
:caption: Filters
:maxdepth: 2

.. automodule:: src.histolab.filters.morphological_filters
:members:
:members:

.. toctree::
7 changes: 4 additions & 3 deletions docs/api/filters/morphological_filters_functional.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Morphological Filters Functional
====================================

.. toctree::

.. toctree::
:caption: Filters
:maxdepth: 2

.. automodule:: src.histolab.filters.morphological_filters_functional
:members:
:members:


.. toctree::
6 changes: 3 additions & 3 deletions docs/api/slide.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Slide
====================================

.. toctree::

.. toctree::
:caption: API Reference
:maxdepth: 2

.. automodule:: src.histolab.slide
:members:
:members:

.. toctree::
6 changes: 3 additions & 3 deletions docs/api/tile.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Tile
====================================

.. toctree::

.. toctree::
:caption: API Reference
:maxdepth: 2

.. automodule:: src.histolab.tile
:members:
:members:

.. toctree::
6 changes: 3 additions & 3 deletions docs/api/tiler.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Tiler
====================================

.. toctree::

.. toctree::
:caption: API Reference
:maxdepth: 2

.. automodule:: src.histolab.tiler
:members:
:exclude-members: Tiler
:exclude-members: Tiler

.. toctree::
File renamed without changes.
2 changes: 2 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,6 @@ Attribution
This Code of Conduct is adapted from the `Contributor Covenant <http://contributor-covenant.org>`_\ , version 1.4,
available at `http://contributor-covenant.org/version/1/4 <http://contributor-covenant.org/version/1/4/>`_

.. toctree::

.. toctree::
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ References
api/filters
api/tile
api/tiler
utils
api/data
api/utils


Indices and tables
Expand Down
2 changes: 2 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,6 @@ least 80% of tissue inside.
:alt: caption


.. toctree::

.. toctree::
2 changes: 1 addition & 1 deletion docs/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ References


.. toctree::
:hidden:


.. toctree::
:caption: API Reference
Expand Down
62 changes: 41 additions & 21 deletions src/histolab/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,15 @@ def _load_svs(f: str) -> Tuple[openslide.OpenSlide, str]:

Parameters
----------
f: str
data_filename: str
f : str
Name of the file in the histolab repository

Returns
-------
slide : OpenSlide object
An OpenSlide object representing a whole-slide image.
slide : openslide.OpenSlide
An OpenSlide object representing a whole-slide image.
path : str
Path where the slide is saved

Raises
------
Expand All @@ -241,52 +242,61 @@ def _load_svs(f: str) -> Tuple[openslide.OpenSlide, str]:
def cmu_small_region() -> Tuple[openslide.OpenSlide, str]:
"""Carnegie Mellon University MRXS sample tissue

This image is available here
http://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/

Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.

Returns
-------
cmu_mrxs_tissue : OpenSlide object
cmu_mrxs_tissue : openslide.OpenSlide
Sample CMU tissue Whole-Slide-Image
path : str
Path where the slide is saved
"""
return _load_svs("data/cmu_small_region.svs")


def aorta_tissue() -> Tuple[openslide.OpenSlide, str]: # pragma: no cover
"""Aorta tissue, brightfield, JPEG 2000, YCbCr

This image is avaliable here
This image is available here
http://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/

Free to use and distribute, with or without modification

Returns
-------
aorta_tissue : OpenSlide object
aorta_tissue : openslide.OpenSlide
Aorta tissue Whole-Slide-Image
path : str
Path where the slide is saved
"""
return _load_svs("aperio/JP2K-33003-1.svs")


def heart_tissue() -> Tuple[openslide.OpenSlide, str]: # pragma: no cover
"""Heart tissue, brightfield, JPEG 2000, YCbCr

This image is avaliable here
This image is available here
http://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/

Free to use and distribute, with or without modification

Returns
-------
heart_tissue : OpenSlide object
heart_tissue : openslide.OpenSlide
Heart tissue Whole-Slide-Image
path : str
Path where the slide is saved
"""
return _load_svs("aperio/JP2K-33003-2.svs")


def breast_tissue() -> Tuple[openslide.OpenSlide, str]: # pragma: no cover
"""Breast tissue, TCGA-BRCA dataset
"""Breast tissue, TCGA-BRCA dataset.

This image is avaliable here
This image is available here
https://portal.gdc.cancer.gov/files/9c960533-2e58-4e54-97b2-8454dfb4b8c8
or through the API
https://api.gdc.cancer.gov/data/9c960533-2e58-4e54-97b2-8454dfb4b8c8
Expand All @@ -295,16 +305,18 @@ def breast_tissue() -> Tuple[openslide.OpenSlide, str]: # pragma: no cover

Returns
-------
breast_tissue : OpenSlide object
breast_tissue : openslide.OpenSlide
Breast tissue Whole-Slide-Image
path : str
Path where the slide is saved
"""
return _load_svs("tcga/breast/9c960533-2e58-4e54-97b2-8454dfb4b8c8")


def prostate_tissue() -> Tuple[openslide.OpenSlide, str]: # pragma: no cover
"""Prostate tissue, TCGA-
"""Prostate tissue, TCGA-PRAD dataset.

This image is avaliable here
This image is available here
https://portal.gdc.cancer.gov/files/6b725022-f1d5-4672-8c6c-de8140345210
or through the API
https://api.gdc.cancer.gov/data/6b725022-f1d5-4672-8c6c-de8140345210
Expand All @@ -314,8 +326,10 @@ def prostate_tissue() -> Tuple[openslide.OpenSlide, str]: # pragma: no cover

Returns
-------
prostate_tissue : OpenSlide object
prostate_tissue : openslide.OpenSlide
Prostate tissue Whole-Slide-Image
path : str
Path where the slide is saved
"""
return _load_svs("tcga/prostate/6b725022-f1d5-4672-8c6c-de8140345210")

Expand All @@ -325,7 +339,7 @@ def breast_tissue_diagnostic_green_pen() -> Tuple[
]: # pragma: no cover
"""Breast tissue, TCGA-BRCA dataset. Diagnostic slide with green pen.

This image is avaliable here
This image is available here
https://portal.gdc.cancer.gov/files/da36d3aa-9b19-492a-af4f-cc028a926d96
or through the API
https://api.gdc.cancer.gov/data/da36d3aa-9b19-492a-af4f-cc028a926d96
Expand All @@ -334,8 +348,10 @@ def breast_tissue_diagnostic_green_pen() -> Tuple[

Returns
-------
breast_tissue : OpenSlide object
breast_tissue : openslide.OpenSlide
Breast tissue Whole-Slide-Image
path : str
Path where the slide is saved
"""
return _load_svs("tcga/breast/da36d3aa-9b19-492a-af4f-cc028a926d96")

Expand All @@ -345,7 +361,7 @@ def breast_tissue_diagnostic_red_pen() -> Tuple[
]: # pragma: no cover
"""Breast tissue, TCGA-BRCA dataset. Diagnostic slide with red pen.

This image is avaliable here
This image is available here
https://portal.gdc.cancer.gov/files/f8b4cee6-9149-45b4-ae53-82b0547e1e34
or through the API
https://api.gdc.cancer.gov/data/f8b4cee6-9149-45b4-ae53-82b0547e1e34
Expand All @@ -354,8 +370,10 @@ def breast_tissue_diagnostic_red_pen() -> Tuple[

Returns
-------
breast_tissue : OpenSlide object
breast_tissue : openslide.OpenSlide
Breast tissue Whole-Slide-Image
path : str
Path where the slide is saved
"""
return _load_svs("tcga/breast/f8b4cee6-9149-45b4-ae53-82b0547e1e34")

Expand All @@ -365,7 +383,7 @@ def breast_tissue_diagnostic_black_pen() -> Tuple[
]: # pragma: no cover
"""Breast tissue, TCGA-BRCA dataset. Diagnostic slide with black pen.

This image is avaliable here
This image is available here
https://portal.gdc.cancer.gov/files/31e248bf-ee24-4d18-bccb-47046fccb461
or through the API
https://api.gdc.cancer.gov/data/31e248bf-ee24-4d18-bccb-47046fccb461
Expand All @@ -374,7 +392,9 @@ def breast_tissue_diagnostic_black_pen() -> Tuple[

Returns
-------
breast_tissue : OpenSlide object
breast_tissue : openslide.OpenSlide
Breast tissue Whole-Slide-Image
path : str
Path where the slide is saved
"""
return _load_svs("tcga/breast/31e248bf-ee24-4d18-bccb-47046fccb461")