lovekit 0.1.1__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.
- lovekit-0.1.1/PKG-INFO +179 -0
- lovekit-0.1.1/README.md +164 -0
- lovekit-0.1.1/lovekit/__init__.py +3 -0
- lovekit-0.1.1/pyproject.toml +35 -0
lovekit-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: lovekit
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary:
|
|
5
|
+
Author: jhnnsrs
|
|
6
|
+
Author-email: jhnnsrs@gmail.com
|
|
7
|
+
Requires-Python: >=3.10,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Requires-Dist: aiohttp (>=3.9.5,<4.0.0)
|
|
13
|
+
Requires-Dist: koil (>=0.3.6,<0.4.0)
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# akuire
|
|
17
|
+
|
|
18
|
+
[](https://codecov.io/gh/jhnnsrs/akuire)
|
|
19
|
+
[](https://pypi.org/project/akuire/)
|
|
20
|
+
[](https://pypi.org/project/akuire/)
|
|
21
|
+

|
|
22
|
+
[](https://pypi.python.org/pypi/akuire/)
|
|
23
|
+
[](https://pypi.python.org/pypi/akuire/)
|
|
24
|
+
|
|
25
|
+
[](./akuire.png)
|
|
26
|
+
|
|
27
|
+
Akuire is a prototype of (asynchronous) acquisiton engine for smart-microscopy workflows. It was designed during the "Smart Microscopy" hackathon at the [Lund](https://www.lunduniversity.lu.se/) [Bioimaging Center](https://www.bmc.lu.se/).
|
|
28
|
+
|
|
29
|
+
The main goal of Akuire is to provide a simple and flexible way to acquire images from a microscope in an abstract way, interfacing with different
|
|
30
|
+
microscopy software backbones. Its centered around the idea of composable acquisition events that are either handlable by the hardware directly and therefore optimizable or can be compiled into a list of events that are compatible with the underlying hardware. It currently stands as
|
|
31
|
+
a playground for ideas and concepts, while figuring out ways to abstract and enable modern smart microscopy workflows.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
> [!NOTE] Akuire is a playground for ideas and concepts, while figuring out ways to abstract and enable modern smart microscopy workflows. There is already great solutions in this space, all with their own strengths and weaknesses. Akuire is not meant to replace them, but to complement them and provide a different perspective on how to design smart microscopy workflows. If you
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- **Testable**: Akuire is designed to be a backbone for testing and desinging smart microscopy workflows, allowing you to easily mock hardware and test your acquisition plans, without actually interfacing with the hardware.
|
|
40
|
+
|
|
41
|
+
- **Hardware Agnostic**: Akuire is designed to be hardware agnostic, allowing you to easily switch between different hardware setups.
|
|
42
|
+
|
|
43
|
+
- **Optimizable**: Akuire is designed to be optimizable, allowing you to compile acquisition plans into a list of events that are compatible with the underlying hardware.
|
|
44
|
+
|
|
45
|
+
- **Asynchronous**: Akuire is built internally on top of asyncio, making it easy to write asynchronous code. Of course, you can also use it synchronously.
|
|
46
|
+
|
|
47
|
+
- **Flexible**: Akuire is designed to be flexible, allowing you to easily extend it with your own hardware managers and acquisition events.
|
|
48
|
+
|
|
49
|
+
- **Simple**: Akuire is designed to be simple, allowing you to easily acquire images from a microscope in an abstract way.
|
|
50
|
+
|
|
51
|
+
- **Experimental**: Akuire is currently in an experimental state, so expect breaking changes and bugs !!!!
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
To install Akuire, you can use pip:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
|
|
62
|
+
pip install akuire
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
To use Akuire, you need to create an instance of the `AcquistionEinge` class, passing the desired device managers and the system settings.
|
|
69
|
+
You can use the acquisition engine to acquire images from the microscope through predefined plans in an `Acquisition` object.
|
|
70
|
+
|
|
71
|
+
You can both use it syncronously and asyncronously. Here is an example of how to use it asyncronously:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from akuire import AcquisitionEngine, Acquisition, MoveEvent, AcquireZStackEvent, SystemConfig
|
|
75
|
+
from akuire.managers.testing import NonSweepableCamera, ZStageManager, VirtualStageManager
|
|
76
|
+
import asyncio
|
|
77
|
+
|
|
78
|
+
engine = AcquisitionEngine(
|
|
79
|
+
system_config=SystemConfig(
|
|
80
|
+
managers=[
|
|
81
|
+
NonSweepableCamera("virtual_camera"),
|
|
82
|
+
ZStageManager("z_stage"),
|
|
83
|
+
VirtualStageManager("virtual_stage"),
|
|
84
|
+
]
|
|
85
|
+
),
|
|
86
|
+
compiler=compile_events,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
x = Acquisition(
|
|
91
|
+
events=[
|
|
92
|
+
MoveEvent(x=1, y=2),
|
|
93
|
+
AcquireZStackEvent(z_steps=30, item_exposure_time=0.1),
|
|
94
|
+
]
|
|
95
|
+
)
|
|
96
|
+
# The acquisition plan is compiled into a list of events
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
async def main():
|
|
101
|
+
async with engine as e:
|
|
102
|
+
|
|
103
|
+
# A blocking operation that acquires the ZStack
|
|
104
|
+
# The event plan will be "compiled" into a list of events
|
|
105
|
+
# that are compatible with the underlying hardware
|
|
106
|
+
# trying to optimize the acquisition process
|
|
107
|
+
result = await e.acquire(x)
|
|
108
|
+
# result is a ZStack object
|
|
109
|
+
|
|
110
|
+
# A hyperstack can be created from the ZStack object
|
|
111
|
+
stack = result.to_z_stack()
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
if __name__ == "__main__":
|
|
115
|
+
asyncio.run(main())
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
And synchronously:
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from akuire import AcquisitionEngine, Acquisition, MoveEvent, AcquireZStackEvent, SystemConfig
|
|
122
|
+
from akuire.managers.testing import NonSweepableCamera, ZStageManager, VirtualStageManager
|
|
123
|
+
import asyncio
|
|
124
|
+
|
|
125
|
+
engine = AcquisitionEngine(
|
|
126
|
+
system_config=SystemConfig(
|
|
127
|
+
managers=[
|
|
128
|
+
NonSweepableCamera("virtual_camera"),
|
|
129
|
+
ZStageManager("z_stage"),
|
|
130
|
+
VirtualStageManager("virtual_stage"),
|
|
131
|
+
]
|
|
132
|
+
),
|
|
133
|
+
compiler=compile_events,
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
x = Acquisition(
|
|
137
|
+
events=[
|
|
138
|
+
MoveEvent(x=1, y=2),
|
|
139
|
+
AcquireZStackEvent(z_steps=30, item_exposure_time=0.1),
|
|
140
|
+
]
|
|
141
|
+
)
|
|
142
|
+
# The acquisition plan is compiled into a list of events
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def main():
|
|
147
|
+
with engine as e:
|
|
148
|
+
|
|
149
|
+
# A blocking operation that acquires the ZStack
|
|
150
|
+
# The event plan will be "compiled" into a list of events
|
|
151
|
+
# that are compatible with the underlying hardware
|
|
152
|
+
# trying to optimize the acquisition process
|
|
153
|
+
result = e.acquire_sync(x)
|
|
154
|
+
# result is a ZStack object
|
|
155
|
+
|
|
156
|
+
# A hyperstack can be created from the ZStack object
|
|
157
|
+
stack = result.to_z_stack()
|
|
158
|
+
|
|
159
|
+
if __name__ == "__main__":
|
|
160
|
+
main()
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
## Documentation
|
|
166
|
+
|
|
167
|
+
Right now this is the only documentation available. More documentation will be added in the future.
|
|
168
|
+
If you are interested in potential use cases, please check the [examples](examples) folder.
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
## Contributing
|
|
172
|
+
|
|
173
|
+
Pull requests are welcome. Happy for any feedback or suggestions.
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
lovekit-0.1.1/README.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# akuire
|
|
2
|
+
|
|
3
|
+
[](https://codecov.io/gh/jhnnsrs/akuire)
|
|
4
|
+
[](https://pypi.org/project/akuire/)
|
|
5
|
+
[](https://pypi.org/project/akuire/)
|
|
6
|
+

|
|
7
|
+
[](https://pypi.python.org/pypi/akuire/)
|
|
8
|
+
[](https://pypi.python.org/pypi/akuire/)
|
|
9
|
+
|
|
10
|
+
[](./akuire.png)
|
|
11
|
+
|
|
12
|
+
Akuire is a prototype of (asynchronous) acquisiton engine for smart-microscopy workflows. It was designed during the "Smart Microscopy" hackathon at the [Lund](https://www.lunduniversity.lu.se/) [Bioimaging Center](https://www.bmc.lu.se/).
|
|
13
|
+
|
|
14
|
+
The main goal of Akuire is to provide a simple and flexible way to acquire images from a microscope in an abstract way, interfacing with different
|
|
15
|
+
microscopy software backbones. Its centered around the idea of composable acquisition events that are either handlable by the hardware directly and therefore optimizable or can be compiled into a list of events that are compatible with the underlying hardware. It currently stands as
|
|
16
|
+
a playground for ideas and concepts, while figuring out ways to abstract and enable modern smart microscopy workflows.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
> [!NOTE] Akuire is a playground for ideas and concepts, while figuring out ways to abstract and enable modern smart microscopy workflows. There is already great solutions in this space, all with their own strengths and weaknesses. Akuire is not meant to replace them, but to complement them and provide a different perspective on how to design smart microscopy workflows. If you
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **Testable**: Akuire is designed to be a backbone for testing and desinging smart microscopy workflows, allowing you to easily mock hardware and test your acquisition plans, without actually interfacing with the hardware.
|
|
25
|
+
|
|
26
|
+
- **Hardware Agnostic**: Akuire is designed to be hardware agnostic, allowing you to easily switch between different hardware setups.
|
|
27
|
+
|
|
28
|
+
- **Optimizable**: Akuire is designed to be optimizable, allowing you to compile acquisition plans into a list of events that are compatible with the underlying hardware.
|
|
29
|
+
|
|
30
|
+
- **Asynchronous**: Akuire is built internally on top of asyncio, making it easy to write asynchronous code. Of course, you can also use it synchronously.
|
|
31
|
+
|
|
32
|
+
- **Flexible**: Akuire is designed to be flexible, allowing you to easily extend it with your own hardware managers and acquisition events.
|
|
33
|
+
|
|
34
|
+
- **Simple**: Akuire is designed to be simple, allowing you to easily acquire images from a microscope in an abstract way.
|
|
35
|
+
|
|
36
|
+
- **Experimental**: Akuire is currently in an experimental state, so expect breaking changes and bugs !!!!
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
To install Akuire, you can use pip:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
|
|
47
|
+
pip install akuire
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
To use Akuire, you need to create an instance of the `AcquistionEinge` class, passing the desired device managers and the system settings.
|
|
54
|
+
You can use the acquisition engine to acquire images from the microscope through predefined plans in an `Acquisition` object.
|
|
55
|
+
|
|
56
|
+
You can both use it syncronously and asyncronously. Here is an example of how to use it asyncronously:
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from akuire import AcquisitionEngine, Acquisition, MoveEvent, AcquireZStackEvent, SystemConfig
|
|
60
|
+
from akuire.managers.testing import NonSweepableCamera, ZStageManager, VirtualStageManager
|
|
61
|
+
import asyncio
|
|
62
|
+
|
|
63
|
+
engine = AcquisitionEngine(
|
|
64
|
+
system_config=SystemConfig(
|
|
65
|
+
managers=[
|
|
66
|
+
NonSweepableCamera("virtual_camera"),
|
|
67
|
+
ZStageManager("z_stage"),
|
|
68
|
+
VirtualStageManager("virtual_stage"),
|
|
69
|
+
]
|
|
70
|
+
),
|
|
71
|
+
compiler=compile_events,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
x = Acquisition(
|
|
76
|
+
events=[
|
|
77
|
+
MoveEvent(x=1, y=2),
|
|
78
|
+
AcquireZStackEvent(z_steps=30, item_exposure_time=0.1),
|
|
79
|
+
]
|
|
80
|
+
)
|
|
81
|
+
# The acquisition plan is compiled into a list of events
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
async def main():
|
|
86
|
+
async with engine as e:
|
|
87
|
+
|
|
88
|
+
# A blocking operation that acquires the ZStack
|
|
89
|
+
# The event plan will be "compiled" into a list of events
|
|
90
|
+
# that are compatible with the underlying hardware
|
|
91
|
+
# trying to optimize the acquisition process
|
|
92
|
+
result = await e.acquire(x)
|
|
93
|
+
# result is a ZStack object
|
|
94
|
+
|
|
95
|
+
# A hyperstack can be created from the ZStack object
|
|
96
|
+
stack = result.to_z_stack()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
if __name__ == "__main__":
|
|
100
|
+
asyncio.run(main())
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
And synchronously:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from akuire import AcquisitionEngine, Acquisition, MoveEvent, AcquireZStackEvent, SystemConfig
|
|
107
|
+
from akuire.managers.testing import NonSweepableCamera, ZStageManager, VirtualStageManager
|
|
108
|
+
import asyncio
|
|
109
|
+
|
|
110
|
+
engine = AcquisitionEngine(
|
|
111
|
+
system_config=SystemConfig(
|
|
112
|
+
managers=[
|
|
113
|
+
NonSweepableCamera("virtual_camera"),
|
|
114
|
+
ZStageManager("z_stage"),
|
|
115
|
+
VirtualStageManager("virtual_stage"),
|
|
116
|
+
]
|
|
117
|
+
),
|
|
118
|
+
compiler=compile_events,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
x = Acquisition(
|
|
122
|
+
events=[
|
|
123
|
+
MoveEvent(x=1, y=2),
|
|
124
|
+
AcquireZStackEvent(z_steps=30, item_exposure_time=0.1),
|
|
125
|
+
]
|
|
126
|
+
)
|
|
127
|
+
# The acquisition plan is compiled into a list of events
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def main():
|
|
132
|
+
with engine as e:
|
|
133
|
+
|
|
134
|
+
# A blocking operation that acquires the ZStack
|
|
135
|
+
# The event plan will be "compiled" into a list of events
|
|
136
|
+
# that are compatible with the underlying hardware
|
|
137
|
+
# trying to optimize the acquisition process
|
|
138
|
+
result = e.acquire_sync(x)
|
|
139
|
+
# result is a ZStack object
|
|
140
|
+
|
|
141
|
+
# A hyperstack can be created from the ZStack object
|
|
142
|
+
stack = result.to_z_stack()
|
|
143
|
+
|
|
144
|
+
if __name__ == "__main__":
|
|
145
|
+
main()
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## Documentation
|
|
151
|
+
|
|
152
|
+
Right now this is the only documentation available. More documentation will be added in the future.
|
|
153
|
+
If you are interested in potential use cases, please check the [examples](examples) folder.
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
## Contributing
|
|
157
|
+
|
|
158
|
+
Pull requests are welcome. Happy for any feedback or suggestions.
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "lovekit"
|
|
3
|
+
version = "0.1.1"
|
|
4
|
+
description = ""
|
|
5
|
+
authors = ["jhnnsrs <jhnnsrs@gmail.com>"]
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
packages = [{ include = "lovekit" }]
|
|
8
|
+
|
|
9
|
+
[tool.poetry.dependencies]
|
|
10
|
+
python = "^3.10"
|
|
11
|
+
aiohttp = "^3.9.5"
|
|
12
|
+
koil = "^0.3.6"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
[tool.poetry.group.dev.dependencies]
|
|
16
|
+
pytest-aiohttp = "^1.0.5"
|
|
17
|
+
numpy = "^2.0.0"
|
|
18
|
+
numba = "^0.60.0"
|
|
19
|
+
scipy = "^1.13.1"
|
|
20
|
+
opencv-python-headless = "^4.10.0.84"
|
|
21
|
+
nanoimagingpack = "^2.1.3.dev1"
|
|
22
|
+
pytest-cov = "^5.0.0"
|
|
23
|
+
|
|
24
|
+
[tool.poetry.scripts]
|
|
25
|
+
akuire = "akuire.__main__:main"
|
|
26
|
+
|
|
27
|
+
[tool.pytest.ini_options]
|
|
28
|
+
markers = [
|
|
29
|
+
"composition: test composition",
|
|
30
|
+
"external: test external",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[build-system]
|
|
34
|
+
requires = ["poetry-core"]
|
|
35
|
+
build-backend = "poetry.core.masonry.api"
|