fix(IBA): reorient() cases for transpose and transverse - #5350
Conversation
Orientations 5 and 7 were swapped: case 5 produced transverse and case 7 produced transpose. Fix both cases. Also, fix the orientation labels for 6 and 8 in the metadata conventions docs. Fixes AcademySoftwareFoundation#4661 Signed-off-by: Luna Kim <177369799+luna-y-kim@users.noreply.github.com>
| 4 flipped vertically (bottom to top, left to right) | ||
| 5 transposed (left to right, top to bottom) | ||
| 6 rotated :math:`90^\circ` clockwise (right to left, top to bottom) | ||
| 6 rotated :math:`90^\circ` counter-clockwise (right to left, top to bottom) |
There was a problem hiding this comment.
Are you sure this description is correct?
If this is default orientation 1:
0--->
1--->
2--->
and this is orientation 6, rows right to left and columns top to bottom:
2 1 0
| | |
v v v
Wouldn't you say that the second pattern is rotated clockwise from the default?
|
The orientation codes are so inherently confusing to think about in words. I also think, if we don't have it, we really need a testsuite verification of reorient for EACH of the 8 values. I guess we don't, or the code change you made would either be failing tests, or be accompanied by updated reference images? I have to admit I'm afraid to accept this change in behavior without a visual test that proves that the new code definitely does the right thing. |
Yes, the wording is super confusing. A visual illustration sounds good. That'd be helpful. Also, the intro paragraph in the display hints docs does define the ordering convention, but still it requires some eyeballing for me. For values like 6 and 8, I couldn't tell which part of '(right to left, top to bottom)' described what. |
|
It feels like the right order of operations is:
Without the visual example (and multiple people looking it over), I honestly don't trust myself to get this right just using the words and my head. It's really easy to make mistakes when reasoning about it. |
|
Maybe something that looks like this: |
|
oh no, did I already mix up rows and columns? |
|
It's even confusing visually :-) Does "cols" mean "this line is an example of a column" or does it mean "column indices increase in this direction?" |
|
Better? |
|
I want to make something that nobody could possibly look at and still be confused. :-) |
That is exactly what confused me. An example of Orientation 6. |
I think I should've done this before opening the PR. I thought I understood it correctly. Lesson learned. I'm going to work on step 1 and share soon! |
But not IN the image. If we're showing how each one should display, top is always top, etc. but the contents of the image rotate. OH, I just realized I described the process incorrectly. (See? Confusing!) I think the correct description is:
|
Orientations 5 and 7 were swapped: case 5 produced transverse and case 7 produced transpose. Fix both cases.
Also, fix the orientation labels for 6 and 8 in the metadata conventions docs.
Fixes #4661
Checklist:
and if I used AI coding assistants, I have an
Assisted-by: TOOL / MODELline in the pull request description above.
behavior.
PR, by pushing the changes to my fork and seeing that the automated CI
passed there. (Exceptions: If most tests pass and you can't figure out why
the remaining ones fail, it's ok to submit the PR and ask for help. Or if
any failures seem entirely unrelated to your change; sometimes things break
on the GitHub runners.)
fixed any problems reported by the clang-format CI test.
corresponding Python bindings. If altering ImageBufAlgo functions, I also
exposed the new functionality as oiiotool options.