-
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
Renishaw reader calculates the scale for the microscope image incorrectly #301
Comments
Are you saying that the offset and scale of the microscope image are incorrect but the hyperspectral maps are correct? The scale and offset of the microscope image are calculated in rosettasciio/rsciio/utils/image.py Lines 42 to 70 in e499110
And what it does seems to be consistent with your description of how it should be calculated. As I remember, the data that I have doesn't have this issue. Can you share files and screenshots? |
To me it looks like an issue with the way scale is calculated using FieldOfViewXY. Maybe there is a difference depending on the version of WiRE? I am on 5.6 |
@ericpre Looking back at this I misspoke. You only need to change fields_of_views to be equal to (FocalPlaneXResolution, FocalPlaneYResolution). Doing this yields the correct map area for me. |
@Asharits, can you share a file? |
Yes, here is a file: 532nm_1800 map.zip Here is the screenshot of the file from WiRe: |
@Asharits, thank you for sharing the file. I will do some check when I have a chance but it all looks consistent. I made a PR with the fix: #327. |
Describe the bug
In the Renishaw reader, the scale for the microscope image (WHTL) is being calculated incorrectly for hyperspectral maps. This causes the mapped area (red box) to show up in the wrong area.
To Reproduce
I verified this by comparing images to mapped area in the WiRE versus what Hyperspy is plotting for multiple datasets.
Expected behavior
I am not sure where in the reader this is being calculated but it is an easy fix. In the original metadata for the microscope image, FocalPlaneXYOrigins contains the origin for X and Y. FocalPlaneXResolution and FocalPlaneYResolution contains the length of the image. These values just need to be added to the origin values and then divided by the image shape to obtain the correct scale.
I tested this out on some of my datasets and it fixed the scale and the red box was now in the correct place.
Python environment:
The text was updated successfully, but these errors were encountered: