-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add reader for renishaw .wdf format #55
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
+ Coverage 85.33% 85.45% +0.11%
==========================================
Files 73 75 +2
Lines 9076 9747 +671
Branches 2053 2140 +87
==========================================
+ Hits 7745 8329 +584
- Misses 860 926 +66
- Partials 471 492 +21
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
011a6bc
to
8983449
Compare
3f735a4
to
9e3882e
Compare
@pietsjoh, what is still missing for this to be ready for review? |
I see in code there is marked some lines with caveats that there could be unknown and unreadable structures. Is this based on Reverse engineering? I think this format is potentially moving target. In such case it would be easier to write parsing using kaitai_struct as it is much easier to adapt parsing then when binary file specification gets updated by OEM. I have experience with RE such moving target (i.e. https://github.com/sem-geologist/peaksight-binary-parser). I think it would be then useful to communicate with gwyddion, and have single Reverse engineering implementation written in kaitai, where gwyddion would compile it into C++ library and this would use python compilation of code. BTW there are some free kaitai_struct descriptions for jpeg and EXIF parsing definitions ready, which could be reused then without needing to add PIL as optional dependency. I saw there is PIL checked as optional dependency to extract jpeg and EXIF; What about using |
d18d146
to
17d1987
Compare
Yes, this format is reverse engineered. I based my work on the py-wdf-reader with some extra inspiration from gwyddion.
I have no experience with kaitai yet, but this might be an option in the future. However, I don't know if Renishaw changes their format often enough for this to be useful.
My implementation is close to how py-wdf-reader reads the EXIF-Tags. I tried using imageio instead, but couldn't get it to work. The picture with the exif-data is still included in the metadata (even when PIL is not installed). So I figured that it is not a big problem if I leave it like this. But I can give it another go and try to use imageio for reading the EXIF tags.
The main issue is licensing, as I based my work on the py-wdf-reader. I just asked in alchem0x2A/py-wdf-reader#43 how to handle this. Moreover, I asked Renishaw directly for some insights on some of the TODO's/questions I have. But this could also be implemented in a different PR. |
I would consider this ready to review ... the remaining questions can be handled along the way :-) |
I tried loading the exif tags with |
pre-commit.ci autofix |
@ericpre: from my side, this is ready to be merged |
This reader is based on py-wdf-reader with extra insights from gwyddion.
Compared to py-wdf-reader, more metadata is extracted (PSET Blocks).
Moreover, changes are made to meet rosettasciio's format.
Progress of the PR
upcoming_changes
folder (seeupcoming_changes/README.rst
)readthedocs
doc build of this PR (link in github checks)Minimal example of the bug fix or the new feature