Hi all,
I am baffled by this problem, no idea what I am doing wrong.
I need to read from 3D datasets which looks like this:
I am interested in accessing one column at a time, so I tried a lot of things along this line:
short data[251]; // short really is 16-bits signed
hsize_t count[3]; count[0] = 1; count[1] = 1; count[2] = 251;
hsize_t offs[3]; offs[0] = offs[1] = offs[2] = 0;
hsize_t stride[3]; stride[0] = stride[1] = stride[2] = 1;
int nrtoread = 251;
filedataset.selectHyperslab( H5S_SELECT_SET, count, offs, stride );
H5::DataSpace inputdataspace = filedataset.getSpace();
H5::DataSpace outputdataspace( 1, &nrtoread );
dataset_->read( data, H5::PredType::STD_I16LE, outputdataspace, inputdataspace );
I also tried reading into a 3D array [1][1][251] and various other ways, but I consistently get this data in the array:
3786 0 0 3555 0 0 3820 …
Thus, I get the right values into the right spots in the array but every time 2 values are not filled.
Any suggestions?