abria / TeraStitcher

A tool for fast automatic 3D-stitching of teravoxel-sized microscopy images
http://abria.github.io/TeraStitcher/
Other
78 stars 32 forks source link

HDF5Mngr exports data as H5T_NATIVE_CHAR instead of H5T_NATIVE_UCHAR #33

Open jflat06 opened 5 years ago

jflat06 commented 5 years ago

Hello,

We are using teraconverter to generate HDF5 files from tiffs.

We are encountering an issue with the output - the voxel datatypes being output are 8-bit signed integers instead of 8-bit unsigned.

Is there a reason for this?

We have an issue with this, because we need to use software that converts the data to DAP2 data types. As part of the spec for this conversion, 8-bit signed integers are converted to 16-bit integers (You can read the spec at section 3.2.2.1 here). This is then causing issues down the line, where our software expects 8-bit ints.

We'd like to make this change:

diff --git a/src/imagemanager/HDF5Mngr.cpp b/src/imagemanager/HDF5Mngr.cpp
index 896fd00..e80f6f9 100644
--- a/src/imagemanager/HDF5Mngr.cpp
+++ b/src/imagemanager/HDF5Mngr.cpp
@@ -214,9 +214,9 @@ BDV_HDF5_fdescr_t::BDV_HDF5_fdescr_t ( const char *_fname, int _vxl_nbytes, int
        }^M
 ^M
        if ( vxl_nbytes == 1 )^M
-               vxl_type = H5T_NATIVE_CHAR;^M
+               vxl_type = H5T_NATIVE_UCHAR;^M

I am trying to implement this change on my local build here, however I am running into issues with enabling HDF5 support in teraconverter. Looking at the history, HDF5 used to be integrated within the project, but now it has been removed and must be installed separately. Are there instructions on how to do this anywhere? Any help would be greatly appreciated.