Skip to content

Commit 40ba719

Browse files
committed
Updates to API, removing LISST-Holo construct mode
1 parent cc8025b commit 40ba719

File tree

5 files changed

+15
-35
lines changed

5 files changed

+15
-35
lines changed

README.md

+5-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# microtiff
22
A Python module and CLI tool for converting proprietary microscopy formats to TIFF with JSON metadata sidecar files.
33

4+
## Installation
5+
Microtiff is installable via PIP:
6+
```pip install microtiff```
7+
48
## Supported data types
59
Both supported modules and modules working with errata are listed below.
610

@@ -12,25 +16,8 @@ Both supported modules and modules working with errata are listed below.
1216
| FlowCam | :x: | In active development |
1317

1418
## Dependencies
15-
1619
- pillow
1720
- numpy
18-
- holopy (for LISST-Holo/LISST-Holo2 "construct" mode only)
19-
- xarray
20-
- h5netcdf
21-
- nose
22-
- matplotlib
23-
- h5py
24-
- pyYaml
25-
- scipy
26-
- imp
27-
28-
For essential dependencies you can use the following command:
29-
`$ pip install pillow numpy`
30-
31-
HoloPy is not avaliaiable via PIP. If you are using anaconda, you may install it there. Alternatively, install from source by following instructions at [https://holopy.readthedocs.io/en/master/tutorial/dev_tutorial.html](https://holopy.readthedocs.io/en/master/tutorial/dev_tutorial.html#dev-install). Alternatively, use the install script at [scripts/install-holopy.sh](scripts/install-holopy.sh)
3221

3322
## Acknowledgements
34-
This library is comprised of work from various researchers, some of whom are not direct contributors to this repository.
35-
36-
The LISST-Holo decoder is based on work by [Sari Giering](https://github.com/sarigiering), [Will Major](https://github.com/obg-wrm) and [Mojtaba Masoudi](https://github.com/Mojtabamsd)
23+
Made with the help of: [Sari Giering](https://github.com/sarigiering), [Will Major](https://github.com/obg-wrm) and [Mojtaba Masoudi](https://github.com/Mojtabamsd)

pyproject.toml

+8
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ classifiers = [
1212
"Programming Language :: Python :: 3",
1313
"Operating System :: OS Independent",
1414
]
15+
dependencies = [
16+
"numpy >= 2.0.0",
17+
"pillow >= 8.3.1",
18+
]
1519

1620
[project.urls]
1721
Homepage = "https://github.com/NOC-OI/microtiff"
1822
Issues = "https://github.com/NOC-OI/microtiff/issues"
1923

2024
[tool.setuptools.dynamic]
2125

26+
[tool.setuptools]
27+
packages = ["microtiff"]
28+
package-dir = {"" = "src"}
29+
2230
[tool.setuptools_scm]
2331

2432
[build-system]
File renamed without changes.

src/ifcb.py renamed to src/microtiff/ifcb.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def header_file_to_dict(lines):
4242
o_dict[key] = value.rstrip()
4343
return o_dict
4444

45-
def extract_ifcb_images(target, no_metadata = False):
45+
def extract_images(target, no_metadata = False):
4646
header_lines = ""
4747
with open(target + ".hdr") as f:
4848
header_lines = f.readlines()

src/lisst_holo.py renamed to src/microtiff/lisst_holo.py

+1-16
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
lisst_holo.py
2222
2323
A converter for image data from the LISST-Holo and LISST-Holo2 holographic sensors
24-
25-
Notes:
26-
27-
Only imports holopy when attempting to construct normal images from interference patterns.
2824
'''
2925

3026
import argparse
@@ -73,7 +69,7 @@ def read_string_till_space(fp):
7369
reading = True
7470
str_out = str_out + char
7571

76-
def extract_lisst_holo_image(target, no_metadata = False, construct = False):
72+
def extract_image(target, no_metadata = False):
7773
image_map = []
7874
outputs = []
7975
with open(target + ".pgm", "rb") as f:
@@ -113,17 +109,6 @@ def extract_lisst_holo_image(target, no_metadata = False, construct = False):
113109
with open(target + ".json", "w") as f:
114110
json.dump(im_metadata, f, ensure_ascii=False)
115111
image.save(target + ".tiff", "TIFF")
116-
if construct:
117-
import holopy
118-
zstack = np.linspace(0, 100000, 64)
119-
raw_holo = holopy.load_image(target + ".tiff", spacing=4.4, medium_index = 1, illum_wavelen = 0.658)
120-
rec_vol = holopy.propagate(raw_holo, zstack, cfsp = 3)
121-
print("--construct not fully implemented!")
122-
#print(rec_vol.shape)
123-
for img in rec_vol:
124-
plt.imshow(np.abs(img.to_numpy()), interpolation="nearest", origin="upper")
125-
plt.colorbar()
126-
plt.show()
127112

128113
outputs.append(target)
129114

0 commit comments

Comments
 (0)