From f40199d9807ef0e54f8b0951d1dcf5264d533dcb Mon Sep 17 00:00:00 2001 From: alessiamarcolini <98marcolini@gmail.com> Date: Mon, 27 Jul 2020 12:11:12 +0200 Subject: [PATCH 1/4] Fix docstrings --- src/histolab/data/__init__.py | 59 ++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/src/histolab/data/__init__.py b/src/histolab/data/__init__.py index 3b2cfd42c..e6b8cf24e 100644 --- a/src/histolab/data/__init__.py +++ b/src/histolab/data/__init__.py @@ -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 ------ @@ -245,8 +246,10 @@ def cmu_small_region() -> Tuple[openslide.OpenSlide, str]: 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") @@ -254,15 +257,17 @@ def cmu_small_region() -> Tuple[openslide.OpenSlide, str]: 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") @@ -270,23 +275,25 @@ def aorta_tissue() -> Tuple[openslide.OpenSlide, str]: # pragma: no cover 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 @@ -295,16 +302,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 @@ -314,8 +323,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") @@ -325,7 +336,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 @@ -334,8 +345,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") @@ -345,7 +358,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 @@ -354,8 +367,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") @@ -365,7 +380,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 @@ -374,7 +389,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") From 16c459e9447c97a0d404cbdb665c69bd5f99d104 Mon Sep 17 00:00:00 2001 From: alessiamarcolini <98marcolini@gmail.com> Date: Mon, 27 Jul 2020 12:13:12 +0200 Subject: [PATCH 2/4] Add reference for CMU small region data sample --- src/histolab/data/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/histolab/data/__init__.py b/src/histolab/data/__init__.py index e6b8cf24e..b8c153eac 100644 --- a/src/histolab/data/__init__.py +++ b/src/histolab/data/__init__.py @@ -242,6 +242,9 @@ 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 From 18c99e5bcc2011beedbdad95fe627a3be9a1d0a7 Mon Sep 17 00:00:00 2001 From: alessiamarcolini <98marcolini@gmail.com> Date: Mon, 27 Jul 2020 12:14:19 +0200 Subject: [PATCH 3/4] Add data module in docs --- CHANGELOG.rst | 14 +++++++++----- docs/api/data.rst | 11 +++++++++++ docs/api/filters.rst | 6 +++--- docs/api/filters/image_filters.rst | 6 +++--- docs/api/filters/image_filters_functional.rst | 5 +++-- docs/api/filters/morphological_filters.rst | 6 +++--- .../filters/morphological_filters_functional.rst | 7 ++++--- docs/api/slide.rst | 6 +++--- docs/api/tile.rst | 6 +++--- docs/api/tiler.rst | 6 +++--- docs/contributing.rst | 2 ++ docs/index.rst | 1 + docs/quickstart.rst | 2 ++ docs/readme.rst | 2 +- 14 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 docs/api/data.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2569b5cb0..8b9df82f9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Changelog ========= +v0.0.5b +------- + + - Fix `issue #100 `_ + - Fix `issue #108 `_ + - `Grid Tiler `_ added + + v0.0.4b ------- @@ -8,9 +16,5 @@ v0.0.4b - Fix rag threshold image filter default parameters - Fix check tissue on `Tile` to discard almost white tiles -v0.0.5b -------- - - Fix `issue #100 `_ - - Fix `issue #108 `_ - - `Grid Tiler `_ added +.. toctree:: diff --git a/docs/api/data.rst b/docs/api/data.rst new file mode 100644 index 000000000..12fc72b5e --- /dev/null +++ b/docs/api/data.rst @@ -0,0 +1,11 @@ +Data +==================================== + +.. toctree:: + :caption: API Reference + :maxdepth: 2 + +.. automodule:: src.histolab.data + :members: + +.. toctree:: \ No newline at end of file diff --git a/docs/api/filters.rst b/docs/api/filters.rst index 835b6fca4..06a113abe 100644 --- a/docs/api/filters.rst +++ b/docs/api/filters.rst @@ -1,8 +1,6 @@ Filters ==================================== -.. toctree:: - .. toctree:: :maxdepth: 2 :caption: API Reference @@ -10,4 +8,6 @@ Filters filters/image_filters filters/image_filters_functional filters/morphological_filters - filters/morphological_filters_functional \ No newline at end of file + filters/morphological_filters_functional + +.. toctree:: \ No newline at end of file diff --git a/docs/api/filters/image_filters.rst b/docs/api/filters/image_filters.rst index a5382aefe..26fe6aca6 100644 --- a/docs/api/filters/image_filters.rst +++ b/docs/api/filters/image_filters.rst @@ -1,11 +1,11 @@ Image Filters ==================================== -.. toctree:: - .. toctree:: :caption: Filters :maxdepth: 2 .. automodule:: src.histolab.filters.image_filters - :members: \ No newline at end of file + :members: + +.. toctree:: \ No newline at end of file diff --git a/docs/api/filters/image_filters_functional.rst b/docs/api/filters/image_filters_functional.rst index 52af70148..f2f60c71b 100644 --- a/docs/api/filters/image_filters_functional.rst +++ b/docs/api/filters/image_filters_functional.rst @@ -1,11 +1,12 @@ Image Filters Functional ==================================== -.. toctree:: .. toctree:: :caption: Filters :maxdepth: 2 .. automodule:: src.histolab.filters.image_filters_functional - :members: \ No newline at end of file + :members: + +.. toctree:: \ No newline at end of file diff --git a/docs/api/filters/morphological_filters.rst b/docs/api/filters/morphological_filters.rst index e97f27706..0e2a39189 100644 --- a/docs/api/filters/morphological_filters.rst +++ b/docs/api/filters/morphological_filters.rst @@ -1,11 +1,11 @@ Morphological Filters ==================================== -.. toctree:: - .. toctree:: :caption: Filters :maxdepth: 2 .. automodule:: src.histolab.filters.morphological_filters - :members: \ No newline at end of file + :members: + +.. toctree:: \ No newline at end of file diff --git a/docs/api/filters/morphological_filters_functional.rst b/docs/api/filters/morphological_filters_functional.rst index 677fbc323..f9fedefa8 100644 --- a/docs/api/filters/morphological_filters_functional.rst +++ b/docs/api/filters/morphological_filters_functional.rst @@ -1,11 +1,12 @@ Morphological Filters Functional ==================================== -.. toctree:: - .. toctree:: :caption: Filters :maxdepth: 2 .. automodule:: src.histolab.filters.morphological_filters_functional - :members: \ No newline at end of file + :members: + + +.. toctree:: \ No newline at end of file diff --git a/docs/api/slide.rst b/docs/api/slide.rst index 32fcab96f..404a01d82 100644 --- a/docs/api/slide.rst +++ b/docs/api/slide.rst @@ -1,11 +1,11 @@ Slide ==================================== -.. toctree:: - .. toctree:: :caption: API Reference :maxdepth: 2 .. automodule:: src.histolab.slide - :members: \ No newline at end of file + :members: + +.. toctree:: \ No newline at end of file diff --git a/docs/api/tile.rst b/docs/api/tile.rst index b3b08ed85..fc517f7e4 100644 --- a/docs/api/tile.rst +++ b/docs/api/tile.rst @@ -1,11 +1,11 @@ Tile ==================================== -.. toctree:: - .. toctree:: :caption: API Reference :maxdepth: 2 .. automodule:: src.histolab.tile - :members: \ No newline at end of file + :members: + +.. toctree:: \ No newline at end of file diff --git a/docs/api/tiler.rst b/docs/api/tiler.rst index 421b0218f..a79aedf43 100644 --- a/docs/api/tiler.rst +++ b/docs/api/tiler.rst @@ -1,12 +1,12 @@ Tiler ==================================== -.. toctree:: - .. toctree:: :caption: API Reference :maxdepth: 2 .. automodule:: src.histolab.tiler :members: - :exclude-members: Tiler \ No newline at end of file + :exclude-members: Tiler + +.. toctree:: \ No newline at end of file diff --git a/docs/contributing.rst b/docs/contributing.rst index 22172b4aa..e9ae583a6 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -208,4 +208,6 @@ Attribution This Code of Conduct is adapted from the `Contributor Covenant `_\ , version 1.4, available at `http://contributor-covenant.org/version/1/4 `_ +.. toctree:: + .. toctree:: \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 5fadbeb1b..83df9894f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -85,6 +85,7 @@ References api/filters api/tile api/tiler + api/data utils diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 612c5c32f..c943617f6 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -180,4 +180,6 @@ least 80% of tissue inside. :alt: caption +.. toctree:: + .. toctree:: \ No newline at end of file diff --git a/docs/readme.rst b/docs/readme.rst index 52dff0938..e4ee12722 100644 --- a/docs/readme.rst +++ b/docs/readme.rst @@ -72,7 +72,7 @@ References .. toctree:: - :hidden: + .. toctree:: :caption: API Reference From 27d265c308b50c7396df9c78e888ca98ce5d54b7 Mon Sep 17 00:00:00 2001 From: alessiamarcolini <98marcolini@gmail.com> Date: Mon, 27 Jul 2020 12:15:46 +0200 Subject: [PATCH 4/4] Move utils in correct folder --- docs/{ => api}/utils.rst | 0 docs/index.rst | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/{ => api}/utils.rst (100%) diff --git a/docs/utils.rst b/docs/api/utils.rst similarity index 100% rename from docs/utils.rst rename to docs/api/utils.rst diff --git a/docs/index.rst b/docs/index.rst index 83df9894f..9375d0cc3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -86,7 +86,7 @@ References api/tile api/tiler api/data - utils + api/utils Indices and tables