-
Notifications
You must be signed in to change notification settings - Fork 31
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
Crop rotation fixes #410
Crop rotation fixes #410
Conversation
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/omero-figure-box-annotations-rotated-incorrectly/45787/4 |
Up till this point all worked. The above one I am not sure what to do with - where is the unrotated uncropped Panel ? I just used it in the previous step, and pasted the ROI on it, and it (the ROI, not the panel onto which I pasted) was rotated.... as I would expect. This seems to me like a repetition of the previous test, but now, surprisingly, a new result expectation (rotation of the unrotated panel) seems not reasonable - certainly there is some misunderstanding. |
This means to use the "Paste" button at the bottom of the "Preview" Tab, to apply the same crop and rotation to the selected panel. This is NOT Pasting to create a new ROI as in previous steps. |
Thanks, got this one, and it works as expected. |
Sorry, struggling with this one too. Using the Crop button is clear, but should I first rotate and then Crop ? This means I should not zoom first ? Should I copy and paste the ROI somewhere ? If I do as told here, I am ending up with see screenshot below, how do I get the ROI displayed on the rotated image as shown on yours ? |
After clarification, I was able to verify the above workflow too, it works fine. Nevertheless, in this workflow, if the ROI does not come from the zoomed-in region but, is copied from another place in Figure (screenshot 1 below) or comes from OMERO (screenshot 2 below), this workflow still fails, as the copied or "from OMERO" ROIs are displayed unrotated. Screenshot 1 (ROI copied from somewhere else in Figure and pasted (option "From Clipboard") Screenshot 2 (ROI from OMERO in Crop dialog, ROI should be rotated as the image is rotated) |
In summary, 3 RFEs : 2 RFEs regarding the crop dialog and rotation #410 (comment) and one regarding the Edit ROI dialog #410 (comment) |
@pwalczysko I'm afraid fixing the "Edit ROIs" dialog to handle rotated images isn't easy since we'd need drawing tools to allow you to draw rotated Rectangles which I don't have (hand-coded drawing tools). But the other 2 RFEs above should be fixed:
|
I think this is fine. I would suggest a (couple of) short video(s) for the solution of the rotation and crop workflows would be very handy, as these workflows are very popular, but as the testing shows, not easy to get right on the first try. Would you like to list for testing next week with my name ? |
This works as expected. Ready to merge fmpov. |
That last commit fixes an issue I noticed while preparing a demo movie: If you paste the crop region from a panel with 0 rotation, it didn't apply it to the new panel (it didn't remove the rotation on the target panel). |
I made a demo movie for this PR: crop_demo.mp4 |
@will-moore great movie, thanks, these are precisely the workflows which were picked upon in the recent workshop again, and the difference of those two Paste buttons is nicely shown |
This could probably go to the official youtube channel otherwise it will be lost |
Yes, can make the video more "public" when we release. |
Tested |
No. When I use the Paste button from Preview pane, the rotation should be set to zero. |
Yes, the rotation on Pate is indeed set to zero. Sorry, typo (in my original report, there are two "no"s for both of the panes, in truth, I shoiuld have written "y" for the Preview pane, as this is what I saw. Sorry |
Inside the Crop dialog, copied a Rrectangle ROI from another panel which was rotated so that it is in Clipboard now. the desciption above says
But when I click the Clipboard thumb it does not apply any rotation, instead, it unrotates the main panel in the Crop dialog and pastes the ROI correctly. Did this behaviour change (i.e. unitended change) or is it a misunderstanding ? |
You copied a Rectangle ROI, but my text says "IF you copied the crop region..." Does the thumbnail representation that you clicked look like the crop outline that is generated when you click it? |
thanks for explaining. |
Compare the situation inside Crop dialog described in previous comment with the situation when I paste the crop region without using the Crop dialog on the same image. This behaviour seems right here, whereas the Crop dialog above #410 (comment) shows the wrong thumb and when thumb is clicked, a wrong rotation and position is shown in main panel. |
Sorry @pwalczysko I can't seem to reproduce the bug you're seeing. |
The image used is (user-3) https://merge-ci.openmicroscopy.org/web/webclient/?show=image-140172 The figure saved is https://merge-ci.openmicroscopy.org/web/figure/file/70451 We clarified the workflow on a call - basically, taking the crop region from the zoomed in image, then selecting the non-zoomed non-rotated original image in the same figure and clicking on Crop button. In the crop dialog, the thumb of the Clipboard is wrong, as well as when this wrong thumb is applied onto the image, it is not where it should be either. |
The problem #410 (comment) is fixed now. Ready to merge fmpov. |
Fixes #408 - copy rotated crop region and paste to ROI.
Also fixes #324
Rectangle ROIs don't support rotation, but this fixes the issue above by creating a Polygon to simulate a rotated Rectangle.
To test: