Giter VIP home page Giter VIP logo

czitools's People

Contributors

sebi06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

czitools's Issues

License?

Congrats on releasing!

Question... The license on this package is BSD but pylibcziRW and aicspylibczi are GPL. I assume license should be updated unless I just don't understand license stuff.

reading nd arrays takes long time

Hi Sebastian
Thanks for making this resource available and maintaining it.
I am trying to read nd arrays from large datasets with pylibczirw_tools.read_5darray,. I set this flag output_dask=True, so it doesn't read in the entire dataset. However, it takes a very long time...

czi_img = pylibczirw_tools.read_5darray(img_path,output_order="TCZYX",
                               output_dask=True,
                               remove_adim=True
                                )

Is this the right way to do it? It takes more than 1 hour..

However, if I use the following code to initialize a dask array it takes ~5 minutes for a 255GB dataset

from dask import delayed as da_delayed
import dask.array as da 
from pylibCZIrw import czi as pyczi
from tqdm import trange



czidoc = pyczi.CziReader(img_path)
temp_frame = czidoc.read()
print("Array Shape: ",temp_frame.shape)
total_bbox = czidoc.total_bounding_box
z_slices = total_bbox['Z'][1]
nchannels = total_bbox['C'][1]
total_time = total_bbox['T'][1]

#initialise empty list to hold the dask arrays
img=[]


for time in trange(total_time):
    ch_stack=[]
    for ch in range(nchannels):
        z_stack=[]
        for z in range(z_slices):
            z_slice = da.from_delayed(
                                da_delayed(czidoc.read)(plane={'C': ch, 'T': time,'Z':z}), shape=temp_frame.shape, dtype=temp_frame.dtype
                            )
            z_slice = da.squeeze(z_slice)
            #z_slice = z_slice.swapaxes(0,1)
            z_stack.append(z_slice)
        z_stack = da.stack(z_stack,axis=0)
        #break
        ch_stack.append(z_stack)
    img.append(ch_stack)

image_stack = da.stack(img,axis=0)

czitools with Minimum Requirements

I think it would be a good idea the ability to install czitools with minimum requirements. My use case is the use of czitools for reading czi files so it is pretty basic but the installation of czitools bring so much with it from plotting, graphing, other reading libraries (aicsimageio[all] which brings even more stuff such as bfio).

Proposal

Have the ability to do something like this:
pip install czitools[min]
pip install czitools[all]

Additional context

It looks like the library already thinking of this. For example napari is not in the requirements but it is being used. I just want to go further than that and say that I only want stuff for reading using pylibczirw and metadata (no plotting, no aicsimageio).

p.s. I am liking this so far. I've learned a few things reading the code. I think I can contribute here and there. I will need to do some tests first.

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.