-
Notifications
You must be signed in to change notification settings - Fork 37
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
Hdf5 types #157
Hdf5 types #157
Conversation
https://docs.hdfgroup.org/hdf5/develop/group___p_d_t_s_t_d.html I wonder if STD data types might be better than NATIVE ? |
I guess that is within the HDF5 file? @constantinpape do you have python code that could generate a BDV HDF5/XML with @tpietzsch how should we test this? I guess pull this branch and use |
yes, exactly.
yes, and then also display it, so that it actually accesses the image data. |
Can you be a bit more specific? Are you refering to this bigdataviewer-core/src/main/java/bdv/img/hdf5/HDF5Access.java Lines 258 to 285 in ec7be0f
I got this from digging into the jhdf5 code. I think it makes more sense for this to be NATIVE, because this describes the type of the memory space. And being a primitive array, that should follow the endianness of the machine it's running on? |
@tischi: yes, I have python code that can write this. I had to adapt it a bit though in order to write the dtype metadata, see constantinpape/pybdv#49. I have created an example file, will send you the location via embl chat. |
@constantinpape your Do you happen to know the value range? |
The value range is 0 to 4294967437. (I offset the non-zero values with the uint32 max id to have actual uint64 data). I have added |
ok, this works:
@tpietzsch Looks like it works (at least for |
@tischi Great! Thanks. |
f297085
to
f3710ac
Compare
For this to work, the datatype must be added as an attribute to each setup group. E.g., the info (pyramid resolutions, etc) for the first setup is under group "/s00" in the h5 file. If "/s00" has a "dataType" String attribute with value "uint8", that means that the datasets for this setup are UnsignedByteType. The values for the "dataType" attribute are the same as for N5. See DataType.toString(). If no "dataType" attribute is present, it is assumed that the datasets for this setup are legacy UnsignedShortType-stored-as-INT16. Supported datatypes are INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT32, FLOAT64.
This is done now. bigdataviewer/bigdataviewer_fiji#31 |
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/bigstitcher-image-fusion-produces-black-bars/85726/14 |
This addresses #154, adding more datatypes to
Hdf5ImageLoader
For this to work, the datatype must be added as an attribute to each setup group. E.g., the info (pyramid resolutions, etc) for the first setup is under group "/s00" in the h5 file. If "/s00" has a "dataType" string attribute with value "uint8", that means that the datasets for this setup are
UnsignedByteType
.The values for the "dataType" attribute are the same as for N5. See DataType labels and
toString()
.If no "dataType" attribute is present, it is assumed that the datasets for this setup are legacy
UnsignedShortType
-stored-as-INT16
.Supported datatypes ("dataType" attribute values) are:
"int8" (
ByteType
),"uint8" (
UnsignedByteType
),"int16" (
ShortType
),"uint16" (
UnsignedShortType
),"int32" (
IntType
),"uint32" (
UnsignedIntType
),"int64" (
LongType
),"uint64" (
UnsignedLongType
),"float32" (
FloatType
),"float64" (
DoubleType
)@tischi, @StephanPreibisch Could you test/review this?
There are two open issues:
Hdf5ImageLoader
respectedImgLoaderHints.LOAD_COMPLETELY
to load datasets fully into an ArrayImg if possible. This is not supported currently, but I don't know how relevant it still is.I'll create separate issues for those.