Skip to content

NDArray generated in C++ failing to open in Python #596

Answered by FrancescAlted
leoyala asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Leonardo. Fortunately, there is a solution that is simpler than your attempts. First you need to create the b2nd array, with nothing inside (b2nd_empty()), then set the images one by one (with b2nd_set_slice_cbuffer()).

I did a small example showing these steps in: https://github.com/Blosc/c-blosc2/blob/main/examples/b2nd/example_stack_images.c

The metadata for the output can be read normally with msgpack tools:

francesc@Francescs-MacBook-Air ~/b/c-blosc2 (main)> ll test_image_dataset.b2nd                            (python-blosc2)
-rw-r--r--  1 francesc  staff    43M Mar 29 16:56 test_image_dataset.b2nd
francesc@Francescs-MacBook-Air ~/b/c-blosc2 (main)> msgpack2json -Bi test_image_da…

Replies: 5 comments 10 replies

Comment options

You must be logged in to vote
3 replies
@leoyala
Comment options

@FrancescAlted
Comment options

@leoyala
Comment options

Answer selected by leoyala
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@leoyala
Comment options

@FrancescAlted
Comment options

Comment options

You must be logged in to vote
5 replies
@leoyala
Comment options

@FrancescAlted
Comment options

@leoyala
Comment options

@FrancescAlted
Comment options

@leoyala
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants