Code Monkey home page Code Monkey logo

Comments (2)

K-Meech avatar K-Meech commented on June 19, 2024 1

Ok - so more testing! The biggest contributor seems to be the chunk size.
Each time it writes a slice, an area is read from the image with a z depth == the highest amount of downsampling (i.e. 8 for the example above). This is made much more efficient by using a chunk size in z == the highest amount of downsampling. (before I was using a chunk size of 1 in z)
Using bigger chunks in xy is also more efficient for read/write times.

With a chunk size of (8, 128, 128), the times can be improved to around:

Converted image in 1.1741 seconds
Converted image in 2.0598 seconds
Converted image in 2.0561 seconds
Converted image in 2.2036 seconds
Converted image in 2.2064 seconds
Converted image in 2.2776 seconds
Converted image in 2.4407 seconds
Converted image in 2.4372 seconds
Converted image in 1.2728 seconds
Converted image in 2.0469 seconds

So still slower than hdf5, but fast enough for now! I'll close this.

from pybdv.

K-Meech avatar K-Meech commented on June 19, 2024

I looked into this a bit more, and the slowdown seems to come from downsampling in z. If I change the downscale_factors to [[1,2,2], [1,2,2], [1,2,2]] then all images are converted in ~1 second.

I profiled it, and it seems like most time is spent in _check_shape_and_position_scaling() reading data from the n5 file here: https://github.com/constantinpape/pybdv/blob/master/pybdv/bdv_datasets.py#L62 So it seems reading from n5 is slower than reading from hdf5

from pybdv.

Related Issues (20)

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.