Kitware / UPennContrast

UPenn ?
https://upenn-contrast.netlify.com/
Apache License 2.0
8 stars 6 forks source link

Fix import of annotation properties #755

Closed bruyeret closed 4 months ago

bruyeret commented 4 months ago

I fixed the import of annotation properties Overwriting annotations works on my side, are you sure that annotations are not removed?

Close #751 Close #752

bruyeret commented 4 months ago

Oh ok so you would like to "merge" the properties that are exactly the same (except for their ID)? We could add another checkbox "merge identical properties" that would be checked by default It would avoid creating a new property when there is already one with the same settings

arjunrajlab commented 4 months ago

It is a good question! I was actually thinking they would be completely replaced if the user selects "overwrite". I think that would be the expected behavior. I don't think we need to merge, although I suppose we could give the option to merge the workers.

bruyeret commented 4 months ago

I added a commit to fix it in the same way as for annotations, is it better?

arjunrajlab commented 4 months ago

That works great! Here's another small issue. Here's a snippet from a sample JSON:


        {
            "id": "abc12345",
            "name": "Magicness"
        },
        {
            "id": "def54321",
            "name": "Evilness"
        }
    ],
    "annotationPropertyValues": {
        "6692561b6fbb27ec7b06ea42": {
            "669256da6fbb27ec7b06ea98": {
                "Area": 5840,
                "Centroid": {
                    "x": 678.4908105022831,
                    "y": 279.0122431506849
                },
                "Circularity": 0.8205950927590248,
                "Compactness": 0.8205950927590248,
                "Convexity": 0.9756912538635034,
                "Eccentricity": 0.8007082748936661,
                "Elongation": 0.3771186440677967,
                "Fractal_Dimension": 1.3146444632102863,
                "Perimeter": 299.0521284760509,
                "Rectangularity": 0.7680445059379685,
                "Solidity": 1.0075347154358751
            },
            "6692570b6fbb27ec7b06eaa3": {
                "25thPercentileIntensity": 1234,
                "75thPercentileIntensity": 12345,
                "MaxIntensity": 19999,
                "MeanIntensity": 100000,
                "MedianIntensity": 3333,
                "MinIntensity": 8888,
                "TotalIntensity": 123456,
                "FakeIntensity": 76543
            },
            "abc12345": {
                "Magicness": 100
            }
        },
        "669256326fbb27ec7b06ea54": {
            "6692570b6fbb27ec7b06eaa3": {
                "25thPercentileIntensity": 4843,
                "75thPercentileIntensity": 27636,
                "MaxIntensity": 47803,
                "MeanIntensity": 15642.933621933622,
                "MedianIntensity": 8704,
                "MinIntensity": 3333,
                "TotalIntensity": 10840553
            },
            "def54321": 1000
        }
    }
}

I can import it just fine. However, it throws some Vue errors because I didn't define a lot of the variables in the property definition that are specific to workers. Consequently, it doesn't have a "delete property" button. We can decide what to do about it (including maybe nothing).

image