You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading JPK file the raw data needs to be scaled and offset, the values of these offsets are found in the tags of the channel pages but there are multiple scaling factors currently AFMReader can choose the incorrect scaling factor leading to incorrect z values.
I have fixed this by seperating out the different scaling factors into their slots and selecting the 'default' slot that was used within the instrument.
Copy of the output
There is no error, the z values of loaded images are just incorrect.
To Reproduce
No response
AFMReader Version
0.1.0
Python Version
3.11
Operating System
Windows
Python Packages
No response
The text was updated successfully, but these errors were encountered:
The image below shows the output of 9 channels from the sample jpk used in examples and testing. When compared with other software that reads .jpk files (gwyddion, JPK DP, NanoLocz) the scaling is incorrect for each channel other than for measuredHeight.
Additionally phase can not be processed due to a key error when reading the scaling type. That gives this error message:
File "C:\Users\ggjh246\OneDrive - University of Leeds\Code\test_jpk_load.py", line 15, in <module>
raw_image, px2nm = load_jpk(file_path, channel)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ggjh246\AppData\Local\anaconda3\envs\AFMReader_pip\Lib\site-packages\AFMReader\jpk.py", line 95, in load_jpk
scaling_type = channel_page.tags["33027"].value
~~~~~~~~~~~~~~~~~^^^^^^^^^
File "C:\Users\ggjh246\AppData\Local\anaconda3\envs\AFMReader_pip\Lib\site-packages\tifffile\tifffile.py", line 11915, in __getitem__
raise KeyError(key)
KeyError: '33027'
Through introducing a function that can accurately read the channel and scaling data this can be corrected and the output matches the values from the other AFM image processing programmes.
Describe the bug
When loading JPK file the raw data needs to be scaled and offset, the values of these offsets are found in the tags of the channel pages but there are multiple scaling factors currently AFMReader can choose the incorrect scaling factor leading to incorrect z values.
I have fixed this by seperating out the different scaling factors into their slots and selecting the 'default' slot that was used within the instrument.
Copy of the output
There is no error, the z values of loaded images are just incorrect.
To Reproduce
No response
AFMReader Version
0.1.0
Python Version
3.11
Operating System
Windows
Python Packages
No response
The text was updated successfully, but these errors were encountered: