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

Landmark edits #340

Closed
wants to merge 25 commits into from
Closed

Landmark edits #340

wants to merge 25 commits into from

Conversation

annehaley
Copy link
Collaborator

@annehaley annehaley commented Sep 18, 2023

This PR adds functionality to edit landmarks. Depends on #336.

  • Dragging landmark widgets around on the surface of the target mesh
  • Editing name, comment, and color for widget info
  • Saving new coordinates and info for landmarks to the server
  • Adding a new landmark
  • Deleting a landmark
  • Tested on multi-domain
shapeworks_editing_landmarks.mp4

@annehaley annehaley changed the base branch from master to fix-multi-domain October 2, 2023 20:32
@annehaley annehaley marked this pull request as ready for review October 17, 2023 17:35
@annehaley annehaley requested review from manthey and JakeWags October 17, 2023 17:40
@annehaley annehaley force-pushed the landmark-edits branch 2 times, most recently from 7b2f8a5 to ff64731 Compare October 25, 2023 14:23
Base automatically changed from fix-multi-domain to master October 31, 2023 17:46
@JakeWags
Copy link
Collaborator

JakeWags commented Nov 9, 2023

I'm getting this error when attempting to save landmarks after setting them for each subject:

shapeworks-cloud-django-1    |                     "/opt/django-project/shapeworks_cloud/core/rest.p           
shapeworks-cloud-django-1    |                     y", line 331, in set_landmarks                              
shapeworks-cloud-django-1    |                         target_subject =                                        
shapeworks-cloud-django-1    |                     models.Subject.objects.get(id=subject_id) 

...

shapeworks-cloud-django-1    |                     self.lhs.output_field.get_prep_value(self.rhs)              
shapeworks-cloud-django-1    |                       File                                                      
shapeworks-cloud-django-1    |                     "/usr/local/lib/python3.8/site-packages/django/db           
shapeworks-cloud-django-1    |                     /models/fields/__init__.py", line 1825, in                  
shapeworks-cloud-django-1    |                     get_prep_value                                              
shapeworks-cloud-django-1    |                         raise e.__class__(                                      
shapeworks-cloud-django-1    |                     ValueError: Field 'id' expected a number but got            
shapeworks-cloud-django-1    |                     'undefined'.

Here is the request info:

{
  "info": [
    {
      "color": [
        115,
        199,
        216
      ],
      "comment": "Left atrium L1",
      "domain": "1",
      "id": 0,
      "name": "L0",
      "num_set": 4,
      "visible": true
    }
  ],
  "locations": {
    "undefined": {
      "anatomy_1": [
        [
          24.886963032174492,
          -36.79644370252768,
          9.046421615881442
        ]
      ]
    }
  }
}

@annehaley
Copy link
Collaborator Author

Client test is failing for a reason that is outside the scope of this PR: #351.
A separate PR will be made for this issue, and it should be merged first.

@JakeWags
Copy link
Collaborator

I noticed an error that is manifesting in two ways:

The error:

Uncaught TypeError: iter is null
    Babel 2
    handleLeftButtonPress behavior.js:49
    subscribeToEvents index.js:59
    _loop macros.js:988
    invoke macros.js:977
    <anonymous> index.js:938
    handleMouseDown index.js:418
    handlePointerDown index.js:348
    bindEvents index.js:228
    mounted scripting.js:126
    VueJS 18
    _callee3$ DataList.vue:51
    u main.js:1
    _invoke main.js:1
    g main.js:1
    Babel 8
    _fetchData DataList.vue:33
    fetchData DataList.vue:33
    _callee$ DataList.vue:100
    u main.js:1
    _invoke main.js:1
    g main.js:1
    Babel 4
    VueJS 16
iterableToArray.js:2

Both revolve around selecting a subject, and then placing the landmark on a different subject. For example: If I select LA_01 and then place the landmark on LA_04, the TypeError is thrown.

Here are the two cases I found:

  1. When there are no landmarks created for the data, I can place the landmark on a different subject and it will throw the TypeError, but will still place the landmark on the selected subject. However, this seems to break after doing it once (admittedly this hasn't been super consistent on when I can no longer place landmarks). See this gif to see how it is behaving.

landmarks_feedback_1

  1. When there are already landmarks present, adding a new landmark and repeating the above behavior will break and I can no longer place any landmarks. Also, this doesn't appear to place a landmark at all. See the gif below to see the behavior of this case.

landmarks_feedback

Both of these revolve around placing a landmark on a subject OTHER than the one initially selected. This kind of interaction seems counter intuitive, as the user has to select which subject they will place the landmark on.

@annehaley
Copy link
Collaborator Author

Closing in favor of #355. In working on Constraints, I have needed to refactor Landmarks and change the storage & retrieval mechanisms a considerable amount. Also, the vtk.js bug fixes will be done on top of the changes for both features. The changes for the two features should be reviewed as one.

@annehaley annehaley closed this Nov 20, 2023
@annehaley annehaley deleted the landmark-edits branch April 19, 2024 17:40
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.

3 participants