Giter Club home page Giter Club logo

Comments (5)

sebi06 avatar sebi06 commented on May 30, 2024 2

Hi @jackyko1991

All those libraies have nothing to do with ZEN or IronPython and are meant to be used from a normal conda environment.

What is possible is to call an external python script from within ZEN Macro (if this helps your workflow). Examples can be found here:

https://github.com/zeiss-microscopy/OAD/tree/master/Scripts/Start_External_Software

But I would really consider to also think about doing the whole workflow directly in Python and to create new CZI if needed. pylibCZIrw also supports to write new CZI files.

from oad.

CamachoDejay avatar CamachoDejay commented on May 30, 2024

Hej @jackyko1991
Do you want to open the image inside ZEN and then work with it using numpy? or do you want to use an external image analysis pipeline running in python to open the .czi image?

For the latter I think this discussion is very userfull: https://forum.image.sc/t/reading-czi-file-in-python/39768/15
you can use either pylibCZIrw: https://pypi.org/project/pylibCZIrw/ or aicspylibczi https://pypi.org/project/aicspylibczi/

Regarding minimal examples I am interested in collecting them here: https://github.com/CamachoDejay/Zeiss-OAD-examples/tree/main

My current example might be out of your scope, but I will be placing more in the future.

from oad.

jackyko1991 avatar jackyko1991 commented on May 30, 2024

I am using external Python scripts to process Zen-loaded image data and then return the results back to Zen. The process involves sending image data from Zen to Anaconda environments for image processing and then retrieving the processed data.

However, dealing with large image sizes can be challenging, especially for LLSM time stacks, which can contain TBs of data. The internal processing functions of Zen are not optimized for multithreaded or GPU processing, which can further slow down the processing time.

To overcome this challenge, I am using an image calculator for image rescaling, converting the data to 8-bit, and then splitting the data by time and scene. In some cases, I need to load the data back to Zen for 3D rendering. The image processing involves element-wise multiplication and additions, which can be significantly accelerated using GPU libraries in Python.

To handle very large image data, one possible approach is to use metadata parsing or memory address (object pointer) style of data management. This can help improve the efficiency of processing large datasets by reducing the amount of memory required to store the data.

Is there an exmample of this style of data IO?

from oad.

sebi06 avatar sebi06 commented on May 30, 2024

Hi @jackyko1991

so what you wnat to do is using GPU-supported image processing on your large CZI stacks inside Python, because you are not happy with what ZEN can offer? We do use GPU-processing, but not for all of our processing functions. So what you plan to do is this (?):

  • read CZI image data from with Python
  • they all are based on the C++ library libCZI and have thier pro & cons
  • additionally there are some experimental (packages, that simplify also reading the relevant metadata from CZI (for example czitools
  • all of those tools allow to read the CZI datasets in parts etc. and respective examples can be found on the respective project pages

I hope this helps to get you started.

from oad.

jackyko1991 avatar jackyko1991 commented on May 30, 2024

@sebi06 looks these libraries are promising. But are they come with Zen version of Iron python?

guess from what you suggest, the proper way of using these libraries are

  1. using macro editor in Zen to prepare the necessary metadata
  2. parse the image path and metadata info to anaconda python as cli arguments, then spawn child process under Zen (how to deal with virtual environments in this sense?)
  3. process the image in external python
  4. save the processed result to local
  5. using Zen macro to automatically load back the data

with this pipeline, I guess some of the image processing can offload to more powerful servers (or WSL2 for deep learning task on "windows" ) via restful api? (image data can be stored on network drive but not local)

When handling TB of data is quite a pain for the typical Zen users, I am trying to streamline the process with as few io as possible. Apologize if some topics are out of the original scope of Zen.

from oad.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.