Open tischi opened 2 years ago
Your code makes sense except I'm not sure how it would handle types that ImageJ can't show...
Here's how we're doing conversion, which has worked okay so far. N5-centric, not as general as imglib2 though.
all the imglib2 Types, do we have something for that?
Not for all imglib2 types, but for many of them. every RealType
can give you its getBitsPerPixel
.
That covers most interesting types except for RGBTypes. In any case, I'd lean toward only providing size estimates for NativeType
s anyway.
My use case is tied more closely with n5, so I can grab bit depth directly from the DataType. I think it would be straightforward to extend to imglib2 generally if we constrain to NativeTypes.
How does this sound to you?
Here's how we're doing conversion, which has worked okay so far. N5-centric, not as general as imglib2 though.
Maybe, if you can get hold of Stephan Preibisch, you could chat with him about this? I think he implemented the ImageJFunctions.wrap(...)
.
My use case is tied more closely with n5, so I can grab bit depth directly from the DataType. I think it would be straightforward to extend to imglib2 generally if we constrain to NativeTypes.
Sounds very good!
@bogovicj
In order to determine the size in MB of a source at some level I guess we would need some way to determine the number of bits for all the imglib2 Types, do we have something for that?
If we want to show the images as an ImagePlus I guess it could be also interesting to know how large the image would be, because there are less types (8-bit, 16-bit and 32-bit float).
I am currently using below code for the translation, does that make sense to you?