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

Bring metrics in PAM50 anatomical dimensions in sct_process_segmentation #3977

Merged
merged 80 commits into from Feb 8, 2023

Conversation

sandrinebedard
Copy link
Member

@sandrinebedard sandrinebedard commented Dec 7, 2022

Checklist

GitHub

PR contents

Description

This PR adresses #3733 . The concept is to bring metrics generated in sct_process_segmentation to the PAM50 anatomical space in order to do slicewise comparison. The metrics need to be computed slicewise and the vertfile needs to be specified. 2 .csv files will be output.

  • Adds the option -normalize PAM50 in sct_process_segmentation
  • Brings the metrics in the PAM50 anatomical dimensions in metrics_to_PAM50.py
    • Interpolates metrics perlevel, except the first and last where scaling is applied
  • Aggregates metrics and save in a second .csv file.

To run the script:

sct_process_segmentation -i <segmentation> -perslice 1 -vertfile <labeled segmentation> -normalize-PAM50 1

Linked issues

Fixes #3733. (We should reopen the issue after this PR is merged, as there are other ideas in the issue.)

@sandrinebedard sandrinebedard added sct_process_segmentation context: feature category: new functionality labels Dec 7, 2022
@sandrinebedard sandrinebedard added this to the 6.0 milestone Dec 7, 2022
@sandrinebedard sandrinebedard self-assigned this Dec 7, 2022
@sandrinebedard sandrinebedard marked this pull request as draft December 7, 2022 16:15
Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the SUM(length) column, put n/a instead

@sandrinebedard
Copy link
Member Author

TODO: change the output csv file with _PAM50 only!

Copy link
Member

@joshuacwnewton joshuacwnewton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new changes LGTM! But, as a result of the newest changes, we now have test failures.

testing/cli/test_cli_sct_process_segmentation.py Outdated Show resolved Hide resolved
testing/cli/test_cli_sct_process_segmentation.py Outdated Show resolved Hide resolved
Copy link
Member

@joshuacwnewton joshuacwnewton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm just about ready to approve this? It mostly LGTM! I just had one last question (and one more task for myself).

spinalcordtoolbox/download.py Outdated Show resolved Hide resolved
Copy link
Member

@joshuacwnewton joshuacwnewton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the tests pass with the new dataset release, this LGTM! I'd say it's ready to merge.

Links to next steps:

@sandrinebedard sandrinebedard merged commit 2f592a9 into master Feb 8, 2023
@sandrinebedard sandrinebedard deleted the sb/3733-bring-metrics-to-pam50 branch February 8, 2023 21:09
valosekj added a commit to sct-pipeline/dcm-metric-normalization that referenced this pull request Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature category: new functionality sct_process_segmentation context:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add normalized metrics for degenerative cervical myelopathy (DCM)
4 participants