Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 7a5434f08a361e19df8997496fd4d6cac400ee66
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Wed May 8 10:50:25 2024 -0400

    Created documentation from source

commit 6ff5f6239ddb89b5ff8228a956e3ca646fe34465
Merge: dd6a056 4afb0bd
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Wed May 8 10:47:32 2024 -0400

    Merge branch 'main' into gh-pages-dev

commit dd6a0562351c8554ad7d31dcf41f16eb9ad5e6c7
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Wed May 8 10:46:43 2024 -0400

    Added example for PatchSampler for inference

commit 77311f42a0c7e74345f6a743ae4e1d5f5e5c16b6
Merge: 861fe51 fb57026
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Tue May 7 17:21:45 2024 -0400

    Merge branch 'main' into gh-pages-dev

commit 4afb0bd
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Tue May 7 17:01:57 2024 -0400

    Added example notebook to documentation

commit 0f1d718
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Tue May 7 16:32:16 2024 -0400

    Standardized patch sampling method to handle smaller and bigger mask scales than image scale

commit 61995e2
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Thu May 2 15:59:57 2024 -0400

    Fixed patch slices generation in PatchSampler to always retrieve patches of the defined shape

commit 784906f
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Thu May 2 10:38:54 2024 -0400

    Added tests for stride and pad parameters of PatchSampler class

commit 149cfc2
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Wed May 1 16:26:04 2024 -0400

    Padding and stride added to PatchSampler and ImageBase classes to allow overlapping patches extraction

commit 0de4ad1
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Tue Apr 30 10:51:24 2024 -0400

    Fixed missing patches from chunks smaller than the input image chunk size

commit bf8aae6
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Fri Apr 5 11:55:35 2024 -0400

    Fixed spatial chunk size computation when patch sizes are grater than the chunk size

commit 3a53ef5
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Fri Mar 29 16:46:02 2024 -0400

    Reverted change in the computation when masks elements are relative smaller than patch sizes

commit 43c2942
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Fri Mar 29 14:46:38 2024 -0400

    Changed PatchSampler to take as base the patche size instead of the input image's chunk sizes

commit fb57026
Author: Fernando Cervantes Sanchez <[email protected]>
Date:   Fri Oct 6 14:04:50 2023 -0400

    Integration of CI/CD practices (#2)

    * Integration CI/CD pipeline to this project

    * Corrected github actions test workflow

    * Install the package before test it

    * Created empty __init__.py inside tests to record coverage

    * Changed name of sample_images_generator.py to utils.py for clarity

    * Updated test workflow to use a non-supported workaround for the multiple OpenMP runtime library issue

    * Updated test workflow to report coverage

    * Moved non-pytorch compatibility test to last position

    * Added test for datasets with zero expected samples
  • Loading branch information
fercer committed May 8, 2024
1 parent 861fe51 commit 03df904
Show file tree
Hide file tree
Showing 186 changed files with 10,466 additions and 16,144 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run Tests on push
on: [push, pull_request, workflow_dispatch]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install ependencies
run: |
python -m pip install --upgrade pip
pip install torch==1.13.1+cpu torchvision==0.14.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu
pip install tqdm==4.66.1
pip install tifffile==2023.9.26
pip install .
- name: Test with pytest
run: |
pip install pytest pytest-cov
# When using pytest and pytorch at the same time, an error of multiple copied of OpenMP runtime library will rise.
# This is a well known issue and is the reason of why pytorch uses unitest for testing and not pytest.
# This is a non-recomended, non-supported, and therefore non-elegant solution for that problem, but at least let run the test suite.
export KMP_DUPLICATE_LIB_OK=TRUE
pytest tests --cov=zarrdataset
coverage report -m
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
example.py

# Translations
*.mo
Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 900738c030f46fa25ebb5b39170cc7e4
config: 5704830082c07750dd4f65112d73bff2
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified docs/.doctrees/autoapi/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_augs/index.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_maskfuncs/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_samplers/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_utils/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_zarrdataset/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/.doctrees/examples/advanced_example_pytorch.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_example.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_example_pytorch.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_example_tensorflow.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_labeled_datasets_example.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_masked_datasets_example.doctree
Binary file not shown.
Binary file modified docs/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/license_link.doctree
Binary file not shown.
Binary file modified docs/.doctrees/readme_link.doctree
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
24 changes: 13 additions & 11 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; ZarrDataset documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" type="text/css" />
<link rel="stylesheet" href="../_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=fd3f3429" />


<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
Expand Down Expand Up @@ -55,6 +56,7 @@
<li class="toctree-l1"><a class="reference internal" href="../examples/advanced_masked_datasets_example.html">Custom masks for sampling specific regions from images with ZarrDataset</a></li>
<li class="toctree-l1"><a class="reference internal" href="../examples/basic_labeled_datasets_example.html">Labeled dataset loading with ZarrDataset</a></li>
<li class="toctree-l1"><a class="reference internal" href="../examples/advanced_example_pytorch.html">Integration of ZarrDataset with PyTorch’s DataLoader (Advanced)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../examples/advanced_example_pytorch_inference.html">Integration of ZarrDataset with PyTorch’s DataLoader for inference (Advanced)</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
Expand Down
41 changes: 26 additions & 15 deletions docs/_modules/zarrdataset/_augs.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>zarrdataset._augs &mdash; ZarrDataset documentation</title>
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" type="text/css" />
<link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="../../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=fd3f3429" />


<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/sphinx_highlight.js"></script>
<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
Expand Down Expand Up @@ -55,6 +56,7 @@
<li class="toctree-l1"><a class="reference internal" href="../../examples/advanced_masked_datasets_example.html">Custom masks for sampling specific regions from images with ZarrDataset</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../examples/basic_labeled_datasets_example.html">Labeled dataset loading with ZarrDataset</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../examples/advanced_example_pytorch.html">Integration of ZarrDataset with PyTorch’s DataLoader (Advanced)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../examples/advanced_example_pytorch_inference.html">Integration of ZarrDataset with PyTorch’s DataLoader for inference (Advanced)</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
Expand Down Expand Up @@ -92,7 +94,9 @@ <h1>Source code for zarrdataset._augs</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>


<div class="viewcode-block" id="ToDtype"><a class="viewcode-back" href="../../autoapi/zarrdataset/index.html#zarrdataset._augs.ToDtype">[docs]</a><span class="k">class</span> <span class="nc">ToDtype</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<div class="viewcode-block" id="ToDtype">
<a class="viewcode-back" href="../../autoapi/zarrdataset/index.html#zarrdataset._augs.ToDtype">[docs]</a>
<span class="k">class</span> <span class="nc">ToDtype</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Converted a numpy NDArray to the specified data type.</span>

<span class="sd"> Parameters</span>
Expand All @@ -103,7 +107,9 @@ <h1>Source code for zarrdataset._augs</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">dtype</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_dtype</span> <span class="o">=</span> <span class="n">dtype</span>

<div class="viewcode-block" id="ToDtype.__call__"><a class="viewcode-back" href="../../autoapi/zarrdataset/index.html#zarrdataset._augs.ToDtype.__call__">[docs]</a> <span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">image</span><span class="p">:</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<div class="viewcode-block" id="ToDtype.__call__">
<a class="viewcode-back" href="../../autoapi/zarrdataset/index.html#zarrdataset._augs.ToDtype.__call__">[docs]</a>
<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">image</span><span class="p">:</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Casts the type of `image` to the data type specified with `dtype`.</span>

<span class="sd"> Parameters</span>
Expand All @@ -119,8 +125,13 @@ <h1>Source code for zarrdataset._augs</h1><div class="highlight"><pre>
<span class="n">casted_image</span> <span class="o">=</span> <span class="n">image</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_dtype</span><span class="p">)</span>
<span class="k">return</span> <span class="n">casted_image</span></div>

<div class="viewcode-block" id="ToDtype.__repr__"><a class="viewcode-back" href="../../autoapi/zarrdataset/index.html#zarrdataset._augs.ToDtype.__repr__">[docs]</a> <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">(dtype=</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_dtype</span><span class="si">}</span><span class="s2">)&quot;</span></div></div>

<div class="viewcode-block" id="ToDtype.__repr__">
<a class="viewcode-back" href="../../autoapi/zarrdataset/index.html#zarrdataset._augs.ToDtype.__repr__">[docs]</a>
<span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">(dtype=</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_dtype</span><span class="si">}</span><span class="s2">)&quot;</span></div>
</div>

</pre></div>

</div>
Expand Down
Loading

0 comments on commit 03df904

Please sign in to comment.