-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure we handle handedness correctly #10
Comments
Current implementation is not consistent with mrcfile. In mrcfile, the shape of data should be but in MRCFile.jl, the shape is |
I probably will not be able to look into this again for several weeks, but I think this is because in an MRC file data is written row-major, while Julia represents data as column-major, which for multidimensional arrays reverses the order of dimensions. Perhaps we can use a |
It seems that there is no elegant way to handle it. It has been discussed in HDF5.jl, https://github.com/JuliaIO/HDF5.jl/blob/master/docs/src/index.md#language-interoperability-with-row--and-column-major-order-arrays |
Yeah, I've come across it there and with NetCDF as well. The main difference here is that in HDF5 and NetCDF the dimensions can be anything so there is no sensible default ordering, whereas in MRC they are clearly defined (from https://www.ccpem.ac.uk/mrc_format/mrc2014.php):
In fact, IIUC, the speed assessment of the axes in the spec seems to assume interfaces use row-major ordering. So unless there are any interfaces that provide access to MRC data with a different ordering than mrcfile's, it might make sense to always return a permuted view. |
My concern is that if we permuted the data array, then |
I don't think it would be unmeaningful. Just like reading data from an MRC file, we would wrap the mmapped array in a But before doing anything, it's worth surveying the major packages that load MRC files and see what they do. |
I see. |
From the MRC2014 spec:
It would be bad if we got this wrong. Probably the best thing we can do is check that what we do is consistent with the mrcfile package, which is standard.
The text was updated successfully, but these errors were encountered: