oct-to-tiff 0.3.0__tar.gz → 0.5.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.
- oct_to_tiff-0.5.0/PKG-INFO +217 -0
- {oct_to_tiff-0.3.0 → oct_to_tiff-0.5.0}/README.md +29 -5
- oct_to_tiff-0.5.0/pyproject.toml +55 -0
- oct_to_tiff-0.5.0/setup.cfg +4 -0
- {oct_to_tiff-0.3.0 → oct_to_tiff-0.5.0}/src/oct_to_tiff/cli.py +208 -143
- oct_to_tiff-0.5.0/src/oct_to_tiff.egg-info/PKG-INFO +217 -0
- {oct_to_tiff-0.3.0 → oct_to_tiff-0.5.0}/src/oct_to_tiff.egg-info/SOURCES.txt +0 -2
- oct_to_tiff-0.5.0/src/oct_to_tiff.egg-info/requires.txt +8 -0
- oct_to_tiff-0.3.0/PKG-INFO +0 -154
- oct_to_tiff-0.3.0/pyproject.toml +0 -6
- oct_to_tiff-0.3.0/setup.cfg +0 -43
- oct_to_tiff-0.3.0/setup.py +0 -3
- oct_to_tiff-0.3.0/src/oct_to_tiff.egg-info/PKG-INFO +0 -154
- oct_to_tiff-0.3.0/src/oct_to_tiff.egg-info/requires.txt +0 -2
- {oct_to_tiff-0.3.0 → oct_to_tiff-0.5.0}/LICENSE.txt +0 -0
- {oct_to_tiff-0.3.0 → oct_to_tiff-0.5.0}/src/oct_to_tiff/__init__.py +0 -0
- {oct_to_tiff-0.3.0 → oct_to_tiff-0.5.0}/src/oct_to_tiff.egg-info/dependency_links.txt +0 -0
- {oct_to_tiff-0.3.0 → oct_to_tiff-0.5.0}/src/oct_to_tiff.egg-info/entry_points.txt +0 -0
- {oct_to_tiff-0.3.0 → oct_to_tiff-0.5.0}/src/oct_to_tiff.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: oct-to-tiff
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
5
|
+
Author-email: Cameron Lloyd <lloyd@med.unideb.hu>
|
|
6
|
+
Maintainer-email: Cameron Lloyd <lloyd@med.unideb.hu>
|
|
7
|
+
License: BSD 3-Clause License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2021, Cameron Lloyd
|
|
10
|
+
All rights reserved.
|
|
11
|
+
|
|
12
|
+
Redistribution and use in source and binary forms, with or without
|
|
13
|
+
modification, are permitted provided that the following conditions are met:
|
|
14
|
+
|
|
15
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
16
|
+
list of conditions and the following disclaimer.
|
|
17
|
+
|
|
18
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
19
|
+
this list of conditions and the following disclaimer in the documentation
|
|
20
|
+
and/or other materials provided with the distribution.
|
|
21
|
+
|
|
22
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
23
|
+
contributors may be used to endorse or promote products derived from
|
|
24
|
+
this software without specific prior written permission.
|
|
25
|
+
|
|
26
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
27
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
28
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
29
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
30
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
31
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
32
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
33
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
34
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
35
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
36
|
+
|
|
37
|
+
Project-URL: Homepage, https://github.com/camlloyd/oct-to-tiff
|
|
38
|
+
Project-URL: Bug Tracker, https://github.com/camlloyd/oct-to-tiff/issues
|
|
39
|
+
Project-URL: Changelog, https://github.com/camlloyd/oct-to-tiff/blob/main/CHANGELOG.md
|
|
40
|
+
Keywords: angiography,cli,oct,octa
|
|
41
|
+
Classifier: Development Status :: 3 - Alpha
|
|
42
|
+
Classifier: Intended Audience :: Science/Research
|
|
43
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
44
|
+
Classifier: Natural Language :: English
|
|
45
|
+
Classifier: Operating System :: OS Independent
|
|
46
|
+
Classifier: Programming Language :: Python :: 3
|
|
47
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
48
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
49
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
50
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
51
|
+
Requires-Python: >=3.10
|
|
52
|
+
Description-Content-Type: text/markdown
|
|
53
|
+
License-File: LICENSE.txt
|
|
54
|
+
Requires-Dist: defusedxml
|
|
55
|
+
Requires-Dist: numpy
|
|
56
|
+
Requires-Dist: tifffile
|
|
57
|
+
Provides-Extra: dev
|
|
58
|
+
Requires-Dist: mypy; extra == "dev"
|
|
59
|
+
Requires-Dist: ruff; extra == "dev"
|
|
60
|
+
Requires-Dist: types-defusedxml; extra == "dev"
|
|
61
|
+
|
|
62
|
+
# oct-to-tiff
|
|
63
|
+
|
|
64
|
+
[](https://zenodo.org/badge/latestdoi/382486199)
|
|
65
|
+
[](https://pypi.org/project/oct-to-tiff)
|
|
66
|
+
[](https://github.com/camlloyd/oct-to-tiff/blob/main/LICENSE.txt)
|
|
67
|
+
[](https://pepy.tech/projects/oct-to-tiff)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
via pip:
|
|
74
|
+
|
|
75
|
+
pip install oct-to-tiff
|
|
76
|
+
|
|
77
|
+
via mamba:
|
|
78
|
+
|
|
79
|
+
mamba install -c conda-forge oct-to-tiff
|
|
80
|
+
|
|
81
|
+
## Getting started
|
|
82
|
+
oct-to-tiff /path/to/image.OCT
|
|
83
|
+
|
|
84
|
+
will read an OCT volume and write to a single OME-TIFF file, including voxel size in the metadata.
|
|
85
|
+
|
|
86
|
+
By default, the output file will be written with the same name as the input file and to the same directory:
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
tree /path/to/images
|
|
90
|
+
├── image.OCT
|
|
91
|
+
└── image.ome.tif
|
|
92
|
+
|
|
93
|
+
To specify a custom output directory, see [Optional arguments](#optional-arguments) below.
|
|
94
|
+
|
|
95
|
+
## Batch processing
|
|
96
|
+
``` bash
|
|
97
|
+
for file in *.OCT; do oct-to-tiff "${file}"; done
|
|
98
|
+
```
|
|
99
|
+
will convert all OCT volumes in the current directory to OME-TIFF files, including voxel size in the metadata.
|
|
100
|
+
|
|
101
|
+
## Supported scan patterns
|
|
102
|
+
|
|
103
|
+
This tool has been developed by reverse engineering data from the Optovue RTVue XR Avanti System.
|
|
104
|
+
|
|
105
|
+
Due to limited test data, only the following scan patterns are currently supported:
|
|
106
|
+
|
|
107
|
+
### Structural OCT
|
|
108
|
+
- 3D Cornea
|
|
109
|
+
- 3D Disc
|
|
110
|
+
- 3D Retina
|
|
111
|
+
- 3D Widefield
|
|
112
|
+
- 3D Widefield MCT
|
|
113
|
+
- Angle
|
|
114
|
+
- Cornea Cross Line
|
|
115
|
+
- Cornea Line
|
|
116
|
+
- Cross Line
|
|
117
|
+
- Enhanced HD Line
|
|
118
|
+
- GCC
|
|
119
|
+
- Grid
|
|
120
|
+
- Line
|
|
121
|
+
- ONH (Partial)
|
|
122
|
+
- Pachymetry Wide
|
|
123
|
+
- Radial Lines
|
|
124
|
+
- Raster
|
|
125
|
+
- Retina Map (Partial)
|
|
126
|
+
|
|
127
|
+
### OCT Angiography
|
|
128
|
+
- Angio Disc
|
|
129
|
+
- Angio Retina
|
|
130
|
+
- HD Angio Disc
|
|
131
|
+
- HD Angio Retina
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## Optional arguments
|
|
135
|
+
|
|
136
|
+
To view these options at any time, run `oct-to-tiff --help`.
|
|
137
|
+
|
|
138
|
+
#### `--output OUTPUT`
|
|
139
|
+
**Description**: specify a custom output directory.
|
|
140
|
+
|
|
141
|
+
If the path to the output directory does not exist, a new directory (and parent directories) will be created.
|
|
142
|
+
|
|
143
|
+
**Usage**:
|
|
144
|
+
|
|
145
|
+
oct-to-tiff /path/to/image.OCT --output /path/to/output/directory
|
|
146
|
+
|
|
147
|
+
#### `--overwrite`
|
|
148
|
+
**Description**: overwrite output file if it exists.
|
|
149
|
+
|
|
150
|
+
**Usage**:
|
|
151
|
+
|
|
152
|
+
oct-to-tiff /path/to/image.OCT --overwrite
|
|
153
|
+
|
|
154
|
+
#### `--size SIZE`
|
|
155
|
+
**Description**: scan size in mm.
|
|
156
|
+
|
|
157
|
+
Sets the correct voxel size for scan patterns with adjustable length.
|
|
158
|
+
|
|
159
|
+
**Usage**:
|
|
160
|
+
|
|
161
|
+
oct-to-tiff /path/to/image.OCT --size 4.5
|
|
162
|
+
|
|
163
|
+
#### `--log-level LEVEL`
|
|
164
|
+
**Description**: sets the logging level (default: `WARNING`)
|
|
165
|
+
|
|
166
|
+
**Usage**:
|
|
167
|
+
|
|
168
|
+
oct-to-tiff /path/to/image.OCT --log-level INFO
|
|
169
|
+
|
|
170
|
+
#### `--version`
|
|
171
|
+
**Description**: show program's version number and exit.
|
|
172
|
+
|
|
173
|
+
**Usage**:
|
|
174
|
+
|
|
175
|
+
oct-to-tiff --version
|
|
176
|
+
|
|
177
|
+
#### The following options are mutually exclusive:
|
|
178
|
+
|
|
179
|
+
#### `--angio`
|
|
180
|
+
**Description**: convert extracted OCTA data.
|
|
181
|
+
|
|
182
|
+
Requires `--size SIZE`.
|
|
183
|
+
|
|
184
|
+
**Usage**:
|
|
185
|
+
|
|
186
|
+
oct-to-tiff /path/to/data --angio --size 4.5
|
|
187
|
+
|
|
188
|
+
#### `--en-face`
|
|
189
|
+
**Description**: convert extracted en face data.
|
|
190
|
+
|
|
191
|
+
Requires `--size SIZE`.
|
|
192
|
+
|
|
193
|
+
**Usage**:
|
|
194
|
+
|
|
195
|
+
oct-to-tiff /path/to/data --en-face --size 4.5
|
|
196
|
+
|
|
197
|
+
#### `--seg-curve`
|
|
198
|
+
**Description**: convert extracted segmentation data.
|
|
199
|
+
|
|
200
|
+
**Usage**:
|
|
201
|
+
|
|
202
|
+
oct-to-tiff /path/to/data --seg-curve
|
|
203
|
+
|
|
204
|
+
#### `--boundaries`
|
|
205
|
+
**Description**: extract segmentation lines.
|
|
206
|
+
|
|
207
|
+
**Usage**:
|
|
208
|
+
|
|
209
|
+
oct-to-tiff /path/to/curve.xml --boundaries
|
|
210
|
+
|
|
211
|
+
## Contributing
|
|
212
|
+
|
|
213
|
+
This project uses [Ruff](https://github.com/astral-sh/ruff) for linting and formatting.
|
|
214
|
+
|
|
215
|
+
## Requirements
|
|
216
|
+
|
|
217
|
+
Requires Python 3.10 or higher.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# oct-to-tiff
|
|
2
2
|
|
|
3
3
|
[](https://zenodo.org/badge/latestdoi/382486199)
|
|
4
|
+
[](https://pypi.org/project/oct-to-tiff)
|
|
5
|
+
[](https://github.com/camlloyd/oct-to-tiff/blob/main/LICENSE.txt)
|
|
6
|
+
[](https://pepy.tech/projects/oct-to-tiff)
|
|
7
|
+
|
|
4
8
|
|
|
5
9
|
A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
6
10
|
|
|
@@ -9,9 +13,9 @@ via pip:
|
|
|
9
13
|
|
|
10
14
|
pip install oct-to-tiff
|
|
11
15
|
|
|
12
|
-
via
|
|
16
|
+
via mamba:
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
mamba install -c conda-forge oct-to-tiff
|
|
15
19
|
|
|
16
20
|
## Getting started
|
|
17
21
|
oct-to-tiff /path/to/image.OCT
|
|
@@ -27,6 +31,12 @@ By default, the output file will be written with the same name as the input file
|
|
|
27
31
|
|
|
28
32
|
To specify a custom output directory, see [Optional arguments](#optional-arguments) below.
|
|
29
33
|
|
|
34
|
+
## Batch processing
|
|
35
|
+
``` bash
|
|
36
|
+
for file in *.OCT; do oct-to-tiff "${file}"; done
|
|
37
|
+
```
|
|
38
|
+
will convert all OCT volumes in the current directory to OME-TIFF files, including voxel size in the metadata.
|
|
39
|
+
|
|
30
40
|
## Supported scan patterns
|
|
31
41
|
|
|
32
42
|
This tool has been developed by reverse engineering data from the Optovue RTVue XR Avanti System.
|
|
@@ -89,6 +99,13 @@ Sets the correct voxel size for scan patterns with adjustable length.
|
|
|
89
99
|
|
|
90
100
|
oct-to-tiff /path/to/image.OCT --size 4.5
|
|
91
101
|
|
|
102
|
+
#### `--log-level LEVEL`
|
|
103
|
+
**Description**: sets the logging level (default: `WARNING`)
|
|
104
|
+
|
|
105
|
+
**Usage**:
|
|
106
|
+
|
|
107
|
+
oct-to-tiff /path/to/image.OCT --log-level INFO
|
|
108
|
+
|
|
92
109
|
#### `--version`
|
|
93
110
|
**Description**: show program's version number and exit.
|
|
94
111
|
|
|
@@ -96,7 +113,7 @@ Sets the correct voxel size for scan patterns with adjustable length.
|
|
|
96
113
|
|
|
97
114
|
oct-to-tiff --version
|
|
98
115
|
|
|
99
|
-
#### The following options are
|
|
116
|
+
#### The following options are mutually exclusive:
|
|
100
117
|
|
|
101
118
|
#### `--angio`
|
|
102
119
|
**Description**: convert extracted OCTA data.
|
|
@@ -123,10 +140,17 @@ Requires `--size SIZE`.
|
|
|
123
140
|
|
|
124
141
|
oct-to-tiff /path/to/data --seg-curve
|
|
125
142
|
|
|
143
|
+
#### `--boundaries`
|
|
144
|
+
**Description**: extract segmentation lines.
|
|
145
|
+
|
|
146
|
+
**Usage**:
|
|
147
|
+
|
|
148
|
+
oct-to-tiff /path/to/curve.xml --boundaries
|
|
149
|
+
|
|
126
150
|
## Contributing
|
|
127
151
|
|
|
128
|
-
This project uses [
|
|
152
|
+
This project uses [Ruff](https://github.com/astral-sh/ruff) for linting and formatting.
|
|
129
153
|
|
|
130
154
|
## Requirements
|
|
131
155
|
|
|
132
|
-
Requires Python 3.
|
|
156
|
+
Requires Python 3.10 or higher.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "oct-to-tiff"
|
|
7
|
+
version = "0.5.0"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"defusedxml",
|
|
10
|
+
"numpy",
|
|
11
|
+
"tifffile",
|
|
12
|
+
]
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
authors = [{name = "Cameron Lloyd", email = "lloyd@med.unideb.hu"}]
|
|
15
|
+
maintainers = [{name = "Cameron Lloyd", email = "lloyd@med.unideb.hu"}]
|
|
16
|
+
description = "A command line tool for converting optical coherence tomography angiography (OCTA) data."
|
|
17
|
+
readme = "README.md"
|
|
18
|
+
license = {file = "LICENSE.txt"}
|
|
19
|
+
keywords = ["angiography", "cli", "oct", "octa"]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 3 - Alpha",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"License :: OSI Approved :: BSD License",
|
|
24
|
+
"Natural Language :: English",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: Python :: 3.10",
|
|
28
|
+
"Programming Language :: Python :: 3.11",
|
|
29
|
+
"Programming Language :: Python :: 3.12",
|
|
30
|
+
"Programming Language :: Python :: 3.13",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = [
|
|
35
|
+
"mypy",
|
|
36
|
+
"ruff",
|
|
37
|
+
"types-defusedxml"
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.urls]
|
|
41
|
+
Homepage = "https://github.com/camlloyd/oct-to-tiff"
|
|
42
|
+
"Bug Tracker" = "https://github.com/camlloyd/oct-to-tiff/issues"
|
|
43
|
+
Changelog = "https://github.com/camlloyd/oct-to-tiff/blob/main/CHANGELOG.md"
|
|
44
|
+
|
|
45
|
+
[project.scripts]
|
|
46
|
+
oct-to-tiff = "oct_to_tiff.cli:main"
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.packages.find]
|
|
49
|
+
where = ["src"]
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint]
|
|
52
|
+
select = [
|
|
53
|
+
"I", # isort
|
|
54
|
+
"S", # flake8-bandit
|
|
55
|
+
]
|
|
@@ -1,17 +1,221 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import logging
|
|
3
|
+
from importlib.metadata import version
|
|
3
4
|
from pathlib import Path
|
|
5
|
+
from typing import Any
|
|
4
6
|
|
|
7
|
+
import defusedxml.ElementTree as DET
|
|
5
8
|
import numpy as np
|
|
6
9
|
import tifffile
|
|
10
|
+
from numpy.typing import NDArray
|
|
7
11
|
|
|
8
|
-
logging.basicConfig(
|
|
9
|
-
format="%(asctime)s %(name)s:%(funcName)s %(levelname)s - %(message)s"
|
|
10
|
-
)
|
|
11
12
|
logger = logging.getLogger(__name__)
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
def
|
|
15
|
+
def reshape_volume(
|
|
16
|
+
volume: NDArray[Any],
|
|
17
|
+
frames_per_data_group: int,
|
|
18
|
+
total_data_groups: int,
|
|
19
|
+
oct_window_height: int,
|
|
20
|
+
xy_scan_length: int,
|
|
21
|
+
) -> NDArray[Any]:
|
|
22
|
+
"""Reshape a 1-dimensional array to a 3-dimensional array.
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
volume : NDArray[Any]
|
|
27
|
+
A 1-dimensional array.
|
|
28
|
+
frames_per_data_group : int
|
|
29
|
+
The number of frames per data group.
|
|
30
|
+
total_data_groups : int
|
|
31
|
+
The total number of data groups.
|
|
32
|
+
oct_window_height : int
|
|
33
|
+
The OCT window height.
|
|
34
|
+
xy_scan_length : int
|
|
35
|
+
The XY scan length.
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
volume : NDArray[Any]
|
|
40
|
+
A 3-dimensional array.
|
|
41
|
+
|
|
42
|
+
"""
|
|
43
|
+
volume = np.reshape(
|
|
44
|
+
volume,
|
|
45
|
+
(
|
|
46
|
+
frames_per_data_group * total_data_groups,
|
|
47
|
+
xy_scan_length,
|
|
48
|
+
oct_window_height,
|
|
49
|
+
),
|
|
50
|
+
)
|
|
51
|
+
return volume
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def rotate_volume(
|
|
55
|
+
volume: NDArray[Any],
|
|
56
|
+
) -> NDArray[Any]:
|
|
57
|
+
"""Rotate a 3-dimensional array 90 degrees left (anti-clockwise) about the z-axis.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
volume : NDArray[Any]
|
|
62
|
+
A 3-dimensional array.
|
|
63
|
+
|
|
64
|
+
Returns
|
|
65
|
+
-------
|
|
66
|
+
volume : NDArray[Any]
|
|
67
|
+
A rotated version of the input volume.
|
|
68
|
+
|
|
69
|
+
"""
|
|
70
|
+
volume = np.rot90(volume, k=1, axes=(1, 2))
|
|
71
|
+
return volume
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def write_volume(
|
|
75
|
+
output_path: Path,
|
|
76
|
+
volume: NDArray[Any],
|
|
77
|
+
pixel_size_x: float,
|
|
78
|
+
pixel_size_y: float,
|
|
79
|
+
pixel_size_z: float,
|
|
80
|
+
) -> None:
|
|
81
|
+
"""Write a 3-dimensional array to the output path as an OME-TIFF file, including voxel size in the metadata.
|
|
82
|
+
|
|
83
|
+
Parameters
|
|
84
|
+
----------
|
|
85
|
+
output_path : Path
|
|
86
|
+
The specified output path.
|
|
87
|
+
volume : NDArray[Any]
|
|
88
|
+
A 3-dimensional array.
|
|
89
|
+
pixel_size_x : float
|
|
90
|
+
The pixel (voxel) width in mm.
|
|
91
|
+
pixel_size_y : float
|
|
92
|
+
The pixel (voxel) height in mm.
|
|
93
|
+
pixel_size_z : float
|
|
94
|
+
The pixel (voxel) depth in mm.
|
|
95
|
+
|
|
96
|
+
"""
|
|
97
|
+
tifffile.imwrite(
|
|
98
|
+
output_path,
|
|
99
|
+
volume,
|
|
100
|
+
photometric="minisblack",
|
|
101
|
+
metadata={
|
|
102
|
+
"axes": "ZYX",
|
|
103
|
+
"PhysicalSizeX": pixel_size_x,
|
|
104
|
+
"PhysicalSizeXUnit": "mm",
|
|
105
|
+
"PhysicalSizeY": pixel_size_y,
|
|
106
|
+
"PhysicalSizeYUnit": "mm",
|
|
107
|
+
"PhysicalSizeZ": pixel_size_z,
|
|
108
|
+
"PhysicalSizeZUnit": "mm",
|
|
109
|
+
},
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def extract_boundaries(input_path: str | Path) -> None:
|
|
114
|
+
"""Extract segmentation lines.
|
|
115
|
+
|
|
116
|
+
Parameters
|
|
117
|
+
----------
|
|
118
|
+
input_path : str | Path
|
|
119
|
+
The specified input path.
|
|
120
|
+
|
|
121
|
+
"""
|
|
122
|
+
input_path = Path(input_path)
|
|
123
|
+
tree = DET.parse(input_path)
|
|
124
|
+
root = tree.getroot()
|
|
125
|
+
|
|
126
|
+
array_size = int(root.findtext("./Curve_Set/Image/Curve/ARRAY", 0))
|
|
127
|
+
data_points = [
|
|
128
|
+
int(point.text) if point.text else 0
|
|
129
|
+
for point in root.findall("./Curve_Set/Image/Curve/D")
|
|
130
|
+
]
|
|
131
|
+
scan_length = np.arange(len(data_points))
|
|
132
|
+
num_files = len(data_points) // array_size
|
|
133
|
+
for i in range(num_files):
|
|
134
|
+
start = i * array_size
|
|
135
|
+
end = start + array_size
|
|
136
|
+
table = np.column_stack([scan_length[start:end], data_points[start:end]])
|
|
137
|
+
table_path = f"{input_path.parent}/{input_path.stem}_{i+1}.txt"
|
|
138
|
+
np.savetxt(table_path, table, delimiter="\t", fmt="%d")
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def main() -> None:
|
|
142
|
+
parser = argparse.ArgumentParser(
|
|
143
|
+
description="Convert optical coherence tomography angiography (OCTA) data."
|
|
144
|
+
)
|
|
145
|
+
parser.add_argument("input", type=Path, help="OCT file to convert")
|
|
146
|
+
parser.add_argument("--output", type=Path, help="specify a custom output directory")
|
|
147
|
+
parser.add_argument(
|
|
148
|
+
"--overwrite",
|
|
149
|
+
default=False,
|
|
150
|
+
action="store_true",
|
|
151
|
+
help="overwrite output file if it exists",
|
|
152
|
+
)
|
|
153
|
+
parser.add_argument("--size", type=float, help="scan size in mm")
|
|
154
|
+
group = parser.add_mutually_exclusive_group()
|
|
155
|
+
group.add_argument(
|
|
156
|
+
"--angio",
|
|
157
|
+
default=False,
|
|
158
|
+
action="store_true",
|
|
159
|
+
help="convert extracted OCTA data",
|
|
160
|
+
)
|
|
161
|
+
group.add_argument(
|
|
162
|
+
"--en-face",
|
|
163
|
+
default=False,
|
|
164
|
+
action="store_true",
|
|
165
|
+
help="convert extracted en face image",
|
|
166
|
+
)
|
|
167
|
+
group.add_argument(
|
|
168
|
+
"--seg-curve",
|
|
169
|
+
default=False,
|
|
170
|
+
action="store_true",
|
|
171
|
+
help="convert extracted segmentation data",
|
|
172
|
+
)
|
|
173
|
+
group.add_argument(
|
|
174
|
+
"--boundaries",
|
|
175
|
+
default=False,
|
|
176
|
+
action="store_true",
|
|
177
|
+
help="extract segmentation lines",
|
|
178
|
+
)
|
|
179
|
+
parser.add_argument(
|
|
180
|
+
"--log-level",
|
|
181
|
+
default="WARNING",
|
|
182
|
+
metavar="LEVEL",
|
|
183
|
+
help="sets the logging level (default: %(default)s)",
|
|
184
|
+
)
|
|
185
|
+
parser.add_argument(
|
|
186
|
+
"--version", action="version", version="%(prog)s " + version("oct_to_tiff")
|
|
187
|
+
)
|
|
188
|
+
args = parser.parse_args()
|
|
189
|
+
|
|
190
|
+
numeric_level = getattr(logging, args.log_level.upper(), None)
|
|
191
|
+
if not isinstance(numeric_level, int):
|
|
192
|
+
raise ValueError(f"Invalid log level: {args.log_level}")
|
|
193
|
+
logging.basicConfig(
|
|
194
|
+
level=numeric_level,
|
|
195
|
+
format="%(asctime)s %(name)s:%(funcName)s %(levelname)s - %(message)s",
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
input_path = args.input
|
|
199
|
+
if args.output:
|
|
200
|
+
dir_name = args.output
|
|
201
|
+
dir_name.mkdir(parents=True, exist_ok=True)
|
|
202
|
+
else:
|
|
203
|
+
dir_name = input_path.parent
|
|
204
|
+
file_name = input_path.stem
|
|
205
|
+
file_extension = ".ome.tif"
|
|
206
|
+
output_path = dir_name / (file_name + file_extension)
|
|
207
|
+
|
|
208
|
+
if Path.is_file(output_path):
|
|
209
|
+
if args.overwrite:
|
|
210
|
+
pass
|
|
211
|
+
else:
|
|
212
|
+
logger.error(f"{output_path} already exists.")
|
|
213
|
+
return
|
|
214
|
+
|
|
215
|
+
if args.boundaries:
|
|
216
|
+
extract_boundaries(input_path)
|
|
217
|
+
return
|
|
218
|
+
|
|
15
219
|
with open(input_path, "rb") as f:
|
|
16
220
|
if args.angio and args.size:
|
|
17
221
|
volume = np.frombuffer(f.read(), dtype=np.uint16)
|
|
@@ -266,144 +470,5 @@ def convert_oct_file(args, file_name, input_path, output_path):
|
|
|
266
470
|
write_volume(output_path, volume, pixel_size_x, pixel_size_y, pixel_size_z)
|
|
267
471
|
|
|
268
472
|
|
|
269
|
-
def reshape_volume(
|
|
270
|
-
volume, frames_per_data_group, total_data_groups, oct_window_height, xy_scan_length
|
|
271
|
-
):
|
|
272
|
-
"""Reshape a 1-dimensional array to a 3-dimensional array.
|
|
273
|
-
|
|
274
|
-
Parameters
|
|
275
|
-
----------
|
|
276
|
-
volume : ndarray
|
|
277
|
-
A 1-dimensional array.
|
|
278
|
-
frames_per_data_group : int
|
|
279
|
-
The number of frames per data group.
|
|
280
|
-
total_data_groups : int
|
|
281
|
-
The total number of data groups.
|
|
282
|
-
oct_window_height : int
|
|
283
|
-
The OCT window height.
|
|
284
|
-
xy_scan_length : int
|
|
285
|
-
The XY scan length.
|
|
286
|
-
|
|
287
|
-
Returns
|
|
288
|
-
-------
|
|
289
|
-
volume : ndarray
|
|
290
|
-
A 3-dimensional array.
|
|
291
|
-
|
|
292
|
-
"""
|
|
293
|
-
volume = np.reshape(
|
|
294
|
-
volume,
|
|
295
|
-
(
|
|
296
|
-
frames_per_data_group * total_data_groups,
|
|
297
|
-
xy_scan_length,
|
|
298
|
-
oct_window_height,
|
|
299
|
-
),
|
|
300
|
-
)
|
|
301
|
-
return volume
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
def rotate_volume(volume):
|
|
305
|
-
"""Rotate a 3-dimensional array 90 degrees left (anti-clockwise) about the z-axis.
|
|
306
|
-
|
|
307
|
-
Parameters
|
|
308
|
-
----------
|
|
309
|
-
volume : ndarray
|
|
310
|
-
A 3-dimensional array.
|
|
311
|
-
|
|
312
|
-
Returns
|
|
313
|
-
-------
|
|
314
|
-
volume : ndarray
|
|
315
|
-
A rotated version of the input volume.
|
|
316
|
-
|
|
317
|
-
"""
|
|
318
|
-
volume = np.rot90(volume, k=1, axes=(1, 2))
|
|
319
|
-
return volume
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
def write_volume(output_path, volume, pixel_size_x, pixel_size_y, pixel_size_z):
|
|
323
|
-
"""Write a 3-dimensional array to the output path as an OME-TIFF file, including voxel size in the metadata.
|
|
324
|
-
|
|
325
|
-
Parameters
|
|
326
|
-
----------
|
|
327
|
-
output_path : Path
|
|
328
|
-
The specified output path.
|
|
329
|
-
volume : ndarray
|
|
330
|
-
A 3-dimensional array.
|
|
331
|
-
pixel_size_x : float
|
|
332
|
-
The pixel (voxel) width in mm.
|
|
333
|
-
pixel_size_y : float
|
|
334
|
-
The pixel (voxel) height in mm.
|
|
335
|
-
pixel_size_z : float
|
|
336
|
-
The pixel (voxel) depth in mm.
|
|
337
|
-
|
|
338
|
-
"""
|
|
339
|
-
tifffile.imwrite(
|
|
340
|
-
output_path,
|
|
341
|
-
volume,
|
|
342
|
-
photometric="minisblack",
|
|
343
|
-
metadata={
|
|
344
|
-
"axes": "ZYX",
|
|
345
|
-
"PhysicalSizeX": pixel_size_x,
|
|
346
|
-
"PhysicalSizeXUnit": "mm",
|
|
347
|
-
"PhysicalSizeY": pixel_size_y,
|
|
348
|
-
"PhysicalSizeYUnit": "mm",
|
|
349
|
-
"PhysicalSizeZ": pixel_size_z,
|
|
350
|
-
"PhysicalSizeZUnit": "mm",
|
|
351
|
-
},
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
def main():
|
|
356
|
-
parser = argparse.ArgumentParser(
|
|
357
|
-
description="Convert optical coherence tomography angiography (OCTA) data."
|
|
358
|
-
)
|
|
359
|
-
parser.add_argument("input", type=Path, help="OCT file to convert")
|
|
360
|
-
parser.add_argument("--output", type=Path, help="specify a custom output directory")
|
|
361
|
-
parser.add_argument(
|
|
362
|
-
"--overwrite",
|
|
363
|
-
default=False,
|
|
364
|
-
action="store_true",
|
|
365
|
-
help="overwrite output file if it exists",
|
|
366
|
-
)
|
|
367
|
-
parser.add_argument("--size", type=float, help="scan size in mm")
|
|
368
|
-
parser.add_argument(
|
|
369
|
-
"--angio",
|
|
370
|
-
default=False,
|
|
371
|
-
action="store_true",
|
|
372
|
-
help="convert extracted OCTA data",
|
|
373
|
-
)
|
|
374
|
-
parser.add_argument(
|
|
375
|
-
"--en-face",
|
|
376
|
-
default=False,
|
|
377
|
-
action="store_true",
|
|
378
|
-
help="convert extracted en face image",
|
|
379
|
-
)
|
|
380
|
-
parser.add_argument(
|
|
381
|
-
"--seg-curve",
|
|
382
|
-
default=False,
|
|
383
|
-
action="store_true",
|
|
384
|
-
help="convert extracted segmentation data",
|
|
385
|
-
)
|
|
386
|
-
parser.add_argument("--version", action="version", version="%(prog)s 0.3.0")
|
|
387
|
-
args = parser.parse_args()
|
|
388
|
-
|
|
389
|
-
input_path = args.input
|
|
390
|
-
if args.output:
|
|
391
|
-
dir_name = args.output
|
|
392
|
-
dir_name.mkdir(parents=True, exist_ok=True)
|
|
393
|
-
else:
|
|
394
|
-
dir_name = input_path.parent
|
|
395
|
-
file_name = input_path.stem
|
|
396
|
-
file_extension = ".ome.tif"
|
|
397
|
-
output_path = dir_name / (file_name + file_extension)
|
|
398
|
-
|
|
399
|
-
if Path.is_file(output_path):
|
|
400
|
-
if args.overwrite:
|
|
401
|
-
convert_oct_file(args, file_name, input_path, output_path)
|
|
402
|
-
else:
|
|
403
|
-
logger.error(f"{output_path} already exists.")
|
|
404
|
-
else:
|
|
405
|
-
convert_oct_file(args, file_name, input_path, output_path)
|
|
406
|
-
|
|
407
|
-
|
|
408
473
|
if __name__ == "__main__":
|
|
409
474
|
main()
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: oct-to-tiff
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
5
|
+
Author-email: Cameron Lloyd <lloyd@med.unideb.hu>
|
|
6
|
+
Maintainer-email: Cameron Lloyd <lloyd@med.unideb.hu>
|
|
7
|
+
License: BSD 3-Clause License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2021, Cameron Lloyd
|
|
10
|
+
All rights reserved.
|
|
11
|
+
|
|
12
|
+
Redistribution and use in source and binary forms, with or without
|
|
13
|
+
modification, are permitted provided that the following conditions are met:
|
|
14
|
+
|
|
15
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
16
|
+
list of conditions and the following disclaimer.
|
|
17
|
+
|
|
18
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
19
|
+
this list of conditions and the following disclaimer in the documentation
|
|
20
|
+
and/or other materials provided with the distribution.
|
|
21
|
+
|
|
22
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
23
|
+
contributors may be used to endorse or promote products derived from
|
|
24
|
+
this software without specific prior written permission.
|
|
25
|
+
|
|
26
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
27
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
28
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
29
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
30
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
31
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
32
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
33
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
34
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
35
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
36
|
+
|
|
37
|
+
Project-URL: Homepage, https://github.com/camlloyd/oct-to-tiff
|
|
38
|
+
Project-URL: Bug Tracker, https://github.com/camlloyd/oct-to-tiff/issues
|
|
39
|
+
Project-URL: Changelog, https://github.com/camlloyd/oct-to-tiff/blob/main/CHANGELOG.md
|
|
40
|
+
Keywords: angiography,cli,oct,octa
|
|
41
|
+
Classifier: Development Status :: 3 - Alpha
|
|
42
|
+
Classifier: Intended Audience :: Science/Research
|
|
43
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
44
|
+
Classifier: Natural Language :: English
|
|
45
|
+
Classifier: Operating System :: OS Independent
|
|
46
|
+
Classifier: Programming Language :: Python :: 3
|
|
47
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
48
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
49
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
50
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
51
|
+
Requires-Python: >=3.10
|
|
52
|
+
Description-Content-Type: text/markdown
|
|
53
|
+
License-File: LICENSE.txt
|
|
54
|
+
Requires-Dist: defusedxml
|
|
55
|
+
Requires-Dist: numpy
|
|
56
|
+
Requires-Dist: tifffile
|
|
57
|
+
Provides-Extra: dev
|
|
58
|
+
Requires-Dist: mypy; extra == "dev"
|
|
59
|
+
Requires-Dist: ruff; extra == "dev"
|
|
60
|
+
Requires-Dist: types-defusedxml; extra == "dev"
|
|
61
|
+
|
|
62
|
+
# oct-to-tiff
|
|
63
|
+
|
|
64
|
+
[](https://zenodo.org/badge/latestdoi/382486199)
|
|
65
|
+
[](https://pypi.org/project/oct-to-tiff)
|
|
66
|
+
[](https://github.com/camlloyd/oct-to-tiff/blob/main/LICENSE.txt)
|
|
67
|
+
[](https://pepy.tech/projects/oct-to-tiff)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
via pip:
|
|
74
|
+
|
|
75
|
+
pip install oct-to-tiff
|
|
76
|
+
|
|
77
|
+
via mamba:
|
|
78
|
+
|
|
79
|
+
mamba install -c conda-forge oct-to-tiff
|
|
80
|
+
|
|
81
|
+
## Getting started
|
|
82
|
+
oct-to-tiff /path/to/image.OCT
|
|
83
|
+
|
|
84
|
+
will read an OCT volume and write to a single OME-TIFF file, including voxel size in the metadata.
|
|
85
|
+
|
|
86
|
+
By default, the output file will be written with the same name as the input file and to the same directory:
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
tree /path/to/images
|
|
90
|
+
├── image.OCT
|
|
91
|
+
└── image.ome.tif
|
|
92
|
+
|
|
93
|
+
To specify a custom output directory, see [Optional arguments](#optional-arguments) below.
|
|
94
|
+
|
|
95
|
+
## Batch processing
|
|
96
|
+
``` bash
|
|
97
|
+
for file in *.OCT; do oct-to-tiff "${file}"; done
|
|
98
|
+
```
|
|
99
|
+
will convert all OCT volumes in the current directory to OME-TIFF files, including voxel size in the metadata.
|
|
100
|
+
|
|
101
|
+
## Supported scan patterns
|
|
102
|
+
|
|
103
|
+
This tool has been developed by reverse engineering data from the Optovue RTVue XR Avanti System.
|
|
104
|
+
|
|
105
|
+
Due to limited test data, only the following scan patterns are currently supported:
|
|
106
|
+
|
|
107
|
+
### Structural OCT
|
|
108
|
+
- 3D Cornea
|
|
109
|
+
- 3D Disc
|
|
110
|
+
- 3D Retina
|
|
111
|
+
- 3D Widefield
|
|
112
|
+
- 3D Widefield MCT
|
|
113
|
+
- Angle
|
|
114
|
+
- Cornea Cross Line
|
|
115
|
+
- Cornea Line
|
|
116
|
+
- Cross Line
|
|
117
|
+
- Enhanced HD Line
|
|
118
|
+
- GCC
|
|
119
|
+
- Grid
|
|
120
|
+
- Line
|
|
121
|
+
- ONH (Partial)
|
|
122
|
+
- Pachymetry Wide
|
|
123
|
+
- Radial Lines
|
|
124
|
+
- Raster
|
|
125
|
+
- Retina Map (Partial)
|
|
126
|
+
|
|
127
|
+
### OCT Angiography
|
|
128
|
+
- Angio Disc
|
|
129
|
+
- Angio Retina
|
|
130
|
+
- HD Angio Disc
|
|
131
|
+
- HD Angio Retina
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## Optional arguments
|
|
135
|
+
|
|
136
|
+
To view these options at any time, run `oct-to-tiff --help`.
|
|
137
|
+
|
|
138
|
+
#### `--output OUTPUT`
|
|
139
|
+
**Description**: specify a custom output directory.
|
|
140
|
+
|
|
141
|
+
If the path to the output directory does not exist, a new directory (and parent directories) will be created.
|
|
142
|
+
|
|
143
|
+
**Usage**:
|
|
144
|
+
|
|
145
|
+
oct-to-tiff /path/to/image.OCT --output /path/to/output/directory
|
|
146
|
+
|
|
147
|
+
#### `--overwrite`
|
|
148
|
+
**Description**: overwrite output file if it exists.
|
|
149
|
+
|
|
150
|
+
**Usage**:
|
|
151
|
+
|
|
152
|
+
oct-to-tiff /path/to/image.OCT --overwrite
|
|
153
|
+
|
|
154
|
+
#### `--size SIZE`
|
|
155
|
+
**Description**: scan size in mm.
|
|
156
|
+
|
|
157
|
+
Sets the correct voxel size for scan patterns with adjustable length.
|
|
158
|
+
|
|
159
|
+
**Usage**:
|
|
160
|
+
|
|
161
|
+
oct-to-tiff /path/to/image.OCT --size 4.5
|
|
162
|
+
|
|
163
|
+
#### `--log-level LEVEL`
|
|
164
|
+
**Description**: sets the logging level (default: `WARNING`)
|
|
165
|
+
|
|
166
|
+
**Usage**:
|
|
167
|
+
|
|
168
|
+
oct-to-tiff /path/to/image.OCT --log-level INFO
|
|
169
|
+
|
|
170
|
+
#### `--version`
|
|
171
|
+
**Description**: show program's version number and exit.
|
|
172
|
+
|
|
173
|
+
**Usage**:
|
|
174
|
+
|
|
175
|
+
oct-to-tiff --version
|
|
176
|
+
|
|
177
|
+
#### The following options are mutually exclusive:
|
|
178
|
+
|
|
179
|
+
#### `--angio`
|
|
180
|
+
**Description**: convert extracted OCTA data.
|
|
181
|
+
|
|
182
|
+
Requires `--size SIZE`.
|
|
183
|
+
|
|
184
|
+
**Usage**:
|
|
185
|
+
|
|
186
|
+
oct-to-tiff /path/to/data --angio --size 4.5
|
|
187
|
+
|
|
188
|
+
#### `--en-face`
|
|
189
|
+
**Description**: convert extracted en face data.
|
|
190
|
+
|
|
191
|
+
Requires `--size SIZE`.
|
|
192
|
+
|
|
193
|
+
**Usage**:
|
|
194
|
+
|
|
195
|
+
oct-to-tiff /path/to/data --en-face --size 4.5
|
|
196
|
+
|
|
197
|
+
#### `--seg-curve`
|
|
198
|
+
**Description**: convert extracted segmentation data.
|
|
199
|
+
|
|
200
|
+
**Usage**:
|
|
201
|
+
|
|
202
|
+
oct-to-tiff /path/to/data --seg-curve
|
|
203
|
+
|
|
204
|
+
#### `--boundaries`
|
|
205
|
+
**Description**: extract segmentation lines.
|
|
206
|
+
|
|
207
|
+
**Usage**:
|
|
208
|
+
|
|
209
|
+
oct-to-tiff /path/to/curve.xml --boundaries
|
|
210
|
+
|
|
211
|
+
## Contributing
|
|
212
|
+
|
|
213
|
+
This project uses [Ruff](https://github.com/astral-sh/ruff) for linting and formatting.
|
|
214
|
+
|
|
215
|
+
## Requirements
|
|
216
|
+
|
|
217
|
+
Requires Python 3.10 or higher.
|
oct_to_tiff-0.3.0/PKG-INFO
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: oct_to_tiff
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
5
|
-
Home-page: https://github.com/camlloyd/oct-to-tiff
|
|
6
|
-
Author: Cameron Lloyd
|
|
7
|
-
Author-email: lloyd@med.unideb.hu
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/camlloyd/oct-to-tiff/issues
|
|
9
|
-
Classifier: Development Status :: 3 - Alpha
|
|
10
|
-
Classifier: Intended Audience :: Science/Research
|
|
11
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
12
|
-
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Requires-Python: >=3.7
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE.txt
|
|
22
|
-
|
|
23
|
-
# oct-to-tiff
|
|
24
|
-
|
|
25
|
-
[](https://zenodo.org/badge/latestdoi/382486199)
|
|
26
|
-
|
|
27
|
-
A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
28
|
-
|
|
29
|
-
## Installation
|
|
30
|
-
via pip:
|
|
31
|
-
|
|
32
|
-
pip install oct-to-tiff
|
|
33
|
-
|
|
34
|
-
via conda:
|
|
35
|
-
|
|
36
|
-
conda install -c conda-forge oct-to-tiff
|
|
37
|
-
|
|
38
|
-
## Getting started
|
|
39
|
-
oct-to-tiff /path/to/image.OCT
|
|
40
|
-
|
|
41
|
-
will read an OCT volume and write to a single OME-TIFF file, including voxel size in the metadata.
|
|
42
|
-
|
|
43
|
-
By default, the output file will be written with the same name as the input file and to the same directory:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
tree /path/to/images
|
|
47
|
-
├── image.OCT
|
|
48
|
-
└── image.ome.tif
|
|
49
|
-
|
|
50
|
-
To specify a custom output directory, see [Optional arguments](#optional-arguments) below.
|
|
51
|
-
|
|
52
|
-
## Supported scan patterns
|
|
53
|
-
|
|
54
|
-
This tool has been developed by reverse engineering data from the Optovue RTVue XR Avanti System.
|
|
55
|
-
|
|
56
|
-
Due to limited test data, only the following scan patterns are currently supported:
|
|
57
|
-
|
|
58
|
-
### Structural OCT
|
|
59
|
-
- 3D Cornea
|
|
60
|
-
- 3D Disc
|
|
61
|
-
- 3D Retina
|
|
62
|
-
- 3D Widefield
|
|
63
|
-
- 3D Widefield MCT
|
|
64
|
-
- Angle
|
|
65
|
-
- Cornea Cross Line
|
|
66
|
-
- Cornea Line
|
|
67
|
-
- Cross Line
|
|
68
|
-
- Enhanced HD Line
|
|
69
|
-
- GCC
|
|
70
|
-
- Grid
|
|
71
|
-
- Line
|
|
72
|
-
- ONH (Partial)
|
|
73
|
-
- Pachymetry Wide
|
|
74
|
-
- Radial Lines
|
|
75
|
-
- Raster
|
|
76
|
-
- Retina Map (Partial)
|
|
77
|
-
|
|
78
|
-
### OCT Angiography
|
|
79
|
-
- Angio Disc
|
|
80
|
-
- Angio Retina
|
|
81
|
-
- HD Angio Disc
|
|
82
|
-
- HD Angio Retina
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
## Optional arguments
|
|
86
|
-
|
|
87
|
-
To view these options at any time, run `oct-to-tiff --help`.
|
|
88
|
-
|
|
89
|
-
#### `--output OUTPUT`
|
|
90
|
-
**Description**: specify a custom output directory.
|
|
91
|
-
|
|
92
|
-
If the path to the output directory does not exist, a new directory (and parent directories) will be created.
|
|
93
|
-
|
|
94
|
-
**Usage**:
|
|
95
|
-
|
|
96
|
-
oct-to-tiff /path/to/image.OCT --output /path/to/output/directory
|
|
97
|
-
|
|
98
|
-
#### `--overwrite`
|
|
99
|
-
**Description**: overwrite output file if it exists.
|
|
100
|
-
|
|
101
|
-
**Usage**:
|
|
102
|
-
|
|
103
|
-
oct-to-tiff /path/to/image.OCT --overwrite
|
|
104
|
-
|
|
105
|
-
#### `--size SIZE`
|
|
106
|
-
**Description**: scan size in mm.
|
|
107
|
-
|
|
108
|
-
Sets the correct voxel size for scan patterns with adjustable length.
|
|
109
|
-
|
|
110
|
-
**Usage**:
|
|
111
|
-
|
|
112
|
-
oct-to-tiff /path/to/image.OCT --size 4.5
|
|
113
|
-
|
|
114
|
-
#### `--version`
|
|
115
|
-
**Description**: show program's version number and exit.
|
|
116
|
-
|
|
117
|
-
**Usage**:
|
|
118
|
-
|
|
119
|
-
oct-to-tiff --version
|
|
120
|
-
|
|
121
|
-
#### The following options are currently experimental:
|
|
122
|
-
|
|
123
|
-
#### `--angio`
|
|
124
|
-
**Description**: convert extracted OCTA data.
|
|
125
|
-
|
|
126
|
-
Requires `--size SIZE`.
|
|
127
|
-
|
|
128
|
-
**Usage**:
|
|
129
|
-
|
|
130
|
-
oct-to-tiff /path/to/data --angio --size 4.5
|
|
131
|
-
|
|
132
|
-
#### `--en-face`
|
|
133
|
-
**Description**: convert extracted en face data.
|
|
134
|
-
|
|
135
|
-
Requires `--size SIZE`.
|
|
136
|
-
|
|
137
|
-
**Usage**:
|
|
138
|
-
|
|
139
|
-
oct-to-tiff /path/to/data --en-face --size 4.5
|
|
140
|
-
|
|
141
|
-
#### `--seg-curve`
|
|
142
|
-
**Description**: convert extracted segmentation data.
|
|
143
|
-
|
|
144
|
-
**Usage**:
|
|
145
|
-
|
|
146
|
-
oct-to-tiff /path/to/data --seg-curve
|
|
147
|
-
|
|
148
|
-
## Contributing
|
|
149
|
-
|
|
150
|
-
This project uses [black](https://github.com/psf/black) for formatting and [isort](https://github.com/PyCQA/isort) for sorting imports.
|
|
151
|
-
|
|
152
|
-
## Requirements
|
|
153
|
-
|
|
154
|
-
Requires Python 3.7 or higher.
|
oct_to_tiff-0.3.0/pyproject.toml
DELETED
oct_to_tiff-0.3.0/setup.cfg
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
[metadata]
|
|
2
|
-
name = oct_to_tiff
|
|
3
|
-
version = 0.3.0
|
|
4
|
-
author = Cameron Lloyd
|
|
5
|
-
author_email = lloyd@med.unideb.hu
|
|
6
|
-
description = A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
7
|
-
long_description = file: README.md
|
|
8
|
-
long_description_content_type = text/markdown
|
|
9
|
-
url = https://github.com/camlloyd/oct-to-tiff
|
|
10
|
-
project_urls =
|
|
11
|
-
Bug Tracker = https://github.com/camlloyd/oct-to-tiff/issues
|
|
12
|
-
classifiers =
|
|
13
|
-
Development Status :: 3 - Alpha
|
|
14
|
-
Intended Audience :: Science/Research
|
|
15
|
-
License :: OSI Approved :: BSD License
|
|
16
|
-
Natural Language :: English
|
|
17
|
-
Operating System :: OS Independent
|
|
18
|
-
Programming Language :: Python :: 3
|
|
19
|
-
Programming Language :: Python :: 3.7
|
|
20
|
-
Programming Language :: Python :: 3.8
|
|
21
|
-
Programming Language :: Python :: 3.9
|
|
22
|
-
Programming Language :: Python :: 3.10
|
|
23
|
-
|
|
24
|
-
[options]
|
|
25
|
-
packages = find:
|
|
26
|
-
package_dir =
|
|
27
|
-
=src
|
|
28
|
-
python_requires = >=3.7
|
|
29
|
-
install_requires =
|
|
30
|
-
numpy
|
|
31
|
-
tifffile
|
|
32
|
-
|
|
33
|
-
[options.entry_points]
|
|
34
|
-
console_scripts =
|
|
35
|
-
oct-to-tiff = oct_to_tiff.cli:main
|
|
36
|
-
|
|
37
|
-
[options.packages.find]
|
|
38
|
-
where = src
|
|
39
|
-
|
|
40
|
-
[egg_info]
|
|
41
|
-
tag_build =
|
|
42
|
-
tag_date = 0
|
|
43
|
-
|
oct_to_tiff-0.3.0/setup.py
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: oct-to-tiff
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
5
|
-
Home-page: https://github.com/camlloyd/oct-to-tiff
|
|
6
|
-
Author: Cameron Lloyd
|
|
7
|
-
Author-email: lloyd@med.unideb.hu
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/camlloyd/oct-to-tiff/issues
|
|
9
|
-
Classifier: Development Status :: 3 - Alpha
|
|
10
|
-
Classifier: Intended Audience :: Science/Research
|
|
11
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
12
|
-
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Requires-Python: >=3.7
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE.txt
|
|
22
|
-
|
|
23
|
-
# oct-to-tiff
|
|
24
|
-
|
|
25
|
-
[](https://zenodo.org/badge/latestdoi/382486199)
|
|
26
|
-
|
|
27
|
-
A command line tool for converting optical coherence tomography angiography (OCTA) data.
|
|
28
|
-
|
|
29
|
-
## Installation
|
|
30
|
-
via pip:
|
|
31
|
-
|
|
32
|
-
pip install oct-to-tiff
|
|
33
|
-
|
|
34
|
-
via conda:
|
|
35
|
-
|
|
36
|
-
conda install -c conda-forge oct-to-tiff
|
|
37
|
-
|
|
38
|
-
## Getting started
|
|
39
|
-
oct-to-tiff /path/to/image.OCT
|
|
40
|
-
|
|
41
|
-
will read an OCT volume and write to a single OME-TIFF file, including voxel size in the metadata.
|
|
42
|
-
|
|
43
|
-
By default, the output file will be written with the same name as the input file and to the same directory:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
tree /path/to/images
|
|
47
|
-
├── image.OCT
|
|
48
|
-
└── image.ome.tif
|
|
49
|
-
|
|
50
|
-
To specify a custom output directory, see [Optional arguments](#optional-arguments) below.
|
|
51
|
-
|
|
52
|
-
## Supported scan patterns
|
|
53
|
-
|
|
54
|
-
This tool has been developed by reverse engineering data from the Optovue RTVue XR Avanti System.
|
|
55
|
-
|
|
56
|
-
Due to limited test data, only the following scan patterns are currently supported:
|
|
57
|
-
|
|
58
|
-
### Structural OCT
|
|
59
|
-
- 3D Cornea
|
|
60
|
-
- 3D Disc
|
|
61
|
-
- 3D Retina
|
|
62
|
-
- 3D Widefield
|
|
63
|
-
- 3D Widefield MCT
|
|
64
|
-
- Angle
|
|
65
|
-
- Cornea Cross Line
|
|
66
|
-
- Cornea Line
|
|
67
|
-
- Cross Line
|
|
68
|
-
- Enhanced HD Line
|
|
69
|
-
- GCC
|
|
70
|
-
- Grid
|
|
71
|
-
- Line
|
|
72
|
-
- ONH (Partial)
|
|
73
|
-
- Pachymetry Wide
|
|
74
|
-
- Radial Lines
|
|
75
|
-
- Raster
|
|
76
|
-
- Retina Map (Partial)
|
|
77
|
-
|
|
78
|
-
### OCT Angiography
|
|
79
|
-
- Angio Disc
|
|
80
|
-
- Angio Retina
|
|
81
|
-
- HD Angio Disc
|
|
82
|
-
- HD Angio Retina
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
## Optional arguments
|
|
86
|
-
|
|
87
|
-
To view these options at any time, run `oct-to-tiff --help`.
|
|
88
|
-
|
|
89
|
-
#### `--output OUTPUT`
|
|
90
|
-
**Description**: specify a custom output directory.
|
|
91
|
-
|
|
92
|
-
If the path to the output directory does not exist, a new directory (and parent directories) will be created.
|
|
93
|
-
|
|
94
|
-
**Usage**:
|
|
95
|
-
|
|
96
|
-
oct-to-tiff /path/to/image.OCT --output /path/to/output/directory
|
|
97
|
-
|
|
98
|
-
#### `--overwrite`
|
|
99
|
-
**Description**: overwrite output file if it exists.
|
|
100
|
-
|
|
101
|
-
**Usage**:
|
|
102
|
-
|
|
103
|
-
oct-to-tiff /path/to/image.OCT --overwrite
|
|
104
|
-
|
|
105
|
-
#### `--size SIZE`
|
|
106
|
-
**Description**: scan size in mm.
|
|
107
|
-
|
|
108
|
-
Sets the correct voxel size for scan patterns with adjustable length.
|
|
109
|
-
|
|
110
|
-
**Usage**:
|
|
111
|
-
|
|
112
|
-
oct-to-tiff /path/to/image.OCT --size 4.5
|
|
113
|
-
|
|
114
|
-
#### `--version`
|
|
115
|
-
**Description**: show program's version number and exit.
|
|
116
|
-
|
|
117
|
-
**Usage**:
|
|
118
|
-
|
|
119
|
-
oct-to-tiff --version
|
|
120
|
-
|
|
121
|
-
#### The following options are currently experimental:
|
|
122
|
-
|
|
123
|
-
#### `--angio`
|
|
124
|
-
**Description**: convert extracted OCTA data.
|
|
125
|
-
|
|
126
|
-
Requires `--size SIZE`.
|
|
127
|
-
|
|
128
|
-
**Usage**:
|
|
129
|
-
|
|
130
|
-
oct-to-tiff /path/to/data --angio --size 4.5
|
|
131
|
-
|
|
132
|
-
#### `--en-face`
|
|
133
|
-
**Description**: convert extracted en face data.
|
|
134
|
-
|
|
135
|
-
Requires `--size SIZE`.
|
|
136
|
-
|
|
137
|
-
**Usage**:
|
|
138
|
-
|
|
139
|
-
oct-to-tiff /path/to/data --en-face --size 4.5
|
|
140
|
-
|
|
141
|
-
#### `--seg-curve`
|
|
142
|
-
**Description**: convert extracted segmentation data.
|
|
143
|
-
|
|
144
|
-
**Usage**:
|
|
145
|
-
|
|
146
|
-
oct-to-tiff /path/to/data --seg-curve
|
|
147
|
-
|
|
148
|
-
## Contributing
|
|
149
|
-
|
|
150
|
-
This project uses [black](https://github.com/psf/black) for formatting and [isort](https://github.com/PyCQA/isort) for sorting imports.
|
|
151
|
-
|
|
152
|
-
## Requirements
|
|
153
|
-
|
|
154
|
-
Requires Python 3.7 or higher.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|