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

Allow json mapping usage #16

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

NathanMolinier
Copy link

@NathanMolinier NathanMolinier commented Nov 27, 2024

Description

In this PR, 2 new parser variables were integrated -ref-map and -pred-map. They both point to JSON sidecars that can be used to remap values present inside the corresponding reference and prediction images.

This is especially useful when values between the prediction and the ground truth are not the same and also to simply remove some structures from the comparison.

JSON example:

{
        "T12":32,
        "T12-L1":91,
        "L1":41,
        "L1-L2":92,
        "L2":42,
        "L2-L3":93,
        "L3":43,
        "L3-L4":94,
        "L4":44,
        "L4-L5":95,
        "L5":45,
        "L5-S":100
}

Note: It can also be used to compute validation on a single structure present in the image whereas multiple other structures may appear:

For example:

{
        "lesion":2
}

This way we could get rid of these lines:

# NOTE: this is hacky fix to try to speed up metrics computation, tread very carefully
if len(unique_labels) == 2:
# compute metrics only for lesions
unique_labels = unique_labels[1:]

Final table

Screenshot 2024-11-28 at 11 11 32

@NathanMolinier NathanMolinier changed the title Nm/allow json mapping usage Allow json mapping usage Nov 27, 2024
@valosekj
Copy link
Member

Can you please provide an example of these JSON sidecars?

@NathanMolinier
Copy link
Author

I updated my original comment with some complimentary information @valosekj

@valosekj
Copy link
Member

Thank you, Nathan! I understand it now. Thanks for implementing this feature!

@valosekj
Copy link
Member

valosekj commented Dec 7, 2024

Note: CI and unit tests are currently failing due to #18

@valosekj
Copy link
Member

To proceed with the merge, we need to remove 54ead73 and 2bad1f2 commits from this branch (context: these two commits were removed from main in #18). I'll try to do it today with Mathieu.

@valosekj valosekj force-pushed the nm/allow_json_mapping_usage branch from bbc3a00 to 0a34add Compare December 12, 2024 19:02
@valosekj
Copy link
Member

Okay, @mguaypaq and I did an interactive rebase ( git rebase -i 76dbb556ac0a5bad1a7aecdb80f5effec8af739b) to remove the two commits mentioned in #16 (comment).
@NathanMolinier, unfortunately, it might be dangerous to run git pull now. Better would be to completely re-clone the repo.

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.

2 participants