-
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
polygon support #253
polygon support #253
Conversation
let's put that onhold, we will do without for training. |
To add to the description: |
Don't forget there's the really old format too: https://github.com/openmicroscopy/openmicroscopy/blob/v5.4.1/components/tools/OmeroPy/test/unit/test_rois.py#L32 which should be either tested or an appropriate error message shown. |
Thanks @manics - That should be handled by the webgateway marshalling: https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroWeb/omeroweb/webgateway/marshal.py#L357 |
The same should be done for Polyline |
The changes in shape-editor must go to its repository https://github.com/ome/shape-editor |
Gruntfile.js
Outdated
expand: true, | ||
cwd: 'node_modules/ome-shape-editor/dist/js', | ||
src: 'shape-editor.js', | ||
dest: 'omero_figure/static/figure/3rdparty/shape-editor-3.1.0' |
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.
The version of shape-editor should ideally be retrieved from package.json
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.
Hmm - that might be kinda tricky.
This version number is also in index.html
<script src="{% static 'figure/3rdparty/shape-editor-3.1.0/shape-editor.js' %}"></script>
Having that version number in multiple places is not new, but now we don't have the shape-editor.js code itself.
@jburel Any idea what's going on here? Even when I remove the small change I made to
|
2 problems detected #253 (comment) and #253 (comment), otherwise works as expected |
Tested locally and working is working fine for editing an iviewer image with ROIs. Small issue with copying an image with shapes that lie outside the image viewport, as @pwalczysko mentioned before me. |
Raising the limit to 500 seems fairly arbitrary and likely to require your testers to increase the number of ROIs they have to add before they see a potential problem, no? |
Not entirely arbitrary, but this was a quick fix I needed for the iviewer demo movie and could certainly be improved. |
understood.
understood. Was having it at 200 causing issues because it was different from the API's 500 or is there another underlying issue? i.e. must the values be the same? |
I reckon 200 was an arbitrary value set since figure did not use the json api to load roi. |
On the image I used in the movie, the ImageJ Analyse-Particles created over 200 polygons on the image, so that the Arrow I added in iviewer was not included in the first 200 shapes I loaded into figure (so it didn't show up in figure). |
Sorry for derailing this PR. Assuming the summary is correct, happy for "figure should load more than 1 page of ROIs" to be captured somewhere. |
That should fix the 2 problems reported by @pwalczysko above. |
h = sqrt(dx * dx + dy * dy) | ||
# and the angle (avoid division by zero!) | ||
if dy == 0: | ||
dy = 0.000001 |
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.
what is the rationale?
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.
You can't divide by zero, but dividing by a number close to zero works very well and is the simplest workaround (the previous workaround was not working).
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.
Isn't this the case we you want to use math.atan2
rather than math.atan
?
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.
Yep, that works. Thanks
Yes, both problems are fixed. Ready to merge FMPOV |
Could you open a PR against shape-editor? |
Conflicting PR. Removed from build FIGURE-merge#677. See the console output for more details.
|
Doh - conflict was bound to happen sometime I guess with these two big PRs. |
No problem noticed with handling of polygons/polylines
|
I have deprecated shape-editor from npm (couldn't unpublish).
Can you now publish |
package has now been published under the organisation |
Thanks. Hopefully with a final test to check this is working, we should be good to merge? |
I would think so. Added chat to standup |
Retested with the latest change on web-dev-merge |
Supports adding of Polygons from OMERO to figure and editing them in Figure.
NB: creation of NEW polygons in figure is not supported in this PR.
To test:
cc @pwalczysko