From 3e8c2fe15b73356f1cf7f6311a30c7e21abbc4c2 Mon Sep 17 00:00:00 2001 From: mjt320 <mjt320@googlemail.com> Date: Tue, 30 Jul 2024 14:40:14 +0100 Subject: [PATCH 1/4] remove testpypi action --- .github/workflows/publish.yml | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8a74050..7fc26ce 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -121,27 +121,27 @@ jobs: v'${{ needs.check_version.outputs.localversion }}' dist/** --repo '${{ github.repository }}' - publish-to-testpypi: - name: Publish Python 🐍 distribution 📦 to TestPyPI - needs: - - build - runs-on: ubuntu-latest - if: needs.check_version.outputs.output=='true' - - environment: - name: testpypi - url: https://test.pypi.org/p/sepal - - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - name: Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution 📦 to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ +# publish-to-testpypi: +# name: Publish Python 🐍 distribution 📦 to TestPyPI +# needs: +# - build +# runs-on: ubuntu-latest +# if: needs.check_version.outputs.output=='true' +# +# environment: +# name: testpypi +# url: https://test.pypi.org/p/sepal +# +# permissions: +# id-token: write # IMPORTANT: mandatory for trusted publishing +# +# steps: +# - name: Download all the dists +# uses: actions/download-artifact@v3 +# with: +# name: python-package-distributions +# path: dist/ +# - name: Publish distribution 📦 to TestPyPI +# uses: pypa/gh-action-pypi-publish@release/v1 +# with: +# repository-url: https://test.pypi.org/legacy/ From fcc0f78a3edf0d5cfdfce8a08184535378e0df88 Mon Sep 17 00:00:00 2001 From: mjt320 <mjt320@googlemail.com> Date: Tue, 30 Jul 2024 14:46:54 +0100 Subject: [PATCH 2/4] Revert "remove testpypi action" This reverts commit 3e8c2fe15b73356f1cf7f6311a30c7e21abbc4c2. --- .github/workflows/publish.yml | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7fc26ce..8a74050 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -121,27 +121,27 @@ jobs: v'${{ needs.check_version.outputs.localversion }}' dist/** --repo '${{ github.repository }}' -# publish-to-testpypi: -# name: Publish Python 🐍 distribution 📦 to TestPyPI -# needs: -# - build -# runs-on: ubuntu-latest -# if: needs.check_version.outputs.output=='true' -# -# environment: -# name: testpypi -# url: https://test.pypi.org/p/sepal -# -# permissions: -# id-token: write # IMPORTANT: mandatory for trusted publishing -# -# steps: -# - name: Download all the dists -# uses: actions/download-artifact@v3 -# with: -# name: python-package-distributions -# path: dist/ -# - name: Publish distribution 📦 to TestPyPI -# uses: pypa/gh-action-pypi-publish@release/v1 -# with: -# repository-url: https://test.pypi.org/legacy/ + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + needs: + - build + runs-on: ubuntu-latest + if: needs.check_version.outputs.output=='true' + + environment: + name: testpypi + url: https://test.pypi.org/p/sepal + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ From 70eca7b9a4de2ab564ed8a6aacf6e77ab2a66f0a Mon Sep 17 00:00:00 2001 From: mjt320 <mjt320@googlemail.com> Date: Wed, 16 Oct 2024 16:52:17 +0100 Subject: [PATCH 3/4] expand the range of stats generated by roi_measure --- src/sepal/utils/imaging.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/sepal/utils/imaging.py b/src/sepal/utils/imaging.py index 83542a8..56d6b63 100644 --- a/src/sepal/utils/imaging.py +++ b/src/sepal/utils/imaging.py @@ -76,8 +76,8 @@ def roi_measure(image, mask_image): mask_image (str, ndarray): Mask image. Returns: - dict{'mean': mean, 'median': median, 'sd': sd} - mean, median and sd (float, ndarray): statistics for masked + dict{'mean': mean, 'median': median, 'sd': sd, 'min': min, 'max': max, 'pct25': pct25, 'pct75': pct75} + mean, median, sd, min, max, 25th percentile and 75th percentile (float, ndarray): statistics for masked voxels. For input data with one more dimension than the mask image (e.g. a time series), a 1D array of floats is returned. """ @@ -95,9 +95,16 @@ def roi_measure(image, mask_image): # measure statistics for masked voxels masked_voxels = data_2d[mask_1d == 1, :] - stats = [(np.nanmean(m_d), np.nanmedian(m_d), np.nanstd(m_d)) + stats = [(np.nanmean(m_d), np.nanmedian(m_d), np.nanstd(m_d), np.nanmin(m_d), np.nanmax(m_d), + np.percentile(m_d, 25), np.percentile(m_d, 75)) for m_d in masked_voxels.transpose()] - mean, median, sd = zip(*stats) - - return {'mean': np.squeeze(mean), 'median': np.squeeze(median), - 'sd': np.squeeze(sd)} + mean, median, sd, mini, maxi, pct25, pct75 = zip(*stats) + + return {'mean': np.squeeze(mean), + 'median': np.squeeze(median), + 'sd': np.squeeze(sd), + 'min': np.squeeze(mini), + 'max': np.squeeze(maxi), + 'pct25': np.squeeze(pct25), + 'pct75': np.squeeze(pct75) + } From 2c320499a67caa018b6b5655e5bcaa3fbb19e41f Mon Sep 17 00:00:00 2001 From: mjt320 <mjt320@googlemail.com> Date: Wed, 16 Oct 2024 17:02:23 +0100 Subject: [PATCH 4/4] expand the range of stats generated by roi_measure --- README.md | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ea003f3..e9080cd 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Most functionality is demonstrated in Jupyter notebook format in ./demo --- ### Updates +Release 1.1.0 - *roi_measure* modified to generate more ROI statistics Release 1.0.3 - Add exception handling for some zero/negative inputs. Release 1.0.2 - Changed AIF interpolation method to linear to further reduce oscillations. Release 1.0.1 - Changed AIF interpolation method to avoid oscillations. Added demo notebook on interpolation. diff --git a/pyproject.toml b/pyproject.toml index ff85ba4..73bd382 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "sepal" -version = "1.0.3" +version = "1.1.0" description = "Quantitative MRI processing" readme = "README.md" authors = [{ name = "Michael Thrippleton", email = "mjt320@googlemail.com" }]