Hi Dave,
Glad you're finding the toolkit useful.
First of all, a complete discussion of hyperslabs and dataspaces in general is beyond the scope of what I want to tackle, and I'll refer you to the HDF5 documentation, particularly
here
and
here
.
That said, you are making the right selection with your start, count, block and stride to do what you want. If I had to guess, your problem lies one of two places: the selection operation, or the memory dataspace.
1) Selection Operation
The default operation in HDF5 Dataspaces.vi is H5S_SELECT_OR. This is probably unfortunate, because the dataspace is initially set to select all of the elements. Thus, ORing a new hyperslab accomplishes nothing. Use H5S_SELECT_SET for the first (or only) hyperslab that you select in your dataspace.
2) File vs. memory dataspace:
The HDF5 Dataspaces example uses the same dataspace for both file and memory. This may not be what you want. This has the meaning that the function will expect the array in the dataset to be the same dimension as the array in memory into which the data is read. If you had the dataset [0,1 ... 9] and you wanted to your selection ( Hslab(2, 5, 1, 1) ) into an array just long enough to hold these data, you would need to use different dataspaces for file and memory. The dataset for file would be the hyperslab selection, but the dataset for memory would select all the elements in a dataspace of dimension [5].
One way to accomplish this is to initialize the array feed into the H5Dread node to the appropriate size and leave the HDF5 Memory Dataspace input unwired. It defaults to selecting a memory space that matches the input array, if it is present. You can use the Get Select Count (H5Sget_select_npoints) function to figure out how many points are selected out of the file dataspace.
I've attached a modifed version of HDF5 Dataspaces to this post that demostrates this.
As to your question about how to select a 10x10 out of 100x100 (or, any size dataspace>=10x10, really)
Start: N,M
Count: 10,10
Block: 1,1
Stride: 1,1
For extra credit, can anyone give me another hyperslab selection that will accomplish the same thing?
Jason