Skip to content

High speed ndtiff writer for Python #175

@LukasMicroscopy

Description

@LukasMicroscopy

Hi!

The question is about writing ndtiff fast with python.

We use the ndtiff format as our main format in the lab. Mainly by micromanager, but with the availability of the ndtiff writer on python also as format after post processing.
Due to a Python project with high speed recordings, we need a high-performance file writer and we wish to use the ndtiff format.
Unfortunately, I stumbled over some limitations with the ndtiff Python implementation.

When a new ndtiff-file (ndtiff_file.py) is created, the file is first written with zeroes in maximum file size (Line 67 – 70). This takes quite some time. I guess this is done, to be able to work in read/write mode, to read file content while writing. Changing this to write only would eliminate this file creation time, but I guess the functionality to read while writing is lost?

The native file IO of python is blocking. And I couldn’t change this behaviour (by setting non-blocking flags). Therefore, the file writing process takes a lot of time, blocking in threaded mode. Running ndtiff in multiprocessing is not an option, because copying the data also takes some time. I used asyncio and aiofile to overcome this issue on very simplified file writing tests.

My Question is:
Is there interest in having a write only fast asynchronous ndtiff writer?
if yes, how should I proceed to implement one?
Should I try to implement one within the ndtiff package and make a pull request or
Fork the Projekt, for a separated write_only implementation or are there other thoughts?

Thanks!
Best Lukas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions