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

Verify or calculate offset from FileLength #25

Open
mkitti opened this issue Apr 23, 2022 · 3 comments
Open

Verify or calculate offset from FileLength #25

mkitti opened this issue Apr 23, 2022 · 3 comments

Comments

@mkitti
Copy link
Contributor

mkitti commented Apr 23, 2022

Currently the code reads a "FileLength" attribute from the header, but this is currently unused.

https://github.com/janelia-cosem/fibsem-tools/blob/f4bedbfc4ff81ec1b83282908ba6702baf98c734/src/fibsem_tools/io/fibsem.py#L587

One use of this would be to verify or calculate the OFFSET location rather than assuming that it is at 1024. That is OFFSET == FileLength - np.prod(shape)*np.dtype(dtype).itemsize

@mkitti mkitti changed the title Verify or calculate from FileLength Verify or calculate offset from FileLength Apr 25, 2022
@d-v-b
Copy link
Contributor

d-v-b commented May 5, 2022

As long as the offset is in fact a constant, I think we should continue to treat it that way in the .dat reader. As for doing a validation, unfortunately it's possible for data to be incomplete (due to some problem during acquisition), and then the file length couldn't be used to infer the offset. Rather, in this situation the offset is needed for validating the file length.

@mkitti
Copy link
Contributor Author

mkitti commented May 6, 2022

Perhaps we should actually record the offset somewhere then. It may be needed in case the metadata needs to expand.

@mkitti
Copy link
Contributor Author

mkitti commented May 6, 2022

Is the FileLength verified anywhere in this repository?

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

2 participants