Skip to main content

No project description provided

Project description

akuire

codecov PyPI version Maintenance Maintainer PyPI pyversions PyPI status

Akuire Logo

Akuire is a prototype of (asynchronous) acquisiton engine for smart-microscopy workflows. It was designed during the "Smart Microscopy" hackathon at the Lund Bioimaging Center.

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 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 a playground for ideas and concepts, while figuring out ways to abstract and enable modern smart microscopy workflows.

[!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

Features

  • 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.

  • Hardware Agnostic: Akuire is designed to be hardware agnostic, allowing you to easily switch between different hardware setups.

  • 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.

  • Asynchronous: Akuire is built internally on top of asyncio, making it easy to write asynchronous code. Of course, you can also use it synchronously.

  • Flexible: Akuire is designed to be flexible, allowing you to easily extend it with your own hardware managers and acquisition events.

  • Simple: Akuire is designed to be simple, allowing you to easily acquire images from a microscope in an abstract way.

  • Experimental: Akuire is currently in an experimental state, so expect breaking changes and bugs !!!!

Installation

To install Akuire, you can use pip:

pip install akuire

Usage

To use Akuire, you need to create an instance of the AcquistionEinge class, passing the desired device managers and the system settings. You can use the acquisition engine to acquire images from the microscope through predefined plans in an Acquisition object.

You can both use it syncronously and asyncronously. Here is an example of how to use it asyncronously:

from akuire import AcquisitionEngine, Acquisition, MoveEvent, AcquireZStackEvent, SystemConfig
from akuire.managers.testing import NonSweepableCamera, ZStageManager, VirtualStageManager
import asyncio

engine = AcquisitionEngine(
        system_config=SystemConfig(
            managers=[
                NonSweepableCamera("virtual_camera"),
                ZStageManager("z_stage"),
                VirtualStageManager("virtual_stage"),
            ]
        ),
        compiler=compile_events,
    )


x = Acquisition(
    events=[
        MoveEvent(x=1, y=2),
        AcquireZStackEvent(z_steps=30, item_exposure_time=0.1),
    ]
)
# The acquisition plan is compiled into a list of events



async def main():
    async with engine as e:

        # A blocking operation that acquires the ZStack
        # The event plan will be "compiled" into a list of events
        # that are compatible with the underlying hardware
        # trying to optimize the acquisition process
        result = await e.acquire(x)
        # result is a ZStack object
        
        # A hyperstack can be created from the ZStack object
        stack = result.to_z_stack()


if __name__ == "__main__":
    asyncio.run(main())

And synchronously:

from akuire import AcquisitionEngine, Acquisition, MoveEvent, AcquireZStackEvent, SystemConfig
from akuire.managers.testing import NonSweepableCamera, ZStageManager, VirtualStageManager
import asyncio

engine = AcquisitionEngine(
        system_config=SystemConfig(
            managers=[
                NonSweepableCamera("virtual_camera"),
                ZStageManager("z_stage"),
                VirtualStageManager("virtual_stage"),
            ]
        ),
        compiler=compile_events,
    )

x = Acquisition(
    events=[
        MoveEvent(x=1, y=2),
        AcquireZStackEvent(z_steps=30, item_exposure_time=0.1),
    ]
)
# The acquisition plan is compiled into a list of events



 def main():
    with engine as e:

        # A blocking operation that acquires the ZStack
        # The event plan will be "compiled" into a list of events
        # that are compatible with the underlying hardware
        # trying to optimize the acquisition process
        result = e.acquire_sync(x)
        # result is a ZStack object
        
        # A hyperstack can be created from the ZStack object
        stack = result.to_z_stack()

if __name__ == "__main__":
    main()

Documentation

Right now this is the only documentation available. More documentation will be added in the future. If you are interested in potential use cases, please check the examples folder.

Contributing

Pull requests are welcome. Happy for any feedback or suggestions.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

akuire-0.1.2.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

akuire-0.1.2-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

Details for the file akuire-0.1.2.tar.gz.

File metadata

  • Download URL: akuire-0.1.2.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.0-40-generic

File hashes

Hashes for akuire-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5d0ced98f6186b25392175be77218c05e8d314c6173000b3d295672fb755910b
MD5 92cefb56bada086ae6c00cbec7ca19e4
BLAKE2b-256 e6f12054127f3592b3666376b13b8bdc9cbcaf05fdae223245d2cc9b7330c824

See more details on using hashes here.

File details

Details for the file akuire-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: akuire-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.0-40-generic

File hashes

Hashes for akuire-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 45719a84b9c6fd6d3542cbdee220c39592461d52cde6fc344f5ba648496000c6
MD5 14c11b2c087f8679ce18b1cf3f65fbb9
BLAKE2b-256 3d4eb6807483c856e3c3d50f36019b804cf63ceff176509a749cfcd1ac73cd6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page