Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic channel management #1

Open
dwoschee opened this issue Apr 20, 2021 · 2 comments
Open

Dynamic channel management #1

dwoschee opened this issue Apr 20, 2021 · 2 comments
Labels
enhancement New feature or request priority This issue has an increased priority
Milestone

Comments

@dwoschee
Copy link
Contributor

The management of stacks and channels needs to be restructured.

The following requirements should be fulfilled:

  • Dynamic channel loading/unloading without restarting the application. It would be a huge improvement for the user experience if the results of segmentation or background correction were loaded on the fly without having to restart the application and reload all data.
  • Memory efficiency: use memmaps or virtual channels where possible. Image stacks are large files; holding them in memory and performing image processing (e.g. background correction) can be too much even for recent workstation machines.
  • Class hierarchy / API: Provide reasonable base classes for stacks/channels, including an elaborate API, for easy subclassing (e.g. to implement new file format readers).
@dwoschee dwoschee added enhancement New feature or request priority This issue has an increased priority labels Apr 20, 2021
@dwoschee
Copy link
Contributor Author

A starting point could be the BaseStack class from src/stack/base.py in b3459af.

It is intended to provide all API methods used in the application. Actual data should be kept by subclasses thereof. There should be a subclass for image data held in memory as a numpy array and a subclass for image data held on disk in a numpy memmap. Image loaders should create one of these classes, depending on available memory. For image file formats that can well be used as memmap for reading on the fly, specific subclasses of BaseStack may be created.

@dwoschee dwoschee added this to the Dynamic milestone Apr 20, 2021
@dwoschee
Copy link
Contributor Author

Here are some thoughts on a more flexible and efficient structure:

Stack class

  • receives file path(s) of microscopy images
  • decides data format based on file path(s)
  • creates list of Channel instances
  • get_image method delegates frame acquisition to Channel instance

Subclasses of Channel class

  • MemoryChannel
    • receives numpy array
    • saves data in memory
  • JustInTimeChannel
    • receives method for reading frames from file
    • reads frame on demand from file
  • TemporaryFileChannel
    • loads channel from file (e.g. from network storage with slow access)
    • saves channel in temporary file / memmap
    • reads frame on demand from memmap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority This issue has an increased priority
Projects
None yet
Development

No branches or pull requests

1 participant