oct-to-tiff 0.3.0__py3-none-any.whl → 0.5.0__py3-none-any.whl

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/cli.py CHANGED
@@ -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 convert_oct_file(args, file_name, input_path, output_path):
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
+ [![DOI](https://zenodo.org/badge/382486199.svg)](https://zenodo.org/badge/latestdoi/382486199)
65
+ [![PyPI - Version](https://img.shields.io/pypi/v/oct-to-tiff)](https://pypi.org/project/oct-to-tiff)
66
+ [![PyPI - License](https://img.shields.io/pypi/l/oct-to-tiff)](https://github.com/camlloyd/oct-to-tiff/blob/main/LICENSE.txt)
67
+ [![PyPI Downloads](https://static.pepy.tech/badge/oct-to-tiff)](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.
@@ -0,0 +1,8 @@
1
+ oct_to_tiff/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ oct_to_tiff/cli.py,sha256=tHRUNBff0TTTtc0pnecF_t5mLWyoGG0kNKNVopyL4Sw,15934
3
+ oct_to_tiff-0.5.0.dist-info/LICENSE.txt,sha256=8KO0dluzLStmIF0HM18BOP9T2miIcX8q-GOfMOw6Ngk,1521
4
+ oct_to_tiff-0.5.0.dist-info/METADATA,sha256=8-nIJ6Pg_vvfxovcjIHgax-D1nMQaWYZ_9cJLT7lq2g,6649
5
+ oct_to_tiff-0.5.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
6
+ oct_to_tiff-0.5.0.dist-info/entry_points.txt,sha256=mKWNdkTThZm2JKtLwp4PGMpXkvAWk-xnQDAOyRsCo9Y,53
7
+ oct_to_tiff-0.5.0.dist-info/top_level.txt,sha256=_ovqm7f48yb_IAiVqWzB3VPnHXwzkkEqQQ_ZJz_McSY,12
8
+ oct_to_tiff-0.5.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,156 +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
- Requires-Dist: numpy
23
- Requires-Dist: tifffile
24
-
25
- # oct-to-tiff
26
-
27
- [![DOI](https://zenodo.org/badge/382486199.svg)](https://zenodo.org/badge/latestdoi/382486199)
28
-
29
- A command line tool for converting optical coherence tomography angiography (OCTA) data.
30
-
31
- ## Installation
32
- via pip:
33
-
34
- pip install oct-to-tiff
35
-
36
- via conda:
37
-
38
- conda install -c conda-forge oct-to-tiff
39
-
40
- ## Getting started
41
- oct-to-tiff /path/to/image.OCT
42
-
43
- will read an OCT volume and write to a single OME-TIFF file, including voxel size in the metadata.
44
-
45
- By default, the output file will be written with the same name as the input file and to the same directory:
46
-
47
-
48
- tree /path/to/images
49
- ├── image.OCT
50
- └── image.ome.tif
51
-
52
- To specify a custom output directory, see [Optional arguments](#optional-arguments) below.
53
-
54
- ## Supported scan patterns
55
-
56
- This tool has been developed by reverse engineering data from the Optovue RTVue XR Avanti System.
57
-
58
- Due to limited test data, only the following scan patterns are currently supported:
59
-
60
- ### Structural OCT
61
- - 3D Cornea
62
- - 3D Disc
63
- - 3D Retina
64
- - 3D Widefield
65
- - 3D Widefield MCT
66
- - Angle
67
- - Cornea Cross Line
68
- - Cornea Line
69
- - Cross Line
70
- - Enhanced HD Line
71
- - GCC
72
- - Grid
73
- - Line
74
- - ONH (Partial)
75
- - Pachymetry Wide
76
- - Radial Lines
77
- - Raster
78
- - Retina Map (Partial)
79
-
80
- ### OCT Angiography
81
- - Angio Disc
82
- - Angio Retina
83
- - HD Angio Disc
84
- - HD Angio Retina
85
-
86
-
87
- ## Optional arguments
88
-
89
- To view these options at any time, run `oct-to-tiff --help`.
90
-
91
- #### `--output OUTPUT`
92
- **Description**: specify a custom output directory.
93
-
94
- If the path to the output directory does not exist, a new directory (and parent directories) will be created.
95
-
96
- **Usage**:
97
-
98
- oct-to-tiff /path/to/image.OCT --output /path/to/output/directory
99
-
100
- #### `--overwrite`
101
- **Description**: overwrite output file if it exists.
102
-
103
- **Usage**:
104
-
105
- oct-to-tiff /path/to/image.OCT --overwrite
106
-
107
- #### `--size SIZE`
108
- **Description**: scan size in mm.
109
-
110
- Sets the correct voxel size for scan patterns with adjustable length.
111
-
112
- **Usage**:
113
-
114
- oct-to-tiff /path/to/image.OCT --size 4.5
115
-
116
- #### `--version`
117
- **Description**: show program's version number and exit.
118
-
119
- **Usage**:
120
-
121
- oct-to-tiff --version
122
-
123
- #### The following options are currently experimental:
124
-
125
- #### `--angio`
126
- **Description**: convert extracted OCTA data.
127
-
128
- Requires `--size SIZE`.
129
-
130
- **Usage**:
131
-
132
- oct-to-tiff /path/to/data --angio --size 4.5
133
-
134
- #### `--en-face`
135
- **Description**: convert extracted en face data.
136
-
137
- Requires `--size SIZE`.
138
-
139
- **Usage**:
140
-
141
- oct-to-tiff /path/to/data --en-face --size 4.5
142
-
143
- #### `--seg-curve`
144
- **Description**: convert extracted segmentation data.
145
-
146
- **Usage**:
147
-
148
- oct-to-tiff /path/to/data --seg-curve
149
-
150
- ## Contributing
151
-
152
- This project uses [black](https://github.com/psf/black) for formatting and [isort](https://github.com/PyCQA/isort) for sorting imports.
153
-
154
- ## Requirements
155
-
156
- Requires Python 3.7 or higher.
@@ -1,8 +0,0 @@
1
- oct_to_tiff/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- oct_to_tiff/cli.py,sha256=1CAelDZKqQoF_JclJpJTlOMyOEtsV4MIXgbTV4pfXJI,14174
3
- oct_to_tiff-0.3.0.dist-info/LICENSE.txt,sha256=8KO0dluzLStmIF0HM18BOP9T2miIcX8q-GOfMOw6Ngk,1521
4
- oct_to_tiff-0.3.0.dist-info/METADATA,sha256=ulotSkEvTr2IF266elWPvWh8lZxYWC8nhjyJ22lQk40,3779
5
- oct_to_tiff-0.3.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
6
- oct_to_tiff-0.3.0.dist-info/entry_points.txt,sha256=mKWNdkTThZm2JKtLwp4PGMpXkvAWk-xnQDAOyRsCo9Y,53
7
- oct_to_tiff-0.3.0.dist-info/top_level.txt,sha256=_ovqm7f48yb_IAiVqWzB3VPnHXwzkkEqQQ_ZJz_McSY,12
8
- oct_to_tiff-0.3.0.dist-info/RECORD,,