-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add methods to read and write serializable objects as datablocks #73
Conversation
change api for writing blocks to take compressor instead of full dataset attributes TODO reconsider this API change because with full dataset attributes, we can introduce type 2 blocks without blocksize fields for serializable objects
introduce mode 2 for object datablocks
This is more flexible for generic types using e.g. Google's TypeToken
@axtimwalde: oddly enough I found myself wanting to read a complex type via n5(-zarr) this morning: colormap-like array-type
sample python code
Is this generally the type of Object you are looking to support here? |
No, I think we would have to support this in n5-imglib2 as complex types are just two other types. This is meant for serializing something big into a block, i.e. I need it for an array of sets of point matches. |
You can already store arbitrarily many values into a block. It is one of the places where the zarr and n5 specs have never converged. Let me see what we can do for complex types or generally multi-primitive value types in n5-imglib2. |
@joshmoore, looking at this again, I am not sure about the best way to support the full dtype language for arbitrary structs in Java as we're not dynamically resolving type information. So far, data of unknown dtype specifications will be opened as byte[] which, in principle, enables interpreting it on the fly with either ImgLib2's ByteArray access or via something similar with ByteBuffer. If you're staying inside the Java language, you can indeed save collections of complex types with this block-serializer but that, in turn, is not very useful when reading from Python. |
number of dimensions