-
Notifications
You must be signed in to change notification settings - Fork 28
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
Incorrect Scale Conversion for Non-FEI MRC Files #91
Comments
Hi @AndrewHerzing! It might be better to have this as a rosettasciio issue rather than a hyperspy issue. We can always make the changes both places but it is just better to have all of the discussion in rosettasciio rather than in hyperspy. |
This makes sense. Looks like a pretty easy fix. |
Here is a link to test dataset which will reproduce the error: https://drive.google.com/file/d/1zv1gaa3YYe8Sg5kbaUsPx3qV5yfcFsyX/view?usp=sharing It is a short tilt series consisting of 9 images which are 512x512 pixels each with 'int16' data type. The pixel size should be 4.416 nm rather than 441.6 as the reader is currently written. |
@AndrewHerzing, thank you for sharing the file, we are finally getting around sorting these mrc issues in #131. Is it possible to get smaller test file? If so, when you have a chance, could get and share a smallest possible file to add to the test suite please? Was the file created using IMOD/SerialEM? |
This was close automatically when merging #131, but let's keep it open for now so that we don't forget to add some test file. |
Here is a ~1MB MRC that was generated with SerialEM. This is the smallest I can create at the moment because our scope is down for repair. The scale as read by Hyperspy is 315 nm whereas it should be 3.15 nm. https://drive.google.com/file/d/1vGQO9VM1JFyOwHMzZYnDxnnPdejTDw58/view?usp=sharing |
By the way, with the development versions of HyperSpy (RELEASE_next_major branch) and RosettaSciIO, you should already be able to read the files correctly - in case you are comfortable to install these. |
Thank you @AndrewHerzing, would it be possible to wait to even smaller file? Maybe with different dtype too? The bug has been fixed and until we have a new file we can check manually, when necessary. it seems that most of the code was more than 10 years for the mrc reader (possibly written at a time, where writing test wasn't enforced!) and it is not like the code need to be changed very often! :) |
For MRC files that are not collected by FEI software, the scale is assumed to be in Angstroms and Hyperspy converts it to nanometers. However, the conversion is done by multiplying by 10 rather than dividing by 10. The relevant lines of code are 179 - 187 in
mrc.py
.The text was updated successfully, but these errors were encountered: