ComputationalRadiationPhysics / imresh

Shrink-Wrap Phase Reconstruction Algorithm
MIT License
3 stars 2 forks source link

readHDF5 just returns the first line of the image #23

Open Ferruck opened 8 years ago

Ferruck commented 8 years ago

I guess the issue is in the second call to

splash::SerialDataCollector::read( int32_t, const char*, const Dimensions, void* )

where the void* buffer is already initialized (a float* with the dimension's scalar size as the size in this case). The first call seems to work as the scalar size is 40000 (200 * 200) which is the correct size.

mxmlnkn commented 8 years ago

On my system libSplash can't even open the file, even though it works with ifstream:

terminate called after throwing an instance of 'splash::DCException'
what():  Exception for [SDCHelper] Failed to open reference file ../examples/testData/imresh_0_0_0.h5

The error message isn't very informative either. The error message should be thrown if the file wasn't found, but I can open the file with ifstream, so I'm not sure about this.

Ferruck commented 8 years ago

Opening the file works like a charm for me.

mxmlnkn commented 8 years ago

The problem seems to be in libSplash/src/SDCHelper.cpp

    // open the file to get reference data from
    hid_t reference_file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_FILE_ACCESS_DEFAULT);
    if (reference_file < 0)
        throw DCException(getExceptionString(std::string("Failed to open reference file ") +
            std::string(filename)));

H5Fopen seems to be a call to libhdf5 (although there is no direct include in that file only in the header). I get the feeling this could be related to #25 ...