Skip to content
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

Issue reading files with an FEI2 extended header including unused space #50

Closed
dagewa opened this issue Feb 22, 2023 · 0 comments
Closed

Comments

@dagewa
Copy link
Contributor

dagewa commented Feb 22, 2023

According to the FEI extended header specification, the extended header may have unused space after the NZ sequential metadata blocks. I have come across a file like this that was apparently produced by Velox, where it looks like this space is used as padding to bring the total size of the extended header, NSYMBT, up to the nearest multiple of 512 bytes.

At the moment, such files cannot be read by mrcfile, because an attempt is made to coerce the full NSYMBT-long bytearray into an array of elements with data type of each metadata block:

self._extended_header.dtype = dtype

The specification document states:

Image reading and processing software can use the Metadata Size value from the first Metadata Block to index the blocks for the other frames in the MRC file.

I'm happy to try to (eventually!) put in a PR to add that behaviour, noting this warning, as discussed by email:

We might need a new attribute or method to get the indexed part of the extended header, since elsewhere we assume that header + extended header + data = file size, and we wouldn’t want to leave part of the file un-allocated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant