Repository navigation
Read Leica PTG binary TLV headers and transposed scanner poses - #93
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Leica PTG scan files carry a binary TLV header, not the text header the reader assumed, so real Cyclone exports failed to open. This PR decodes the actual layout and fixes the scanner pose convention.
Format (verified against real multi-chunk samples, byte-exact)
PTG\0+ magic0x928FA3C7, then records[u32 nameLen][name\0][value]:%%version,%%cols,%%rows,%%properties— bare u32%%transform— 16 float64[u32 len][bytes with trailing NUL]%%header_begin/%%header_end— no value; the header ends at%%header_endoffsets[0]equals the table endPclTransformcolumn-vector convention on loadChanges
PtgHeader.Parserewritten as a bounded binary TLV parser (1 MiB header, 256-byte names, version 1 and described keys only, finite transform values)Verification
infoandexportverified end to end on the real sample