Conversation
| // (this is also reflected in the x and y coordinates of the codeblocks in the iSyntax header). | ||
| for (i32 scale = 0; scale < wsi_image->level_count; ++scale) { | ||
| isyntax_level_t* level = wsi_image->levels + scale; | ||
| level->origin_offset_in_pixels = ((PER_LEVEL_PADDING << wsi_image->level_count) - PER_LEVEL_PADDING) >> scale; |
There was a problem hiding this comment.
This doesn't look right (see my other comment elsewhere).
To keep the git history clean I'll fixup and reproduce the changes from this commit in my own commit.
| i32 width_in_tiles; | ||
| i32 height_in_tiles; | ||
| u64 width; | ||
| u64 height; |
There was a problem hiding this comment.
u64 doesn't match int32_t in the getters in libisyntax.c/h
I'll go with i32 here.
|
The git commit history became a bit messy and I found some errors that needed fixing, so I decided to make a new commit 82d04a6 |
|
Note that iterating from scale 1 is correct. The values should all be 0 for level 0, and will be incorrect if included in the for loop. |
|
@Falcury Thanks for the "merge". Are you sure the offset isn't there in level 0? I checked with the isyntax_example. |
|
The way I have it in my head is: level 0 has offset 0 (i.e. needs no initialization because already zero-initialized). Then each successive level has a higher offset (as calculated in terms of level 0 pixels) that follows the formula. But, I also know I’ve gotten this stuff wrong in the past (multiple times)... I’ll run some tests tomorrow, including using your TIFF converter, and try to fix it if there are still errors! |
|
Great, thanks! We use SlideScore, which uses the Philips SDK, as a sanity check I will look up some slides we annotated there and compare with isyntax -> tiff in the different levels to see if they align in the same way. I think in the dwt in level 0, what they do is have |
Probably this gives 'approximately' correct results, but I'm almost certain that this is not fully correct. Philips' documentation on the file format also specifies the per level padding to be ((3 << level) - 2). I believe this refers to the encoding process, where level 0 is the base image and for each successive encoding step, padding is added to enable the wavelet transform to proceed correctly. For decoding, you have to 'think in reverse' as to what is going on and the actual offset for the decoded image ends up being ((3 << (level-1)) - 2). |
This commit:
It is forked from the changes I made to make a read_region function work.