Giter VIP home page Giter VIP logo

Comments (4)

geektortoise avatar geektortoise commented on August 16, 2024

First ideas :
-) Allow multi selection by adding :multi=true in vl-interaction-select
https://github.com/cytomine/Cytomine-Web-UI/blob/master/src/components/viewer/interactions/SelectInteraction.vue#L17
-) As we don't really want a selection of multiple features, we select one of the features.

In the set selectedFeatures,
https://github.com/cytomine/Cytomine-Web-UI/blob/master/src/components/viewer/interactions/SelectInteraction.vue#L51
we distinct the case if an annotation has already been selected or not.
If an annotation has already been selected and it is still in the "value", it means that we are clicking in a location where this annotation is and we want another anotation sowe will take the "next annotation"
In code

        if(this.imageWrapper.selectedFeatures.selectedFeatures.length == 0){
          if(value.length>=1) value = [value[0]]
          } else {
            if(value.length > 1){
              var index = value.findIndex(x => x.id === this.imageWrapper.selectedFeatures.selectedFeatures[0].id);
              if (index == value.length -1) index = -1
                value = [value[index+1]]
            }
        }
        this.$store.commit(this.imageModule + 'setSelectedFeatures', value);

However, when I try with an example with 3 annotations, I have the following case

  • 1rst click : annotationArray is [1,2,3]. Selected feature is 1
  • 2nd click : annotationArray is [1,2,3]. Selected feature is 2 (next to 1)
  • 3rd click : annotationArray is [2,1,3]. Selected feature is 1 (next to 2)

And I cannot figure why the annotationArray is sorted in this way and how to avoid it.

from cytomine-web-ui.

geektortoise avatar geektortoise commented on August 16, 2024

@urubens : Do you have a better idea (an one that not break your development for track and multi channel :D ) ?

from cytomine-web-ui.

geektortoise avatar geektortoise commented on August 16, 2024

With the previous modifications I also had multiple description fetching (one by clicked feature) and multiple action recording. So maybe this way is not the best option.

from cytomine-web-ui.

geektortoise avatar geektortoise commented on August 16, 2024

Hello,

The first solution with this commit wasn't enough.

I will explain here my test cases :

With 4 annotations labelled 1,2,3,4 in order of area.
image

When I click on the zone at the intersection between 1 and 3, I want to have the annotation 1. If I click again, I want to have annotation 2 and if I click once again, the annotation 3.

It worked with the first solution. However, with the following test case :

  • Click on the little zone at the intersection with 2,3 and 4. Annotation 2 is selected.
  • Click on the annotation 1.
    I expected to have the annotation 1 but I had the annotation 3 because it was the next to 2 in the array [1,2,3].

After some tests, with this configuration and also the following picture, I came with the following algorithm :

  • if there is no previous selection, select the first annotation (i.e. the smallest as sorted previously)
  • if the selection as multiple candidates,
    • if previous selection is in the new target, we will take the first element not yet visited.
      The visited elements are the previously selected annotation and all annotation before him in the array (so the smallest annotation already selected). To get these elements, we save the targetedFeatures : the features that are located where we clicked when we made our previous selection.
    • else, we will select the first annotation

image

I think it could be better but it solve the current problem and a majority of cases.

from cytomine-web-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.