Skip to content
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

Copy labelled shape meta data to pasted shape #137

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Copy labelled shape meta data to pasted shape #137

wants to merge 3 commits into from

Conversation

flurmbo
Copy link

@flurmbo flurmbo commented Nov 10, 2018

Purpose / Goal

Implements #115. Copies category, label, feature point labels, clones attribute and tag arrays and then stores them as properties of a metadata object passed into attachShapeToImg.

This might not be the cleanest implementation. I think it would be better if the shapes in the selectedElements array already had a copy of the metadata, but I wasn't sure how to do that. I am also not completely sure what the difference between shape and getShape(shape.node.id) is.

This implementation seems to work though so thought I would make a pull request anyways to see what others think.

Type

Please mention the type of PR

  • Bug Fix
  • Refactoring / Technology upgrade
  • New Feature
  • Documentation
  • Other : | Please Specify |

Note : Please ensure that you've read contribution guidelines before raising this PR.

@flurmbo flurmbo changed the title Paste metadata Copy labelled shape meta data to pasted shape Nov 10, 2018
@amitguptagwl
Copy link
Member

@flurmbo there is an object labelledData which contains all the detail of shape, points, and images. What you need is particular id to get the detail. When you need metadata of a shape or to store it you can directly interact with labelledData. I hope, it can answer your question.

Though you've done the good job to do the changes but I believe some of the changes may introduce the bugs. I'll really appreciate it recheck your changes and test the application.

@flurmbo
Copy link
Author

flurmbo commented Nov 10, 2018

Hi @amitguptagwl, thanks for your prompt reply! I think you mean labellingData? If so, I did use that. In the function getMetadata(), I call getShape() which interacts with the labellingData array.

What I don't understand is why the objects returned from labellingData contain the metadata while the objects in selectedElements do not. So perhaps a more intuitive solution than my pull request would be to go in and change how selectedElements is set.

@amitguptagwl
Copy link
Member

As I said previously, labellingData contains all the detail. When a user copies the shapes from one image, this action should basically capture the shape detail from the workarea and paste the same on other image. Hence it doesn't have metadata. Now as we want to copy the metadata as well, there are 2 solutions I can see;

  1. When a user copies shapes, capture the metadata from the labellingData and save it to copiedElements. When the user pastes the data, read everything from copiedElements and insert into labellingData then re-render the workarea..
  2. When a user copies shapes, capture only the IDs (or necessary data) to copiedElements. When the user pastes the data, read data from labellingData and insert into labellingData then re-render the workarea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants