Skip to content

Commit

Permalink
Merge pull request #48 from BohndiekLab/main
Browse files Browse the repository at this point in the history
Merge main updates into develop
  • Loading branch information
tomelse committed May 16, 2024
2 parents 4a8eea7 + ef87767 commit 1f08fb5
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 216 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.14.1
uses: pypa/cibuildwheel@v2.16.5
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
pip install coverage ruff
- name: Linting
run: |
ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 . # Should do wider tests in the future.
ruff --output-format=github --select=E9,F63,F7,F82 --target-version=py37 . # Should do wider tests in the future.
- name: Run tests
run: |
cd tests
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ pip install patato

To setup support for image reconstruction on Windows, or for GPU support, please follow the installation guide in the documentation.

## Citing PATATO

To cite PATATO, please reference our article in the Journal of Open Source software, [here](https://joss.theoj.org/papers/456eaf591244858915ad8730dcbc19d7).

## Documentation, examples and contributing
Documentation for PATATO can be found at https://patato.readthedocs.io/en/latest/?badge=latest.

Expand Down
4 changes: 2 additions & 2 deletions docs/api/analysis_code.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MSOT Analysis Code
===================
PATATO API Reference
=====================

.. autosummary::
:toctree: ../_autosummary
Expand Down
249 changes: 47 additions & 202 deletions docs/examples/04_timeseriesanalysis.ipynb

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ for the community as we translate photoacoustics to the clinic.

The logo was designed by `Elly Pugh <https://ellypugh.com/>`_.

Cite PATATO
"""""""""""""""

To cite PATATO, please reference our Journal of Open Source Software paper `here <https://joss.theoj.org/papers/456eaf591244858915ad8730dcbc19d7>`_.

.. only:: latex

User Guide
Expand Down
5 changes: 4 additions & 1 deletion docs/intro/04_runningtests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ run the following in the command line:
git clone https://github.com/BohndiekLab/patato
cd patato
pip install -e .
Install PATATO: `pip install -e .` (requires build tools) OR `pip install patato` (doesn't require compiler tools).

.. code-block:: console
cd tests
python -m unittest
Expand Down
9 changes: 6 additions & 3 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ authors:
orcid: 0000-0002-2652-4190
affiliation: "1, 2" # (Multiple affiliations must be quoted)
- name: Janek Gröhl
orcid: 0000-0002-5332-4856
affiliation: "1, 2"
- name: Lina Hacker
orcid: 0000-0001-5160-0952
affiliation: "1, 2, 3"
- name: Sarah E. Bohndiek
orcid: 0000-0003-0371-8635
corresponding: true # (This is how to denote the corresponding author)
affiliation: "1, 2"
affiliations:
- name: CRUK Cambridge Institute, University of Cambridge, UK
- name: CRUK Cambridge Institute, University of Cambridge, United Kingdom
index: 1
- name: Department of Physics, University of Cambridge, UK
- name: Department of Physics, University of Cambridge, United Kingdom
index: 2
- name: Department of Oncology, University of Oxford, UK
- name: Department of Oncology, University of Oxford, United Kingdom
index: 3
date: 8 June 2023
bibliography: bibliography.bib
Expand Down
15 changes: 10 additions & 5 deletions patato/io/msot_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def get_responding_pixels(self, nsigma=2):
responding = delta_images.raw_data > nsigma * sigma_so2.raw_data
else:
return None
return SingleImage(responding, None, algorithm_id=delta_images.algorithm_id,
return SingleImage(responding, ["Responding Pixels"], algorithm_id=delta_images.algorithm_id,
attributes=delta_images.attributes,
hdf5_sub_name=delta_images.hdf5_sub_name, field_of_view=delta_images.fov_3d)

Expand Down Expand Up @@ -697,7 +697,8 @@ def dataset(self):
return self.get_time_series()

def summary_measurements(self, metrics=None,
include_rois=None, roi_kwargs=None, just_summary=True, return_masks=False):
include_rois=None, roi_kwargs=None, just_summary=True,
return_masks=False, metric_limits=None):
"""
Parameters
Expand Down Expand Up @@ -760,6 +761,10 @@ def summary_measurements(self, metrics=None,
if m:
mask, data_slice = roi.to_mask_slice(m)
output_roi[metrics[i]] = data_slice.raw_data.T[mask.T].T
if metric_limits is not None and metrics[i] in metric_limits:
lower, upper = metric_limits[metrics[i]]
output_roi[metrics[i]][output_roi[metrics[i]] < lower] = np.nan
output_roi[metrics[i]][output_roi[metrics[i]] > upper] = np.nan
else:
print(f"Skipping metric {metrics[i]}")

Expand All @@ -778,9 +783,9 @@ def summary_measurements(self, metrics=None,

output_table = pd.DataFrame(outputs)

summary_methods = {"mean": np.mean,
"median": np.median,
"std": np.std}
summary_methods = {"mean": np.nanmean,
"median": np.nanmedian,
"std": np.nanstd}
for name, method in summary_methods.items():
for metric in metrics:
if metric in output_table.columns:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = [
"requests",
"cython",
"shapely",
"pylops >= 2", # Check version compatibility with pylops
"pylops == 2.1", # Check version compatibility with pylops
"h5py",
"typing_extensions",
"pandas",
Expand Down

0 comments on commit 1f08fb5

Please sign in to comment.