PAROS 1.0.0__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- paros-2.0.0/.github/assets/screenshot.png +0 -0
- paros-2.0.0/.github/workflows/ci.yml +43 -0
- {paros-1.0.0 → paros-2.0.0}/.github/workflows/release.yml +19 -21
- paros-2.0.0/CITATION.cff +64 -0
- {paros-1.0.0 → paros-2.0.0}/PAROS/__init__.py +0 -1
- {paros-1.0.0 → paros-2.0.0}/PAROS/data/__init__.py +7 -3
- paros-2.0.0/PAROS/data/calibration/Topcon/TRC_50DX.csv +10 -0
- paros-2.0.0/PAROS/data/calibration/Topcon/TRC_50IX.csv +11 -0
- {paros-1.0.0 → paros-2.0.0}/PAROS/eyephantom.py +9 -5
- {paros-1.0.0 → paros-2.0.0}/PAROS/fundscale.py +345 -88
- {paros-1.0.0 → paros-2.0.0}/PKG-INFO +26 -14
- paros-2.0.0/README.md +60 -0
- {paros-1.0.0 → paros-2.0.0}/examples/calculate_ocular_magnification.ipynb +88 -92
- paros-2.0.0/examples/fundus_camera_calibration.ipynb +468 -0
- {paros-1.0.0 → paros-2.0.0}/pyproject.toml +23 -18
- paros-2.0.0/ruff_defaults.toml +663 -0
- paros-2.0.0/uv.lock +2110 -0
- paros-1.0.0/.github/workflows/ci.yml +0 -59
- paros-1.0.0/.github/workflows/test-release.yml +0 -53
- paros-1.0.0/.github/workflows/voici.yml +0 -53
- paros-1.0.0/PAROS/data/calibration/Topcon/TRC_50DX.csv +0 -10
- paros-1.0.0/PAROS/data/calibration/Topcon/TRC_50IX.csv +0 -11
- paros-1.0.0/README.md +0 -49
- paros-1.0.0/examples/fundus_camera_calibration.ipynb +0 -491
- paros-1.0.0/voici/README.md +0 -32
- paros-1.0.0/voici/build-environment.yml +0 -11
- paros-1.0.0/voici/environment.yml +0 -16
- paros-1.0.0/voici/simple_example.ipynb +0 -3678
- {paros-1.0.0 → paros-2.0.0}/.gitignore +0 -0
- {paros-1.0.0 → paros-2.0.0}/CONTRIBUTING.md +0 -0
- {paros-1.0.0 → paros-2.0.0}/LICENSE +0 -0
- {paros-1.0.0 → paros-2.0.0}/PAROS/data/calibration/__init__.py +0 -0
- {paros-1.0.0 → paros-2.0.0}/PAROS/data/lenses/__init__.py +0 -0
- {paros-1.0.0 → paros-2.0.0}/PAROS/data/lenses/phantom.csv +0 -0
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Continuous Integration
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- push
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
python: &python-versions ["3.10", "3.11", "3.12"]
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v6
|
|
14
|
+
- name: Set up uv
|
|
15
|
+
id: setup-uv
|
|
16
|
+
uses: astral-sh/setup-uv@v7
|
|
17
|
+
- name: Build PAROS
|
|
18
|
+
run: uvx --python ${{ matrix.python }} hatch build
|
|
19
|
+
|
|
20
|
+
format:
|
|
21
|
+
name: Format and lint
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v6
|
|
25
|
+
- name: Set up uv
|
|
26
|
+
id: setup-uv
|
|
27
|
+
uses: astral-sh/setup-uv@v7
|
|
28
|
+
- name: Format and lint
|
|
29
|
+
run: uvx hatch fmt --check
|
|
30
|
+
|
|
31
|
+
jupyter:
|
|
32
|
+
name: Test Jupyter notebooks
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
strategy:
|
|
35
|
+
matrix:
|
|
36
|
+
python: *python-versions
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v6
|
|
39
|
+
- name: Set up uv
|
|
40
|
+
id: setup-uv
|
|
41
|
+
uses: astral-sh/setup-uv@v7
|
|
42
|
+
- name: Format and lint
|
|
43
|
+
run: uvx --python ${{ matrix.python }} hatch run jupyter:run-all
|
|
@@ -2,7 +2,7 @@ name: Publish to PyPI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
release:
|
|
5
|
-
types: [released]
|
|
5
|
+
types: [released, prereleased]
|
|
6
6
|
|
|
7
7
|
permissions:
|
|
8
8
|
contents: read
|
|
@@ -10,28 +10,23 @@ permissions:
|
|
|
10
10
|
jobs:
|
|
11
11
|
build:
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
permissions:
|
|
15
15
|
contents: read
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
19
|
-
- name: Set up
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
python-version: "3.12"
|
|
23
|
-
- name: Install dependencies
|
|
24
|
-
run: |
|
|
25
|
-
python -m pip install --upgrade pip
|
|
26
|
-
pip install build
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
|
+
- name: Set up uv
|
|
20
|
+
id: setup-uv
|
|
21
|
+
uses: astral-sh/setup-uv@v7
|
|
27
22
|
- name: Build package
|
|
28
|
-
run:
|
|
23
|
+
run: uv build
|
|
29
24
|
- name: Upload dist
|
|
30
|
-
uses: actions/upload-artifact@
|
|
25
|
+
uses: actions/upload-artifact@v6
|
|
31
26
|
with:
|
|
32
27
|
name: paros_dist
|
|
33
28
|
path: "dist/"
|
|
34
|
-
|
|
29
|
+
|
|
35
30
|
publish_to_pypi:
|
|
36
31
|
name: Publish to PyPI
|
|
37
32
|
runs-on: ubuntu-latest
|
|
@@ -43,36 +38,39 @@ jobs:
|
|
|
43
38
|
|
|
44
39
|
steps:
|
|
45
40
|
- name: Download dist
|
|
46
|
-
uses: actions/download-artifact@
|
|
41
|
+
uses: actions/download-artifact@v7
|
|
47
42
|
with:
|
|
48
43
|
name: paros_dist
|
|
49
44
|
path: dist
|
|
45
|
+
- name: Set up uv
|
|
46
|
+
id: setup-uv
|
|
47
|
+
uses: astral-sh/setup-uv@v7
|
|
50
48
|
- name: Publish package
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
run: uv publish
|
|
50
|
+
|
|
53
51
|
upload_to_github:
|
|
54
52
|
name: Upload to GitHub
|
|
55
53
|
runs-on: ubuntu-latest
|
|
56
54
|
if: github.event_name == 'release'
|
|
57
55
|
needs: build
|
|
58
|
-
|
|
56
|
+
|
|
59
57
|
permissions:
|
|
60
58
|
contents: write
|
|
61
59
|
|
|
62
60
|
steps:
|
|
63
61
|
- name: Download dist
|
|
64
|
-
uses: actions/download-artifact@
|
|
62
|
+
uses: actions/download-artifact@v7
|
|
65
63
|
with:
|
|
66
64
|
name: paros_dist
|
|
67
65
|
path: dist
|
|
68
66
|
- name: Upload wheels to GitHub release
|
|
69
|
-
uses: svenstaro/upload-release-action@2.
|
|
67
|
+
uses: svenstaro/upload-release-action@2.11.3
|
|
70
68
|
with:
|
|
71
69
|
tag: ${{ github.ref }}
|
|
72
70
|
file: "dist/*.whl"
|
|
73
71
|
file_glob: true
|
|
74
72
|
- name: Upload dist to GitHub release
|
|
75
|
-
uses: svenstaro/upload-release-action@2.
|
|
73
|
+
uses: svenstaro/upload-release-action@2.11.3
|
|
76
74
|
with:
|
|
77
75
|
tag: ${{ github.ref }}
|
|
78
76
|
file: "dist/*.tar.gz"
|
paros-2.0.0/CITATION.cff
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
cff-version: "1.2.0"
|
|
2
|
+
authors:
|
|
3
|
+
- family-names: Pors
|
|
4
|
+
given-names: Lennart
|
|
5
|
+
orcid: "https://orcid.org/0000-0003-0907-6637"
|
|
6
|
+
- family-names: Haasjes
|
|
7
|
+
given-names: Corné
|
|
8
|
+
orcid: "https://orcid.org/0000-0003-0187-4116"
|
|
9
|
+
- family-names: Beenakker
|
|
10
|
+
given-names: Jan-Willem M.
|
|
11
|
+
orcid: "https://orcid.org/0000-0003-0479-5587"
|
|
12
|
+
contact:
|
|
13
|
+
- family-names: Beenakker
|
|
14
|
+
given-names: Jan-Willem M.
|
|
15
|
+
orcid: "https://orcid.org/0000-0003-0479-5587"
|
|
16
|
+
message: If you use this software, please cite our article in
|
|
17
|
+
Investigative Ophthalmology & Visual Science.
|
|
18
|
+
preferred-citation:
|
|
19
|
+
authors:
|
|
20
|
+
- family-names: Pors
|
|
21
|
+
given-names: Lennart
|
|
22
|
+
orcid: "https://orcid.org/0000-0003-0907-6637"
|
|
23
|
+
- family-names: Haasjes
|
|
24
|
+
given-names: Corné
|
|
25
|
+
orcid: "https://orcid.org/0000-0003-0187-4116"
|
|
26
|
+
- family-names: Vught
|
|
27
|
+
given-names: Luc
|
|
28
|
+
name-particle: van
|
|
29
|
+
orcid: "https://orcid.org/0000-0001-8290-9071"
|
|
30
|
+
- family-names: Hoes
|
|
31
|
+
given-names: Noor P.
|
|
32
|
+
orcid: https://orcid.org/0009-0005-2024-9676
|
|
33
|
+
- family-names: Luyten
|
|
34
|
+
given-names: Gregorius P.M.
|
|
35
|
+
orcid: https://orcid.org/0000-0003-3685-3868
|
|
36
|
+
- family-names: Rijn
|
|
37
|
+
given-names: Gwyneth A.
|
|
38
|
+
name-particle: van
|
|
39
|
+
orcid: https://orcid.org/0000-0003-3835-1087
|
|
40
|
+
- family-names: Vu
|
|
41
|
+
given-names: T.H. Khanh
|
|
42
|
+
orcid: https://orcid.org/0000-0003-1809-4001
|
|
43
|
+
- family-names: Rasch
|
|
44
|
+
given-names: Coen R.N.
|
|
45
|
+
orcid: https://orcid.org/0000-0001-6950-3376
|
|
46
|
+
- family-names: Horeweg
|
|
47
|
+
given-names: Nanda
|
|
48
|
+
orcid: https://orcid.org/0000-0002-8581-4753
|
|
49
|
+
- family-names: Beenakker
|
|
50
|
+
given-names: Jan-Willem M.
|
|
51
|
+
orcid: "https://orcid.org/0000-0003-0479-5587"
|
|
52
|
+
date-published: 2024-01-25
|
|
53
|
+
doi: 10.1167/iovs.65.1.43
|
|
54
|
+
issn: 1552-5783
|
|
55
|
+
issue: 1
|
|
56
|
+
journal: Investigative Ophthalmology & Visual Science
|
|
57
|
+
start: 43
|
|
58
|
+
title: "Correction Method for Optical Scaling of Fundoscopy Images: Development, Validation, and First Implementation"
|
|
59
|
+
type: article
|
|
60
|
+
url: "https://iovs.arvojournals.org/article.aspx?articleid=2793314"
|
|
61
|
+
volume: 65
|
|
62
|
+
title: "PARaxial Optical fundus Scaling (PAROS)"
|
|
63
|
+
repository-code: 'https://github.com/MREYE-LUMC/PAROS'
|
|
64
|
+
license: MIT
|
|
@@ -41,11 +41,15 @@ def get_camera_calibration_data(manufacturer: str, camera: str) -> pd.DataFrame:
|
|
|
41
41
|
raise KeyError(f"Manufacturer {manufacturer} does not exist.")
|
|
42
42
|
|
|
43
43
|
try:
|
|
44
|
-
camera_data_file = cast(
|
|
44
|
+
camera_data_file = cast(
|
|
45
|
+
"Path", calibration.joinpath(manufacturer, camera + ".csv")
|
|
46
|
+
)
|
|
45
47
|
|
|
46
48
|
return pd.read_csv(camera_data_file)
|
|
47
49
|
except FileNotFoundError as e:
|
|
48
|
-
raise KeyError(
|
|
50
|
+
raise KeyError(
|
|
51
|
+
f"Camera {camera} does not exist for manufacturer {manufacturer}."
|
|
52
|
+
) from e
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
def get_lens_data(name: str) -> pd.DataFrame:
|
|
@@ -64,7 +68,7 @@ def get_lens_data(name: str) -> pd.DataFrame:
|
|
|
64
68
|
Dataframe containing the lens data.
|
|
65
69
|
"""
|
|
66
70
|
try:
|
|
67
|
-
lens_data_file = cast(Path, lenses.joinpath(name + ".csv"))
|
|
71
|
+
lens_data_file = cast("Path", lenses.joinpath(name + ".csv"))
|
|
68
72
|
return pd.read_csv(lens_data_file)
|
|
69
73
|
except FileNotFoundError as e:
|
|
70
74
|
raise KeyError(f"Lens data does not exist for name {name}.") from e
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
experiment_number,lens_1,lens_2,image_size_px,distance_camera_eye_mm,distance_camera_pinhole_mm,distance_pinhole_lens1_mm,distance_lens1_lens2_mm,distance_lens2_grid_mm,axial_length
|
|
2
|
+
0,LB_1471,LB_1945,696.6666667,55,49.61969784,2.880302163,3.027080745,29.69261709,40.71969784
|
|
3
|
+
1,LB_1471,LB_1945,672.6666667,55,49.61969784,2.880302163,3.027080745,31.69261709,42.71969784
|
|
4
|
+
2,LB_1471,LB_1945,660.0,55,49.61969784,2.880302163,3.027080745,33.69261709,44.71969784
|
|
5
|
+
3,LB_1471,LB_1945,637.0,55,49.61969784,2.880302163,3.027080745,35.69261709,46.71969784
|
|
6
|
+
4,LB_1471,LB_1945,625.0,55,49.61969784,2.880302163,3.027080745,37.69261709,48.71969784
|
|
7
|
+
5,LB_1471,LB_1945,608.6666667,55,49.61969784,2.880302163,3.027080745,39.69261709,50.71969784
|
|
8
|
+
6,LB_1471,LB_1945,597.3333333,55,49.61969784,2.880302163,3.027080745,41.69261709,52.71969784
|
|
9
|
+
7,LB_1471,LB_1945,574.6666667,55,49.61969784,2.880302163,3.027080745,43.69261709,54.71969784
|
|
10
|
+
8,LB_1471,LB_1945,561.3333333,55,49.61969784,2.880302163,3.027080745,45.39261709,56.41969784
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
lens_1,lens_2,axial_length,distance_camera_eye_mm,image_size_px,distance_camera_pinhole_mm,distance_pinhole_lens1_mm,distance_lens1_lens2_mm,distance_lens2_grid_mm,experiment_number
|
|
2
|
+
LE_1156,LB_1945,83.9874534,55,331.0,50.2374534,2.262546596,6.344836312,71.54261709,0
|
|
3
|
+
LE_1156,LB_1945,90.7374534,55,313.0,50.2374534,2.262546596,6.344836312,78.29261709,1
|
|
4
|
+
LE_1156,LB_1945,78.0374534,55,346.0,50.2374534,2.262546596,6.344836312,65.59261709,2
|
|
5
|
+
LE_1156,LB_1945,134.6374534,55,224.0,50.2374534,2.262546596,6.344836312,122.1926171,3
|
|
6
|
+
LE_1156,LB_1945,107.9374534,55,269.0,50.2374534,2.262546596,6.344836312,95.49261709,4
|
|
7
|
+
LE_1156,LB_1945,72.0374534,55,371.0,50.2374534,2.262546596,6.344836312,59.59261709,5
|
|
8
|
+
LE_1156,LB_1945,63.6374534,55,408.0,50.2374534,2.262546596,6.344836312,51.19261709,6
|
|
9
|
+
LE_1234,LB_1056,62.51915876,50,428.0,45.31915876,2.180841236,5.205295461,51.1138633,7
|
|
10
|
+
LE_1234,LB_1056,75.91915876,50,366.0,45.31915876,2.180841236,5.205295461,64.5138633,8
|
|
11
|
+
LE_1234,LB_1056,96.51915876,50,298.0,45.31915876,2.180841236,5.205295461,85.1138633,9
|
|
@@ -15,8 +15,6 @@ import sympy as sp
|
|
|
15
15
|
|
|
16
16
|
from PAROS.fundscale import spherical_interface, uniform_medium
|
|
17
17
|
|
|
18
|
-
sp.init_printing(use_unicode=True)
|
|
19
|
-
|
|
20
18
|
|
|
21
19
|
class Lens:
|
|
22
20
|
"""Ray transfer model of a lens."""
|
|
@@ -80,9 +78,13 @@ class Lens:
|
|
|
80
78
|
air_refractive_index = 1.0
|
|
81
79
|
|
|
82
80
|
return (
|
|
83
|
-
spherical_interface(
|
|
81
|
+
spherical_interface(
|
|
82
|
+
self.refractive_index, air_refractive_index, self.back_curvature * 1e-3
|
|
83
|
+
)
|
|
84
84
|
* uniform_medium(self.center_thickness * 1e-3)
|
|
85
|
-
* spherical_interface(
|
|
85
|
+
* spherical_interface(
|
|
86
|
+
air_refractive_index, self.refractive_index, self.front_curvature * 1e-3
|
|
87
|
+
)
|
|
86
88
|
)
|
|
87
89
|
|
|
88
90
|
|
|
@@ -170,7 +172,9 @@ class EyePhantom:
|
|
|
170
172
|
def __str__(self):
|
|
171
173
|
return f"{self.name}"
|
|
172
174
|
|
|
173
|
-
def build_from_dataframe(
|
|
175
|
+
def build_from_dataframe(
|
|
176
|
+
self, experiment: pd.Series, lens_file: pd.DataFrame
|
|
177
|
+
) -> None:
|
|
174
178
|
"""Initializes an `EyePhantom` instance from a pandas DataFrame.
|
|
175
179
|
|
|
176
180
|
Parameters
|