Viewing column-major data in HDFView #174
Labels
Component - HDFView
Improvements to the visual interface layer
Priority - 3. Low 🔽
Code cleanup, small feature change requests, etc.
Type - Improvement
Improvements that don't add a new feature or functionality
I understand that HDF5 is row-major only. Whenever the original data is column-major in memory, the usual approach is to save it transposed. Thus, a "5 x 3" matrix is saved as a "3 x 5" dataset and when it is read back it is seen as a "5 x 3" matrix again.
HDFView has a nice feature where I can right-click in the dataset, choose "Open as", and then change which dimensions corresponds to the height, width and depth in the visualization. The only problem is that I need to do this everytime I open the HDF5 file and I want to view that dataset. Is there a way to save this as metadata (an attribute in the dataset) to make HDFView automatically visualize the dataset with transposed dimensions? This could work similarly to how HDFView handle images, where the presence of some attributes is used to tell HDFView to visualize the data as an image, instead of just numbers.
The easiest way, in my opinion, would be for HDFView to simply revert the default dimensions corresponding to height, width and depth if a "DATA_LAYOUT" attribute with value "TRANSPOSED" was set in the dataset. In order words, for a 3D dataset with dimensions "5 x 3 x 8", for instance, it would use dimension 2 as height, dimension 1 as width, and dimension 0 as depth if the attribute is set.
The text was updated successfully, but these errors were encountered: